Menu.DefineQuickMenuXML
-----------------------

Defines a menu based on a xml description.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Menu](component_Menu.md) | [5.2](newinversion52.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "Menu.DefineQuickMenuXML"; XML ) 

**MBS**( **"Menu.DefineQuickMenuXML";** /\* Defines a menu based on a xml description. \*/  
**$XML**) /\* The description XML. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| XML | The description XML. |  |

### Result

Returns menu reference or error.

### Description

Defines a menu based on a xml description.  
The xml has a root entry called "menu". Each menu entry can have attributes title, tag, groupID, scriptname, filename and modifierkeys. A menu can have subnodes of name menu or item. The item can have attributes title, tag, scriptname, filename, tag, enabled, selectable, Separator, mark, style, GroupID or modifierkeys.  
  
ModifierKeys can include shift, control, option or command.  
Mark can include mixed, bullet, diamond or checked.  
Style can include bold, italic or underline.  
If an item has name "-" or Separator=1 attribute, the plugin will mark it as being a separator.  
  
If the root menu entry has a name, we can use that name as menu reference.  
Added FontColor and BackColor in version 9.4.  
  
Added FontName and FontSize in version 13.0 to control the font for a menu item.  
### Examples

Defines a quick menu with XML:

 MBS ( "Menu.DefineQuickMenuXML"; "&lt;menu name=\\"menue\\"&gt;  
 &lt;menuitem name=\\"Red\\" value=\\"1\\" /&gt;  
 &lt;menuitem name=\\"Blue\\" value=\\"2\\" /&gt;  
 &lt;menuitem name=\\"Yellow\\" value=\\"3\\" /&gt;  
&lt;/menu&gt;" )  
Define a menu with submenus:

 MBS ( "Menu.DefineQuickMenuXML"; "&lt;menu name=\\"menue\\"&gt;  
 &lt;submenu name=\\"Warm Colors\\"&gt;  
 &lt;menuitem name=\\"Red\\" value=\\"1\\" /&gt;  
 &lt;menuitem name=\\"Blue\\" value=\\"2\\" /&gt;  
 &lt;menuitem name=\\"Yellow\\" value=\\"3\\" /&gt;  
 &lt;/submenu&gt;  
 &lt;submenu name=\\"Cool Colors\\"&gt;  
 &lt;menuitem name=\\"Blue\\" value=\\"4\\" /&gt;  
 &lt;menuitem name=\\"Green\\" value=\\"5\\" /&gt;  
 &lt;menuitem name=\\"Purple\\" value=\\"6\\" /&gt;  
 &lt;/submenu&gt;  
&lt;/menu&gt;\\")" )  
### See also

- [Menu.DefineQuickMenu](MenuDefineQuickMenu.md)

### Release notes

- **Version 13.0**
    - Added fontname and fontsize as keys for the XML for [Menu.DefineQuickMenuXML](https://www.mbsplugins.eu/MenuDefineQuickMenuXML.shtml) function. Now works for submenus, too.
- **Version 10.4**
    - Improved text encoding handling for XML Parsing in [XML](https://www.mbsplugins.eu/component_XML.shtml) functions, [Menu.DefineQuickMenuXML](https://www.mbsplugins.eu/MenuDefineQuickMenuXML.shtml) and [Clipboard](https://www.mbsplugins.eu/component_Clipboard.shtml) functions.
- **Version 9.4**
    - Added new keys FontColor and BackColor elements to XML for [Menu.DefineQuickMenuXML](http://www.mbsplugins.eu/MenuDefineQuickMenuXML.shtml) to define colors.

### Example Databases

- [Menu/DefineQuickMenu with XML](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Menu/DefineQuickMenu%20with%20XML.shtml#1ScriptAnchor_)

### Blog Entries

- [Neues MBS Plugin 13.0 für Claris FileMaker](https://www.mbsplugins.de/archive/2023-01-17/Neues_MBS_Plugin_130_für_Clar/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 13.0 for Claris FileMaker](https://www.mbsplugins.de/archive/2023-01-17/MBS_Plugin_130_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.0pr7](https://www.mbsplugins.de/archive/2023-01-11/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.0pr6](https://www.mbsplugins.de/archive/2023-01-09/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.4pr9](https://www.mbsplugins.de/archive/2020-09-11/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.4pr1](https://www.mbsplugins.de/archive/2019-08-08/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.2pr3](https://www.mbsplugins.de/archive/2015-06-13/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.2pr2](https://www.mbsplugins.de/archive/2015-06-08/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 6th June 2015 , last changed 6th January 2023

  
[Menu.DefineQuickMenu](MenuDefineQuickMenu.md) - [Menu.FindItemWithTag](MenuFindItemWithTag.md)

[HTML Version](MenuDefineQuickMenuXML.shtml)