Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MenuItem.SetURL

Sets the URL to query when menuitem is used.

Component Version macOS Windows Linux Server iOS SDK
Menu 6.5 ✅ Yes ✅ Yes ❌ No ❌ No ❌ No
MBS( "MenuItem.SetURL"; item; URL )   More

Parameters

Parameter Description Example
item The reference to the menu item. Please create one with MenuItem.CreateMenuItem or MenuItem.CreateSeparator. $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"; "Send Email to Support")]
Set Variable [$r; Value:MBS("MenuItem.SetURL"; $item; "mailto:support@monkeybreadsoftware.test")]
Set Variable [$r; Value:MBS("Menu.AddItem"; $menu; $item)]

See also

Blog Entries

This function is free to use.

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


MenuItem.SetToolTip - MenuItem.SetUnderline