<NME> action-select-opened-project.cocoascript
<BEF> @import 'actions/view-inventory.cocoascript'


var openedProjectCellWidth = 240
var openedProjectCellHeight = 24





var selectOpenedProject = function(openedFramerProjects) {

	var exportFramerFolderBackup = userDefaults.exportFramerFolder
	var openedProjectsArray = [openedFramerProjects allValues]


	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, 240, 96 + 16 + openedProjectCellHeight * openedProjectsArray.count() + 180) display:false];
	[artboardsWindow setBackgroundColor:ViewInventory.colorWindow()];

	var titleImageView = ViewInventory.addImage(NSMakeRect(16, 73 + 96 + 16 + openedProjectCellHeight * openedProjectsArray.count(), 208, 84), "modals/choose-framer");
	[[artboardsWindow contentView] addSubview:titleImageView];
	var titleImageDescriptionView = ViewInventory.addImage(NSMakeRect(16, 16 + 96 + 16 + openedProjectCellHeight * openedProjectsArray.count(), 208, 54), "modals/choose-framer-some");
	[[artboardsWindow contentView] addSubview:titleImageDescriptionView];

	var projectIcons = createOpenedProjectsIcons(openedProjectsArray)
	for (var i = 0; i < projectIcons.count(); i++) { [[artboardsWindow contentView] addSubview:[projectIcons objectAtIndex:i]] }

	var group = createRadioGroupOpenedProjects(openedProjectsArray)
	[[artboardsWindow contentView] addSubview:group];


	var selectManuallyButton = ViewInventory.addButton(NSMakeRect(16, 32 + 96 + 16 + openedProjectCellHeight * openedProjectsArray.count(), 148, 20), "modals/empty",
			function(sender){
				[artboardsWindow orderOut:nil]
				[NSApp stopModal]

				FramerInventory.runSelectProjectFolder()
	})
	[[artboardsWindow contentView] addSubview:selectManuallyButton];


	var selectFolderButton = [[NSButton alloc] initWithFrame:NSMakeRect(12, 34, 240-32+8, 32)];
	[selectFolderButton setTitle:"Select Project"];
	[selectFolderButton setBezelStyle:NSRoundedBezelStyle];
	[selectFolderButton setFont:ViewInventory.fontActionButton()];
	[selectFolderButton setKeyEquivalent:"\r"];
	[selectFolderButton setCOSJSTargetFunction:function(sender) {
		[artboardsWindow orderOut:nil]
		[NSApp stopModal]

		[currentDocument showMessage:ViewInventory.smileDone() + "Selected project: " + PathInventory.returnProjectNameFromPath([[openedFramerProjects allValues] firstObject])]
		// ToolbarInventory.setContentView()


	}];
	[selectFolderButton setAction:"callAction:"];
	[[artboardsWindow contentView] addSubview:selectFolderButton];



	var cancelButton = [[NSButton alloc] initWithFrame:NSMakeRect(12, 8, 240-32+8, 32)];
	[cancelButton setTitle:"Cancel"];
	[cancelButton setFont:ViewInventory.fontActionButton()];
	[cancelButton setBezelStyle:NSRoundedBezelStyle];
	[cancelButton setKeyEquivalent:"\033"]
	[cancelButton setCOSJSTargetFunction:function(sender) {
		[artboardsWindow orderOut:nil]
		[NSApp stopModal]

		userDefaults.exportFramerFolder = exportFramerFolderBackup
		saveDefaults(Status.userDomain(), userDefaults)

	}];
	[cancelButton setAction:"callAction:"]
	[[artboardsWindow contentView] addSubview:cancelButton];


	[NSApp runModalForWindow:artboardsWindow];
}




var createOpenedProjectsIcons = function(openedProjectsArray) {
	var projectIcons = NSMutableArray.new()
	for (var i = 0; i < openedProjectsArray.count(); i++) {
		var currentProjectIcon = ViewInventory.addImage(NSMakeRect(38, 96 + (openedProjectCellHeight + 1) * i, 20, 20), "modals/framer-folder");
		[projectIcons addObject:currentProjectIcon]
	}
	return projectIcons
}


