MenuItem.SetURL
---------------

Sets the URL to query when menuitem is used.

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

MBS( "MenuItem.SetURL"; Item; URL ) 

**MBS**( **"MenuItem.SetURL";** /\* Sets the URL to query when menuitem is used. \*/  
**$Item**; /\* The reference to the menu item. Please create one with [MenuItem.CreateMenuItem](MenuItemCreateMenuItem.md) or [MenuItem.CreateSeparator](MenuItemCreateSeparator.md). \*/   
**$URL**) /\* The URL to trigger. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Item | The reference to the menu item. Please create one with [MenuItem.CreateMenuItem](MenuItemCreateMenuItem.md) or [MenuItem.CreateSeparator](MenuItemCreateSeparator.md). | $item |
| URL | The URL to trigger. |  |

### Result

Returns OK or error.

### Description

Sets the URL to query when menuitem is used.  
$$ID$$ in the URL is replaced with menu ID.  
Queries http/ftp/sftp URLs with CURL, other URLs passed to OS to open.  
### Examples

Create menu to open email application:

 Set Variable \[$item ; Value:MBS ("[MenuItem.CreateMenuItem](MenuItemCreateMenuItem.md)"; "Send Email to Support")\]  
Set Variable \[$r ; Value:MBS ("MenuItem.SetURL"; $item ; "mailto:support@monkeybreadsoftware.test")\]  
Set Variable \[$r ; Value:MBS ("[Menu.AddItem](MenuAddItem.md)"; $menu ; $item )\]  
### See also

- [Menu.AddItem](MenuAddItem.md)
- [MenuItem.CreateMenuItem](MenuItemCreateMenuItem.md)
- [MenuItem.CreateSeparator](MenuItemCreateSeparator.md)
- [MenuItem.GetTag](MenuItemGetTag.md)
- [MenuItem.GetURL](MenuItemGetURL.md)
- [MenuItem.SetBold](MenuItemSetBold.md)
- [MenuItem.SetTag](MenuItemSetTag.md)

### Blog Entries

- [MBS FileMaker Plugin, version 6.5pr3](https://www.mbsplugins.de/archive/2016-10-18/MBS_FileMaker_Plugin_version_6/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

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

This function is free to use.

Created 11st October 2016 , last changed 15th October 2016

  
[MenuItem.SetToolTip](MenuItemSetToolTip.md) - [MenuItem.SetUnderline](MenuItemSetUnderline.md)

[HTML Version](MenuItemSetURL.shtml)