Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.2   7.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4   8.5    Statistic  


Runs a menu command.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Menubar 5.0 Yes Yes No No No
MBS( "Menubar.RunMenuCommand"; Path )   More


Parameter Description Example value
Path The ID or path to the menu entry.
Use Menubar.ListMenuCommands to find out the IDs and names.


Returns OK or error.


Runs a menu command.
The plugin searches menu command and invokes it.
For Windows, the command is run a asynchronously, so the function returns before the command runs. You may need to make a script pause to run the command.


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
        #show debugger
        Set Variable [$r; Value:MBS( "Menubar.RunMenuCommand"; $DebuggerMenuID )]
        Pause/Resume Script [Duration (seconds): ,1]
    End If
    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:

Variable setzen [ $r ; Wert: MBS( "Schedule.EvaluateAfterDelay"; ,1; "MBS( \"Menubar.RunMenuCommand\"; Liste(\"Ansicht\"; \"Formatierungsleiste\") )") ]

See also

Example Databases

Created 15th November 2014, last changed 28th March 2018

Menubar.RemoveMenuCommand   -   Menubar.SetMenuCommandShortcut

Feedback: Report problem or ask question.

MBS FileMaker Plugins