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:
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
Runs a menu command.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Menubar | 5.0 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |
Parameter | Description | Example | Flags |
---|---|---|---|
Path | The ID or path to the menu entry. Use Menubar.ListMenuCommands to find out the IDs and names. |
49297 | |
Delay | for macOS an optional delay to run the command after seconds. e.g. pass 0.1 to run command after 100ms. |
Optional |
Returns OK or error.
Run command to select all:
MBS("FM.RunMenuCommand"; "Bearbeiten¶Alles auswählen")
Show debugger:
MBS("Menubar.RunMenuCommand"; "Werkzeuge¶Script-Debugger")
Show debugger from within a script:
#The menu command as we got it from Menubar.ListMenuCommands
Set Variable [$DebuggerMenuID; Value:49260]
If [MBS( "Menubar.HasMenuCommand"; $DebuggerMenuID ) = 1]
If [MBS( "Menubar.IsMenuCommandChecked"; $DebuggerMenuID ) = 1]
#debugger already visible
Else
#show debugger
Set Variable [$r; Value:MBS( "Menubar.RunMenuCommand"; $DebuggerMenuID )]
Pause/Resume Script [Duration (seconds): ,1]
End If
Else
Show Custom Dialog ["Debugger missing in Menubar?"]
End If
#now follows your script that should always run in debugger
Show/Hide format bar in German:
Set Variable [ $r ; Value: MBS( "Schedule.EvaluateAfterDelay"; ,1; "MBS( \"Menubar.RunMenuCommand\"; Liste(\"Ansicht\"; \"Formatierungsleiste\") )") ]
Make snapshot link with F5 hotkey:
Set Variable [ $$Hotkey ; Value: MBS("HotKey.Register"; "F5"; "") ]
Set Variable [ $r ; Value: MBS( "HotKey.SetEvaluate"; $$Hotkey; "MBS( \"Menubar.RunMenuCommand\"; 50285 )" ) ]
Enter layout mode in a second:
Set Variable [ $r ; Value: MBS ( "Schedule.EvaluateAfterDelay" ; 1 ; "MBS ( \"Menubar.RunMenuCommand\" ; 49156 )" ) ]
Created 15th November 2014, last changed 12nd April 2021
Menubar.RemoveMenuCommand - Menubar.SetMenuCommandShortcut
Feedback: Report problem or ask question.