Submenus in the User Menu are produced by a type of library file, ``script menus'', which (at the top level) are found in the directories in the script search path. The script menus must have an extension ``.scm'' (``script menu''). The format is similar to library files:
(Library libname);
[nosort]
name1 path1
name2 path2
...
The first line must be a CIF comment line in the same format as other library files. The libname can be anything and is ignored. For top-level submenus, the basename of the file, stripped of the ``.scm'' suffix, will appear on the button in the User Menu which produces the pop-up menu.
Blank lines and lines starting with `#' are ignored. If a line contining the single word ``nosort'' is found, then the menu entries will be in the same order as in the file, otherwise they will be alphabetically sorted. The User Menu itself is always sorted.
The remaining lines in the file are name/path pairs, where the name is the label that will appear on the button in the pop-up sub-menu, and the path is a full path to a script file (with ``.scr'' extension) or another script menu file (with ``.scm'' extension) for a sub-submenu. Each name should be unique in the menu, duplicates are ignored. The scripts can be conveniently placed in a subdirectory of the directory containing the script menu file, which is not itself in the script path. If the reference is to another script menu, the pop-up menu will contain a button which will produce another pop-up menu containing the referenced menu file's entries. There is no limit on the depth of the references.
Only scripts which are defined in separate files can be referenced through a script library, not those defined in the technology file. Scripts defined in the technology file, and those added with the !script command, will appear in the main User Menu.