var createRadioGroupOpenedProjects = function(openedProjectsArray) {
	var openedProjectsTitles = NSMutableArray.new()

	var prototype = [[NSButtonCell alloc] init];
	[prototype setTitle:"Opened projects"];
	[prototype setButtonType:NSRadioButton];
	[prototype setFont:ViewInventory.fontRadioButton()];

	var matrixRect = NSMakeRect(16, 96, openedProjectCellWidth, openedProjectCellHeight * openedProjectsArray.count());
	var myMatrix = [[NSMatrix alloc] initWithFrame:matrixRect
																						mode:NSRadioModeMatrix
																			 prototype:prototype
																		numberOfRows:openedProjectsArray.count()
																 numberOfColumns:1];

	var cellArray = [myMatrix cells];
	for (var i = 0; i < openedProjectsArray.count(); i++) {
		var currentCellTitle = "        " + PathInventory.returnProjectNameFromPath([openedProjectsArray objectAtIndex: i])
		[openedProjectsTitles addObject:currentCellTitle]
		[[cellArray objectAtIndex:i] setTitle:currentCellTitle];
	}

	[myMatrix setCellSize:NSMakeSize(openedProjectCellWidth, openedProjectCellHeight)]

	var selectedCellNumber = returnSelectedCellNumber(userDefaults.exportFramerFolder, openedProjectsArray)
	if (selectedCellNumber > -1) { [myMatrix selectCellAtRow:selectedCellNumber column:0] }
	else {
		userDefaults.exportFramerFolder = [openedProjectsArray firstObject]
		saveDefaults(Status.userDomain(), userDefaults)
	}


	[myMatrix setCOSJSTargetFunction:function(sender) {
		var currentCellTitle = [[myMatrix selectedCell] title]

		for (var i = 0; i < openedProjectsTitles.count(); i++) {
			var currentArrayTitle = [openedProjectsTitles objectAtIndex:i]

			if ([currentCellTitle isEqualToString:currentArrayTitle]) {
				userDefaults.exportFramerFolder = [openedProjectsArray objectAtIndex:i]
				saveDefaults(Status.userDomain(), userDefaults)
				break
			}
		}

	}];

	return myMatrix
}



var returnSelectedCellNumber = function(currentlySelectedPath, openedProjectsArray) {

	for (var i = 0; i < openedProjectsArray.count(); i++) {
		var currentPath = [openedProjectsArray objectAtIndex:i]
		if ([currentPath containsString:currentlySelectedPath]) { return i; }
	}

	return -1
}











var selectProjectWithNoOpened = 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, 240, 260) display:false];
	[artboardsWindow setBackgroundColor:ViewInventory.colorWindow()];


	var titleImageView = ViewInventory.addImage(NSMakeRect(16, 154, 208, 84), "modals/choose-framer");
	[[artboardsWindow contentView] addSubview:titleImageView];

	var titleImageDescriptionView = ViewInventory.addImage(NSMakeRect(16, 96, 208, 54), "modals/choose-framer-none");
	[[artboardsWindow contentView] addSubview:titleImageDescriptionView];



	var selectFolderButton = [[NSButton alloc] initWithFrame:NSMakeRect(16, 34, 240-32, 32)];
	[selectFolderButton setTitle:"Select Folder Manually"];
	[selectFolderButton setBezelStyle:NSRoundedBezelStyle];
	[selectFolderButton setFont:ViewInventory.fontActionButton()];
	// [selectFolderButton setKeyEquivalent:"\r"];
	[selectFolderButton setCOSJSTargetFunction:function(sender) {
		[artboardsWindow orderOut:nil]
		[NSApp stopModal]

		FramerInventory.runSelectProjectFolder()

	}];
	[selectFolderButton setAction:"callAction:"];
	[[artboardsWindow contentView] addSubview:selectFolderButton];



	var cancelButton = [[NSButton alloc] initWithFrame:NSMakeRect(16, 8, 240-32, 32)];
	[cancelButton setTitle:"Cancel"];
	[cancelButton setFont:ViewInventory.fontActionButton()];
	[cancelButton setBezelStyle:NSRoundedBezelStyle];
	[cancelButton setKeyEquivalent:"\033"]
	[cancelButton setCOSJSTargetFunction:function(sender) {
		[artboardsWindow orderOut:nil]
		[NSApp stopModal]
	}];
	[cancelButton setAction:"callAction:"]
	[[artboardsWindow contentView] addSubview:cancelButton];


	[NSApp runModalForWindow:artboardsWindow];
}

