Customize Script menu in CotEditor on Mac

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

Order items in the Script menu

To arrange scripts in a specific order, add a number followed by a closing parenthesis, such as “01)”, at the beginning of the filename. This prefix is used only for sorting and doesn’t appear in the Script menu.

For example:

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

Add separators to the Script menu

A file or folder named “-” becomes a separator in the Script menu. You can insert the separator at a specific position by adding a number followed by a closing parenthesis at the beginning of the folder name (for example, “02)-”).

Put hidden files/folders

A file or folder with a name that begins with an underscore “_” doesn’t appear in the Script menu. You can use these items to store settings files, library scripts, and other supporting resources.

Create submenus

A script placed inside a folder within the scripts folder appears as an item in a submenu.

Assign a keyboard shortcut to a script

You can assign a keyboard shortcut to a script by adding dot “.” followed by modifier keys and a shortcut key before the file extension.

Modifier keys are represented in the following symbols:

NotationEquivalent key
^Control
$Shift
~Option
@Command

For example, given the file names, the script names that appear in the menu and the shortcut keys assigned to them would be as follows:

FilenameShow in the menuShortcut
Insert Text.@e.scpt Insert Text Command-E
03)Insert Date.@~Y.scpt Insert Date Option-Shift-Command-Y

Set the same shortcut to multiple scripts

When multiple scripts share the same keyboard shortcut, CotEditor gives priority to scripts in a subfolder whose name matches the syntax of the current document. This priority updates dynamically as the current document changes.

See also