<NME> action-select-folder.cocoascript
<BEF> ADDFILE
<MSG> Force to choose Framer folder

– Now we force user to choose Framer folder to start using actions.
– Added UI to choose a folder (then action is run from not the UIBar)
– Added smiles as a part of ViewInventory

<DFF> @@ -0,0 +1,66 @@
+var measureArtboardsPaddingLeft = 16
+var measureArtboardsWindowHeight = 240;
+var measureArtboardsWindowWidth = 240;
+
+var whiteColor = [NSColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1]
+var blackColor = [NSColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1]
+var lightColor = [NSColor colorWithRed:0.6 green:0.6 blue:0.6 alpha:1]
+var fieldColor = [NSColor colorWithSRGBRed:0.97 green:0.97 blue:0.97 alpha:1]
+var backgroundColor = [NSColor colorWithRed:0.15 green:0.15 blue:0.15 alpha:1]
+
+
+
+var selectFolder = function() {
+
+	var artboardsWindow = [[NSWindow alloc] init]
+	artboardsWindow.setStyleMask(NSTitledWindowMask + NSFullSizeContentViewWindowMask);
+	artboardsWindow.setTitlebarAppearsTransparent(true);
+	artboardsWindow.setTitleVisibility(NSWindowTitleHidden);
+	artboardsWindow.setTitlebarAppearsTransparent(true);
+	artboardsWindow.setMovableByWindowBackground(true);
+	[artboardsWindow setFrame:NSMakeRect(0, 0, measureArtboardsWindowWidth, measureArtboardsWindowHeight) display:false];
+	[artboardsWindow setBackgroundColor:NSColor.colorWithRed_green_blue_alpha(0.84, 0.84, 0.84, 1)];
+
+	var imageView = ViewInventory.addImage(NSMakeRect(0, 0, measureArtboardsWindowWidth, measureArtboardsWindowHeight), "modals/folder");
+	[[artboardsWindow contentView] addSubview:imageView];
+
+	var showDuplicatesButton = [[NSButton alloc] initWithFrame:NSMakeRect(measureArtboardsPaddingLeft-4, 6, measureArtboardsPaddingLeft*7, measureArtboardsPaddingLeft*2)];
+	[showDuplicatesButton setTitle:"Select Folder"];
+	[showDuplicatesButton setBezelStyle:NSRoundedBezelStyle];
+	[showDuplicatesButton setFont:ViewInventory.fontActionButton()];
+	[showDuplicatesButton setKeyEquivalent:"\r"];
+	[showDuplicatesButton setCOSJSTargetFunction:function(sender) {
+		[artboardsWindow orderOut:nil]
+		[NSApp stopModal]
+
+		FramerInventory.runSelectProjectFolder()
+
+		if (userDefaults.exportFramerFolder != "") {
+				if (currentCommandIdentifier == runSimulateKeynoteIdentifier) { runSimulateKeynote() }
+				else if (currentCommandIdentifier == runReplicateLayersIdentifier) { runReplicateLayers() }
+				else if (currentCommandIdentifier == runGenerateStates) { runGenerateStates() }
+		}
+
+	}];
+	[showDuplicatesButton setAction:"callAction:"];
+	[[artboardsWindow contentView] addSubview:showDuplicatesButton];
+
+
+	var cancelButton = [[NSButton alloc] initWithFrame:NSMakeRect(measureArtboardsPaddingLeft*8-8, 6, measureArtboardsPaddingLeft*5, measureArtboardsPaddingLeft*2)];
+	[cancelButton setTitle:"Cancel"];
+	[cancelButton setFont:ViewInventory.fontActionButton()];
+	[cancelButton setBezelStyle:NSRoundedBezelStyle];
+	[cancelButton setKeyEquivalent:"\033"]
+	[cancelButton setCOSJSTargetFunction:function(sender) {
+		[artboardsWindow orderOut:nil]
+		[NSApp stopModal]
+
+		[currentDocument showMessage:ViewInventory.smileWarning() + "Select Framer folder to continue"]
+
+	}];
+	[cancelButton setAction:"callAction:"]
+	[[artboardsWindow contentView] addSubview:cancelButton];
+
+
+	[NSApp runModalForWindow:artboardsWindow];
+}

Force to choose Framer folder