Mac OS X
Components Crossplatform Mac & Win Server Client Old Guides Examples
New in version: 7.0 7.1 7.2 7.3 7.4 7.5 8.0 8.1 8.2 8.3 Statistic
Builds a new menu from a definition text with menu items.
|Component||Version||macOS||Windows||Server||FileMaker Cloud||FileMaker iOS SDK|
|Name||The title of the new menu.||"MainMenu"|
|Definition||The menu definition.||"Red;1¶Blue;2¶Yellow;3"|
Returns menu reference or error.
DescriptionBuilds a new menu from a definition text with menu items.
This function allows you to easily create a menu with a definition. The first two parameters are required. The "Name" parameter is the name of the menu.
The "Definition" parameter is a return-delimited list of menu items for this menu. Each line represents one item on the menu. You can specify a tag value for a menu item by appending a semi-colon and the value onto the end of the item name. For example, if you had "Blue;0000FF" on a line, your menu would have an item with the title "Blue" and when a user selected that item, the tag value "0000FF" could be used for your script. For sub-menus, specify the name of the sub-menu, followed by a greater-than sign (">") followed by the next sub-menu name or menu item. For example, if you had "Colors>Red" on a line, your menu would have a sub-menu named "Colors" with an item inside named "Red". Every sub-menu and menu item can be preceded with one or more special "meta tags" to specify different styles and marks for the sub-menu or item name as explained below:
|!||The item will appear disabled.|
|$||The item will require the shift key to be pressed in order to show up.|
|^||The item will require the control key to be pressed in order to show up.|
|~||The item will require the alt/option key to be pressed in order to show up. (this is the tilde character, which is shifted version of the key to the left of the 1 on English keyboards) (only available on Mac)|
|@||The item will require the command key to be pressed in order to show up. (only available on Mac)|
|#||The item will appear bold.|
|%||The item will appear italicized.|
|_||The item will appear underlined.|
|` or √||The item will appear with a check mark. (this is the backtick character, which is the key to the left of the 1 on English keyboards) (on Mac, you can also use opt-v to type an actual check mark)|
|* or •||The item will appear with a bullet mark. (On Mac, you can also use opt-8 to type an actual bullet mark)|
|+ or ◊||The item will appear with a diamond mark. (On Mac, you can also use shift-opt-v to type an actual diamond mark)|
|=||disable the meta tag processing for the rest of the sub-menu or item name.|
|-||The item is a separator.|
You can specify more than one of the above for any item to set multiple attributes at once, with the exception of the check mark, bullet mark, and diamond mark. You can only have one mark defined for a menu item. For example, if you had "!#%Delete Record" on a line, your menu would have an item with the name "Delete Record" that appeared disabled, bold, and italicized. If you need to display a menu item that starts with one of these "meta tags", you can use the equals ("=") meta tag to skip the meta tag processing for the item. For example, if you had "=$4.00" on a line, your menu would have an item with the name "$4.00" instead of a menu named "4.00" that required you to press the shift key in order to make the item visible.
Not all features available on Windows!
With 5.2 plugin the name of the menu also defines the identifier to use. You can leave name empty to use reference number provided by plugin.
Define a menu:
Define a menu with submenus:
Define a menu with checkmark:
Choose from menu with one Let statement:
Feedback: Report problem or ask question.
MBS Xojo PDF Plugins