Menu.AddItems
-------------

Adds a couple of menu items.

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

MBS( "Menu.AddItems"; menu; titles { ; tags } ) 

**MBS**( **"Menu.AddItems";** /\* Adds a couple of menu items. \*/  
**$menu**; /\* The reference to the menu. Please create one with [Menu.CreateMenu](MenuCreateMenu.md). \*/   
**$titles**; /\* The list of titles for new menu items.e.g. "Hello" \*/   
**$tags**) /\* Optional; The tags for the entries. \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| menu | The reference to the menu. Please create one with [Menu.CreateMenu](MenuCreateMenu.md). | $menu |  |
| titles | The list of titles for new menu items. | "Hello" |  |
| tags | The tags for the entries. |  | Optional |

### Result

Returns OK or error.

### Description

Adds a couple of menu items.  
If the list of titles includes a line with "-" the plugin version 4.5 and newer will use a separator for this item.  
### Examples

Add two items

 MBS ( "Menu.AddItems"; $menu ; "Hello¶World" )  
Add two items with tags

 MBS ( "Menu.AddItems"; $menu ; "Hello¶World"; "11¶12" )  
QuickMenu custom function:

 Let ( \[  
/\* custom function with parameters: Items \*/  
  
/\* Create a menu \*/  
menu = MBS ( "[Menu.CreateMenu](MenuCreateMenu.md)" );  
/\* add items from our parameter \*/  
m2 = MBS ( "Menu.AddItems"; menu; Items );   
/\* show menu at mouse position \*/  
m3 = MBS ( "[Menu.PopUp](MenuPopUp.md)"; menu; "mouse"; 0; 0 );  
/\* query selected item \*/  
selectedItem = MBS ( "[Menu.SelectedItem](MenuSelectedItem.md)"; menu );  
/\* if something is selected, query its text \*/  
result = If( Length(selectedItem )&gt;0; MBS ( "[MenuItem.GetTitle](MenuItemGetTitle.md)"; selectedItem ); "");  
/\* Cleanup menu \*/  
m5 = MBS ( "[Menu.Release](MenuRelease.md)"; menu; 1 )  
  
\];  
  
/\* return selection \*/  
result )  
QuickMenu custom function with tags

 Let ( \[  
/\* custom function with parameters: Items, Tags \*/  
  
/\* Create a menu \*/  
menu = MBS ( "[Menu.CreateMenu](MenuCreateMenu.md)" );  
/\* add items from our parameter \*/  
m2 = MBS ( "Menu.AddItems"; menu; Items; Tags );   
/\* show menu at mouse position \*/  
m3 = MBS ( "[Menu.PopUp](MenuPopUp.md)"; menu; "mouse"; 0; 0 );  
/\* query selected item \*/  
selectedItem = MBS ( "[Menu.SelectedItem](MenuSelectedItem.md)"; menu );  
/\* if something is selected, query its text \*/  
result = If( Length(selectedItem )&gt;0; MBS ( "[MenuItem.GetTag](MenuItemGetTag.md)"; selectedItem ); "");  
/\* Cleanup menu \*/  
m5 = MBS ( "[Menu.Release](MenuRelease.md)"; menu; 1 )  
  
\];  
  
/\* return selected tag \*/  
result )  
### See also

- [Menu.AddItem](MenuAddItem.md)
- [Menu.CreateMenu](MenuCreateMenu.md)
- [Menu.PopUp](MenuPopUp.md)
- [Menu.Release](MenuRelease.md)
- [Menu.SelectedItem](MenuSelectedItem.md)
- [MenuItem.GetTag](MenuItemGetTag.md)
- [MenuItem.GetTitle](MenuItemGetTitle.md)

### Example Databases

- [Menu/Popup Menu](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Menu/Popup%20Menu.shtml#2ScriptAnchor_)

### Blog Entries

- [QuickMenu function](https://www.mbsplugins.de/archive/2014-12-01/QuickMenu_function/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 4.5pr2](https://www.mbsplugins.de/archive/2014-12-01/MBS_Filemaker_Plugin_version_4/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 2/2021, Seite 29](https://filemaker-magazin.de/neuigkeit/4132-Appetithappen-FMM_202102)

This function checks for a license.

Created 18th August 2014 , last changed 5th September 2025

  
[Menu.AddItem](MenuAddItem.md) - [Menu.CreateMenu](MenuCreateMenu.md)

[HTML Version](MenuAddItems.shtml)