Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

Menu.SetScriptAction

Sets which script is called if a menu item in this menu is selected.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Menu 4.1 Yes Yes No No No

MBS( "Menu.SetScriptAction"; menu; FileName; ScriptName { ; ScriptParameter } )

Parameters

Parameter Description Example value
menu The reference to the menu. Please create one with Menu.CreateMenu. $menu
FileName The filename of file which contains the script. "Menus.fmp12"
ScriptName The name of the script. "MenuScript"
ScriptParameter Optional
If you want a specific script parameter.
Default is to leave empty and get the ID fo the menu item.

Result

Returns OK or error.

Description

Sets which script is called if a menu item in this menu is selected.
You can use MenuItem.SetScriptAction to associate a script with individual items or use this function for a whole menu.
See also Menu.GetScriptFileName and Menu.GetScriptName.
The script parameter is the MenuItem reference, so you can use functions like MenuItem.GetTitle to get the title or MenuItem.GetTag to get an associated value.

With plugin version 6.0 or newer the script name can be a script ID number. In that case the plugin queries the script name for the given script ID. This allows to call scripts by ID and avoid problems if scripts are later renamed.

See also

Example Databases


Menu.SetMinimumWidth   -   Menu.SetShowsStateColumn

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins