Customize Script menu in CotEditor on Mac

You can change the order of scripts in the menu or assign keyboard shortcuts to scripts by modifying the filenames of your scripts in the script folder.

Order of items in the menu

By adding “number + closing parenthesis ())” at the head of the name, you can line up the files in numerical order. The part “number + )” won’t be shown in the menu.

Example
FilenameShow in the menu
01)Open File.scpt Open File

Separators

A folder named “-” appears as a separator line in the menu. By adding “number + closing parenthesis ())” at the head of the folder name, you can put a separator between the menu items.

Hidden files/folders

A file/folder whose name begins with the underscore “_” does not appear in the script menu. You can use it for setting files, library scripts, and so on.

Submenus

A script placed in a folder in the scripts folder appears in a submenu.

Keyboard shortcuts

By adding “dot (.) + modifier key + shortcut key” in front of the extension, you can assign a keyboard shortcut to the script.

Modifier key notations
NotationEquivalent key
^Control
$Shift
~Option
@Command
Examples
FilenameShow in the menuShortcut
Insert String.@e.scpt Insert String Command-E
03)Insert Date.@~Y.scpt Insert Date Option-Shift-Command-Y

Set the same shortcut to multiple scripts

CotEditor changes keyboard shortcut mapping dynamically to prioritize the scripts in the subfolder whose name is the same as the frontmost document’s syntax when the same keyboard shortcut is determined in multiple CotEditor scripts.

See also