Customize Script menu in CotEditor on Mac

You can change the order of items in the Script menu or assign keyboard shortcuts to scripts by modifying 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 place it at a specific position by adding a number followed by a closing parenthesis at the beginning of the name (for example, “02)-”).

Hide files or folders from the Script menu

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

Create submenus

Folders in the scripts folder appear as submenus.

Assign a keyboard shortcut to a script

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

Modifier keys are represented by the following symbols:

NotationEquivalent key
^Control
$Shift
~Option
@Command

For example, the following filenames appear in the menu with these shortcut keys:

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