Menu.FindItemWithTag
--------------------

Finds a menu entry with given tag in a menu.

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

MBS( "Menu.FindItemWithTag"; menu; Tag { ; Recursive } ) 

**MBS**( **"Menu.FindItemWithTag";** /\* Finds a menu entry with given tag in a menu. \*/  
**$menu**; /\* The reference to the menu. Please create one with [Menu.CreateMenu](MenuCreateMenu.md). \*/   
**$Tag**; /\* The tag text to search. \*/   
**$Recursive**) /\* Optional; Pass 1 to look into sub menus recursively.  
Default is 0 to only search current menu.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| menu | The reference to the menu. Please create one with [Menu.CreateMenu](MenuCreateMenu.md). | $menu |  |
| Tag | The tag text to search. |  |  |
| Recursive | Pass 1 to look into sub menus recursively.   Default is 0 to only search current menu. | 1 | Optional      Added in version **1.0**. |

### Result

Returns reference number or error.

### Description

Finds a menu entry with given tag in a menu.  
  
See also [MenuItem.GetTag](MenuItemGetTag.md) and [MenuItem.SetTag](MenuItemSetTag.md).  
### Examples

Find an item:

 MBS ("Menu.FindItemWithTag"; $menu ; "Test")  
### See also

- [Menu.CreateMenu](MenuCreateMenu.md)
- [Menu.FindItemWithTitle](MenuFindItemWithTitle.md)
- [MenuItem.GetTag](MenuItemGetTag.md)
- [MenuItem.SetTag](MenuItemSetTag.md)

### Release notes

- **Version 13.0**
    - Added recursive parameter to [Menu.FindItemWithTag](https://www.mbsplugins.eu/MenuFindItemWithTag.shtml) and [Menu.FindItemWithTitle](https://www.mbsplugins.eu/MenuFindItemWithTitle.shtml) functions.

### Blog Entries

- [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 5.1pr7](https://www.mbsplugins.de/archive/2015-05-06/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 29th April 2015 , last changed 6th January 2023

  
[Menu.DefineQuickMenuXML](MenuDefineQuickMenuXML.md) - [Menu.FindItemWithTitle](MenuFindItemWithTitle.md)

[HTML Version](MenuFindItemWithTag.shtml)