If your application-level menus inherit groups of menu items and use sanScript commands to manipulate items in those menus, you need to be aware of how the groups of inherited menu items are handled. The sanScript commands to manipulate menus, such as enable menu, disable menu, check menu, uncheck menu, hide menu, and show menu use a number to specify which menu item to alter. The menu items added by the groups of inheritable options are not counted when you specify which menu item to alter.
For example, inheriting the clipboard functions adds six menu items and two separators to a menu. None of these items are counted when specifying a menu item for a sanScript command. In the following illustration, the clipboard functions were inherited. Four additional items were added to the menu.
The four additional menu items are numbered 1 through 4, even though they are in positions 9 through 12 in the menu. This is because the group of inherited clipboard functions isn’t counted.
The following sanScript statement would disable the Preferences menu item.
disable menu Edit 4;
Only the groups of inherited menu items such as the clipboard functions or window list are ignored. Individual inherited actions, such as Show Required and Lookup, are counted when using the sanScript menu commands. |