<MSG> Updated Open Selected Project view

– fixed vertical asynchronization
– fixed line breaks
– added tooltips to let you choose between long names

<DFF> @@ -105,7 +105,7 @@ var createRadioGroupOpenedProjects = function(openedProjectsArray) {
 	[prototype setButtonType:NSRadioButton];
 	[prototype setFont:ViewInventory.fontRadioButton()];
 
-	var matrixRect = NSMakeRect(16, 96, openedProjectCellWidth, openedProjectCellHeight * openedProjectsArray.count());
+	var matrixRect = NSMakeRect(16, 96, openedProjectCellWidth - 32, 4 + openedProjectCellHeight * openedProjectsArray.count());
 	var myMatrix = [[NSMatrix alloc] initWithFrame:matrixRect
 																						mode:NSRadioModeMatrix
 																			 prototype:prototype
@@ -114,12 +114,15 @@ var createRadioGroupOpenedProjects = function(openedProjectsArray) {
 
 	var cellArray = [myMatrix cells];
 	for (var i = 0; i < openedProjectsArray.count(); i++) {
+		var currentCell = [cellArray objectAtIndex:i]
 		var currentCellTitle = "        " + PathInventory.returnProjectNameFromPath([openedProjectsArray objectAtIndex: i])
 		[openedProjectsTitles addObject:currentCellTitle]
-		[[cellArray objectAtIndex:i] setTitle:currentCellTitle];
+		[currentCell setLineBreakMode:NSLineBreakByTruncatingTail];
+		[myMatrix setToolTip:currentCellTitle forCell:currentCell]
+		[currentCell setTitle:currentCellTitle];
 	}
 
-	[myMatrix setCellSize:NSMakeSize(openedProjectCellWidth, openedProjectCellHeight)]
+	[myMatrix setCellSize:NSMakeSize(openedProjectCellWidth - 32, openedProjectCellHeight)]
 
 	var selectedCellNumber = returnSelectedCellNumber(userDefaults.exportFramerFolder, openedProjectsArray)
 	if (selectedCellNumber > -1) { [myMatrix selectCellAtRow:selectedCellNumber column:0] }

{'commit': 'diff --git a/Framer Inventory.sketchplugin/Contents/Sketch/actions/workers/modals/action-select-opened-project.cocoascript b/Framer Inventory.sketchplugin/Contents/Sketch/actions/workers/modals/action-select-opened-project.cocoascript\nindex 4c10e27..2bd5b6a 100644\n--- a/Framer Inventory.sketchplugin/Contents/Sketch/actions/workers/modals/action-select-opened-project.cocoascript\t\n+++ b/Framer Inventory.sketchplugin/Contents/Sketch/actions/workers/modals/action-select-opened-project.cocoascript\t\n@@ -105,7 +105,7 @@ var createRadioGroupOpenedProjects = function(openedProjectsArray) {\n \t[prototype setButtonType:NSRadioButton];\n \t[prototype setFont:ViewInventory.fontRadioButton()];\n \n-\tvar matrixRect = NSMakeRect(16, 96, openedProjectCellWidth, openedProjectCellHeight * openedProjectsArray.count());\n+\tvar matrixRect = NSMakeRect(16, 96, openedProjectCellWidth - 32, 4 + openedProjectCellHeight * openedProjectsArray.count());\n \tvar myMatrix = [[NSMatrix alloc] initWithFrame:matrixRect\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmode:NSRadioModeMatrix\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t prototype:prototype\n@@ -114,12 +114,15 @@ var createRadioGroupOpenedProjects = function(openedProjectsArray) {\n \n \tvar cellArray = [myMatrix cells];\n \tfor (var i = 0; i < openedProjectsArray.count(); i++) {\n+\t\tvar currentCell = [cellArray objectAtIndex:i]\n \t\tvar currentCellTitle = "        " + PathInventory.returnProjectNameFromPath([openedProjectsArray objectAtIndex: i])\n \t\t[openedProjectsTitles addObject:currentCellTitle]\n-\t\t[[cellArray objectAtIndex:i] setTitle:currentCellTitle];\n+\t\t[currentCell setLineBreakMode:NSLineBreakByTruncatingTail];\n+\t\t[myMatrix setToolTip:currentCellTitle forCell:currentCell]\n+\t\t[currentCell setTitle:currentCellTitle];\n \t}\n \n-\t[myMatrix setCellSize:NSMakeSize(openedProjectCellWidth, openedProjectCellHeight)]\n+\t[myMatrix setCellSize:NSMakeSize(openedProjectCellWidth - 32, openedProjectCellHeight)]\n \n \tvar selectedCellNumber = returnSelectedCellNumber(userDefaults.exportFramerFolder, openedProjectsArray)\n \tif (selectedCellNumber > -1) { [myMatrix selectCellAtRow:selectedCellNumber column:0] }\n', 'commit_subject': 'Updated Open Selected Project view', 'repo_name': 'timurnurutdinov/Framer-Inventory-for-Sketch', 'committer': {'name': 'Timur Nurutdinov', 'email': 'a15d24637b0264d1b5874cf645c477d3dcf774d1@gmail.com', 'time_sec': '1508426060', 'tz_offset': '180', 'date': {'seconds': '1508426060'}}, 'commit_tree': '09b829dd031f40851eb6481963bdeaa6dcd84246', 'commit_message': 'Updated Open Selected Project view\n\n– fixed vertical asynchronization\n– fixed line breaks\n– added tooltips to let you choose between long names\n', 'language_name': 'JavaScript', 'license': 'apache-2.0', 'hunks': '@@ -105,7 +105,7 @@ var createRadioGroupOpenedProjects = function(openedProjectsArray) {\n \t[prototype setButtonType:NSRadioButton];\n \t[prototype setFont:ViewInventory.fontRadioButton()];\n \n-\tvar matrixRect = NSMakeRect(16, 96, openedProjectCellWidth, openedProjectCellHeight * openedProjectsArray.count());\n+\tvar matrixRect = NSMakeRect(16, 96, openedProjectCellWidth - 32, 4 + openedProjectCellHeight * openedProjectsArray.count());\n \tvar myMatrix = [[NSMatrix alloc] initWithFrame:matrixRect\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmode:NSRadioModeMatrix\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t prototype:prototype\n@@ -114,12 +114,15 @@ var createRadioGroupOpenedProjects = function(openedProjectsArray) {\n \n \tvar cellArray = [myMatrix cells];\n \tfor (var i = 0; i < openedProjectsArray.count(); i++) {\n+\t\tvar currentCell = [cellArray objectAtIndex:i]\n \t\tvar currentCellTitle = "        " + PathInventory.returnProjectNameFromPath([openedProjectsArray objectAtIndex: i])\n \t\t[openedProjectsTitles addObject:currentCellTitle]\n-\t\t[[cellArray objectAtIndex:i] setTitle:currentCellTitle];\n+\t\t[currentCell setLineBreakMode:NSLineBreakByTruncatingTail];\n+\t\t[myMatrix setToolTip:currentCellTitle forCell:currentCell]\n+\t\t[currentCell setTitle:currentCellTitle];\n \t}\n \n-\t[myMatrix setCellSize:NSMakeSize(openedProjectCellWidth, openedProjectCellHeight)]\n+\t[myMatrix setCellSize:NSMakeSize(openedProjectCellWidth - 32, openedProjectCellHeight)]\n \n \tvar selectedCellNumber = returnSelectedCellNumber(userDefaults.exportFramerFolder, openedProjectsArray)\n \tif (selectedCellNumber > -1) { [myMatrix selectCellAtRow:selectedCellNumber column:0] }\n', 'addition_count': 6, 'deletion_count': 3, 'src_file': 'a/Framer Inventory.sketchplugin/Contents/Sketch/actions/workers/modals/action-select-opened-project.cocoascript', 'tgt_file': 'b/Framer Inventory.sketchplugin/Contents/Sketch/actions/workers/modals/action-select-opened-project.cocoascript', 'file_extension': '.cocoascript', 'before_file': '@import \'actions/view-inventory.cocoascript\'\n\n\nvar openedProjectCellWidth = 240\nvar openedProjectCellHeight = 24\n\n\n\n\n\nvar selectOpenedProject = function(openedFramerProjects) {\n\n\tvar exportFramerFolderBackup = userDefaults.exportFramerFolder\n\tvar openedProjectsArray = [openedFramerProjects allValues]\n\n\n\tvar artboardsWindow = [[NSWindow alloc] init]\n\tartboardsWindow.setStyleMask(NSTitledWindowMask + NSFullSizeContentViewWindowMask);\n\tartboardsWindow.setTitlebarAppearsTransparent(true);\n\tartboardsWindow.setTitleVisibility(NSWindowTitleHidden);\n\tartboardsWindow.setTitlebarAppearsTransparent(true);\n\tartboardsWindow.setMovableByWindowBackground(true);\n\t[artboardsWindow setFrame:NSMakeRect(0, 0, 240, 96 + 16 + openedProjectCellHeight * openedProjectsArray.count() + 180) display:false];\n\t[artboardsWindow setBackgroundColor:ViewInventory.colorWindow()];\n\n\tvar titleImageView = ViewInventory.addImage(NSMakeRect(16, 73 + 96 + 16 + openedProjectCellHeight * openedProjectsArray.count(), 208, 84), "modals/choose-framer");\n\t[[artboardsWindow contentView] addSubview:titleImageView];\n\tvar titleImageDescriptionView = ViewInventory.addImage(NSMakeRect(16, 16 + 96 + 16 + openedProjectCellHeight * openedProjectsArray.count(), 208, 54), "modals/choose-framer-some");\n\t[[artboardsWindow contentView] addSubview:titleImageDescriptionView];\n\n\tvar projectIcons = createOpenedProjectsIcons(openedProjectsArray)\n\tfor (var i = 0; i < projectIcons.count(); i++) { [[artboardsWindow contentView] addSubview:[projectIcons objectAtIndex:i]] }\n\n\tvar group = createRadioGroupOpenedProjects(openedProjectsArray)\n\t[[artboardsWindow contentView] addSubview:group];\n\n\n\tvar selectManuallyButton = ViewInventory.addButton(NSMakeRect(16, 32 + 96 + 16 + openedProjectCellHeight * openedProjectsArray.count(), 148, 20), "modals/empty",\n\t\t\tfunction(sender){\n\t\t\t\t[artboardsWindow orderOut:nil]\n\t\t\t\t[NSApp stopModal]\n\n\t\t\t\tFramerInventory.runSelectProjectFolder()\n\t})\n\t[[artboardsWindow contentView] addSubview:selectManuallyButton];\n\n\n\tvar selectFolderButton = [[NSButton alloc] initWithFrame:NSMakeRect(12, 34, 240-32+8, 32)];\n\t[selectFolderButton setTitle:"Select Project"];\n\t[selectFolderButton setBezelStyle:NSRoundedBezelStyle];\n\t[selectFolderButton setFont:ViewInventory.fontActionButton()];\n\t[selectFolderButton setKeyEquivalent:"\\r"];\n\t[selectFolderButton setCOSJSTargetFunction:function(sender) {\n\t\t[artboardsWindow orderOut:nil]\n\t\t[NSApp stopModal]\n\n\t\t[currentDocument showMessage:ViewInventory.smileDone() + "Selected project: " + PathInventory.returnProjectNameFromPath([[openedFramerProjects allValues] firstObject])]\n\t\t// ToolbarInventory.setContentView()\n\n\n\t}];\n\t[selectFolderButton setAction:"callAction:"];\n\t[[artboardsWindow contentView] addSubview:selectFolderButton];\n\n\n\n\tvar cancelButton = [[NSButton alloc] initWithFrame:NSMakeRect(12, 8, 240-32+8, 32)];\n\t[cancelButton setTitle:"Cancel"];\n\t[cancelButton setFont:ViewInventory.fontActionButton()];\n\t[cancelButton setBezelStyle:NSRoundedBezelStyle];\n\t[cancelButton setKeyEquivalent:"\\033"]\n\t[cancelButton setCOSJSTargetFunction:function(sender) {\n\t\t[artboardsWindow orderOut:nil]\n\t\t[NSApp stopModal]\n\n\t\tuserDefaults.exportFramerFolder = exportFramerFolderBackup\n\t\tsaveDefaults(Status.userDomain(), userDefaults)\n\n\t}];\n\t[cancelButton setAction:"callAction:"]\n\t[[artboardsWindow contentView] addSubview:cancelButton];\n\n\n\t[NSApp runModalForWindow:artboardsWindow];\n}\n\n\n\n\nvar createOpenedProjectsIcons = function(openedProjectsArray) {\n\tvar projectIcons = NSMutableArray.new()\n\tfor (var i = 0; i < openedProjectsArray.count(); i++) {\n\t\tvar currentProjectIcon = ViewInventory.addImage(NSMakeRect(38, 96 + (openedProjectCellHeight + 1) * i, 20, 20), "modals/framer-folder");\n\t\t[projectIcons addObject:currentProjectIcon]\n\t}\n\treturn projectIcons\n}\n\n\nvar createRadioGroupOpenedProjects = function(openedProjectsArray) {\n\tvar openedProjectsTitles = NSMutableArray.new()\n\n\tvar prototype = [[NSButtonCell alloc] init];\n\t[prototype setTitle:"Opened projects"];\n\t[prototype setButtonType:NSRadioButton];\n\t[prototype setFont:ViewInventory.fontRadioButton()];\n\n\tvar matrixRect = NSMakeRect(16, 96, openedProjectCellWidth, openedProjectCellHeight * openedProjectsArray.count());\n\tvar myMatrix = [[NSMatrix alloc] initWithFrame:matrixRect\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmode:NSRadioModeMatrix\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t prototype:prototype\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnumberOfRows:openedProjectsArray.count()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t numberOfColumns:1];\n\n\tvar cellArray = [myMatrix cells];\n\tfor (var i = 0; i < openedProjectsArray.count(); i++) {\n\t\tvar currentCellTitle = "        " + PathInventory.returnProjectNameFromPath([openedProjectsArray objectAtIndex: i])\n\t\t[openedProjectsTitles addObject:currentCellTitle]\n\t\t[[cellArray objectAtIndex:i] setTitle:currentCellTitle];\n\t}\n\n\t[myMatrix setCellSize:NSMakeSize(openedProjectCellWidth, openedProjectCellHeight)]\n\n\tvar selectedCellNumber = returnSelectedCellNumber(userDefaults.exportFramerFolder, openedProjectsArray)\n\tif (selectedCellNumber > -1) { [myMatrix selectCellAtRow:selectedCellNumber column:0] }\n\telse {\n\t\tuserDefaults.exportFramerFolder = [openedProjectsArray firstObject]\n\t\tsaveDefaults(Status.userDomain(), userDefaults)\n\t}\n\n\n\t[myMatrix setCOSJSTargetFunction:function(sender) {\n\t\tvar currentCellTitle = [[myMatrix selectedCell] title]\n\n\t\tfor (var i = 0; i < openedProjectsTitles.count(); i++) {\n\t\t\tvar currentArrayTitle = [openedProjectsTitles objectAtIndex:i]\n\n\t\t\tif ([currentCellTitle isEqualToString:currentArrayTitle]) {\n\t\t\t\tuserDefaults.exportFramerFolder = [openedProjectsArray objectAtIndex:i]\n\t\t\t\tsaveDefaults(Status.userDomain(), userDefaults)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t}];\n\n\treturn myMatrix\n}\n\n\n\nvar returnSelectedCellNumber = function(currentlySelectedPath, openedProjectsArray) {\n\n\tfor (var i = 0; i < openedProjectsArray.count(); i++) {\n\t\tvar currentPath = [openedProjectsArray objectAtIndex:i]\n\t\tif ([currentPath containsString:currentlySelectedPath]) { return i; }\n\t}\n\n\treturn -1\n}\n\n\n\n\n\n\n\n\n\n\n\nvar selectProjectWithNoOpened = function() {\n\n\tvar artboardsWindow = [[NSWindow alloc] init]\n\tartboardsWindow.setStyleMask(NSTitledWindowMask + NSFullSizeContentViewWindowMask);\n\tartboardsWindow.setTitlebarAppearsTransparent(true);\n\tartboardsWindow.setTitleVisibility(NSWindowTitleHidden);\n\tartboardsWindow.setTitlebarAppearsTransparent(true);\n\tartboardsWindow.setMovableByWindowBackground(true);\n\t[artboardsWindow setFrame:NSMakeRect(0, 0, 240, 260) display:false];\n\t[artboardsWindow setBackgroundColor:ViewInventory.colorWindow()];\n\n\n\tvar titleImageView = ViewInventory.addImage(NSMakeRect(16, 154, 208, 84), "modals/choose-framer");\n\t[[artboardsWindow contentView] addSubview:titleImageView];\n\n\tvar titleImageDescriptionView = ViewInventory.addImage(NSMakeRect(16, 96, 208, 54), "modals/choose-framer-none");\n\t[[artboardsWindow contentView] addSubview:titleImageDescriptionView];\n\n\n\n\tvar selectFolderButton = [[NSButton alloc] initWithFrame:NSMakeRect(16, 34, 240-32, 32)];\n\t[selectFolderButton setTitle:"Select Folder Manually"];\n\t[selectFolderButton setBezelStyle:NSRoundedBezelStyle];\n\t[selectFolderButton setFont:ViewInventory.fontActionButton()];\n\t// [selectFolderButton setKeyEquivalent:"\\r"];\n\t[selectFolderButton setCOSJSTargetFunction:function(sender) {\n\t\t[artboardsWindow orderOut:nil]\n\t\t[NSApp stopModal]\n\n\t\tFramerInventory.runSelectProjectFolder()\n\n\t}];\n\t[selectFolderButton setAction:"callAction:"];\n\t[[artboardsWindow contentView] addSubview:selectFolderButton];\n\n\n\n\tvar cancelButton = [[NSButton alloc] initWithFrame:NSMakeRect(16, 8, 240-32, 32)];\n\t[cancelButton setTitle:"Cancel"];\n\t[cancelButton setFont:ViewInventory.fontActionButton()];\n\t[cancelButton setBezelStyle:NSRoundedBezelStyle];\n\t[cancelButton setKeyEquivalent:"\\033"]\n\t[cancelButton setCOSJSTargetFunction:function(sender) {\n\t\t[artboardsWindow orderOut:nil]\n\t\t[NSApp stopModal]\n\t}];\n\t[cancelButton setAction:"callAction:"]\n\t[[artboardsWindow contentView] addSubview:cancelButton];\n\n\n\t[NSApp runModalForWindow:artboardsWindow];\n}\n', 'message': 'Updated Open Selected Project view\n\n– fixed vertical asynchronization\n– fixed line breaks\n– added tooltips to let you choose between long names\n', 'author_name': 'Timur Nurutdinov', 'lang': 'sketchplugin/Contents/Sketch/actions/workers/modals/action-select-opened-project'}