Menubar.SetMenuCommandShortcut
------------------------------

Sets the menu item shortcut.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Menubar](component_Menubar.md) | [5.0](newinversion50.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |

MBS( "Menubar.SetMenuCommandShortcut"; Path { ; Key; Modifiers } ) 

**MBS**( **"Menubar.SetMenuCommandShortcut";** /\* Sets the menu item shortcut. \*/  
**$Path**; /\* The ID or path to the menu entry.  
Use [Menubar.ListMenuCommands](MenubarListMenuCommands.md) to find out the IDs and names.e.g. 49297 \*/   
**$Key**; /\* Optional; Which key to use.e.g. "D" \*/   
**$Modifiers**) /\* Optional; Which modifiers to use. can include command, option, shift or control.e.g. "command shift" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Path | The ID or path to the menu entry.   Use [Menubar.ListMenuCommands](MenubarListMenuCommands.md) to find out the IDs and names. | 49297 |  |
| Key | Which key to use. | "D" | Optional |
| Modifiers | Which modifiers to use. can include command, option, shift or control. | "command shift" | Optional |

### Result

Returns OK or error.

### Description

Sets the menu item shortcut.  
### Examples

Set Shortcut to "⌘⇧D" for the Data Viewer by ID:

 MBS ("Menubar.SetMenuCommandShortcut"; 49297; "D"; "shift command")  
Set Shortcut to "⌘⇧D" for the Data Viewer by name in German:

 MBS ("FM.SetMenuCommandShortcut"; "Werkzeuge¶Datenanzeige"; "D"; "command shift")  
### See also

- [Menubar.ListMenuCommands](MenubarListMenuCommands.md)
- [Menubar.SetMenuCommandTitle](MenubarSetMenuCommandTitle.md)
- [Menubar.SetMenuCommandVisible](MenubarSetMenuCommandVisible.md)

### Blog Entries

- [MBS FileMaker Plugin 5.0 for OS X/Windows - More than 3000 Functions In One Plugin](https://www.mbsplugins.de/archive/2015-02-24/MBS_FileMaker_Plugin_50_for_OS/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 15th November 2014 , last changed 14th July 2022

  
[Menubar.RunMenuCommand](MenubarRunMenuCommand.md) - [Menubar.SetMenuCommandTitle](MenubarSetMenuCommandTitle.md)

[HTML Version](MenubarSetMenuCommandShortcut.shtml)