# 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
Filename | Show 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.

- Shortcut keys are case sensitive. The one in uppercase indicates that “the Shift key should be pressed together.” See the examples below to see how it works.
- A shortcut key must come after modifier keys and must be one letter. Thus, you can’t assign the keys, such as `F1` or `Delete`, to scripts.
- When the keyboard shortcut you set is already taken by another function, the shortcut for the script is ignored.

Modifier key notations
Notation | Equivalent key
--- | ---
^ | `Control`
$ | `Shift`
~ | `Option`
@ | `Command`

Examples
Filename | Show in the menu | Shortcut
--- | --- | ---
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

- Script CotEditor