Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
11.3
11.4
Statistic
FMM
Blog
Sets which script is called if a menu item in this menu is selected.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Menu | 4.1 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |
Parameter | Description | Example | Flags |
---|---|---|---|
item | The reference to the menu item. Please create one with MenuItem.CreateMenuItem or MenuItem.CreateSeparator. | $item | |
FileName | The filename of file which contains the script. | "Menus.fmp12" | |
ScriptName | The name of the script. | "MenuScript" | |
ScriptParameter | If you want a specific script parameter. Default is to leave empty and get the ID fo the menu item. You can store a value with the menu item via MenuItem.SetTag. |
Optional |
Returns OK or error.
Add menu item with script to be called:
Set Variable [$item; Value:MBS("MenuItem.CreateMenuItem"; "Hello World")]
Set Variable [$r; Value:MBS("MenuItem.SetScriptAction"; $item; Get(FileName); "MenuScript")]
Set Variable [$r; Value:MBS("Menu.AddItem"; $menu; $item)]
Created 18th August 2014, last changed 2nd December 2016
MenuItem.SetRequireShift - MenuItem.SetSelectable
Feedback: Report problem or ask question.