HotKey.SetLocal
---------------

Sets the local flag.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [HotKey](component_HotKey.md) | [5.4](newinversion54.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "HotKey.SetLocal"; HotKeyRef; Local ) 

**MBS**( **"HotKey.SetLocal";** /\* Sets the local flag. \*/  
**$HotKeyRef**; /\* The reference value for the hotkey as returned by [HotKey.Register](HotKeyRegister.md) function.e.g. $hotkey \*/   
**$Local**) /\* Set to 1 to only run hotkey if FileMaker is frontmost application.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| HotKeyRef | The reference value for the hotkey as returned by [HotKey.Register](HotKeyRegister.md) function. | $hotkey |
| Local | Set to 1 to only run hotkey if FileMaker is frontmost application. | 0 |

### Result

Returns OK or error.

### Description

Sets the local flag.  
### Examples

Create hotkey and set local only:

 Set Variable \[$HotKeyID ; Value:MBS ("[HotKey.Register](HotKeyRegister.md)"; "F5"; "shift control")\]  
Set Variable \[$r ; Value:MBS ("[HotKey.SetScript](HotKeySetScript.md)"; $HotKeyID ; Get(FileName); "HotkeyAction")\]  
Set Variable \[$r ; Value:MBS ("HotKey.SetLocal"; $HotKeyID ; 1)\]  
### See also

- [HotKey.GetLocal](HotKeyGetLocal.md)
- [HotKey.Register](HotKeyRegister.md)
- [HotKey.SetScript](HotKeySetScript.md)

### Release notes

- **Version 11.5**
    - Changed implementation for [HotKey](https://www.mbsplugins.eu/component_HotKey.shtml) functions for local hotkeys on macOS. Now hotkey set with [HotKey.SetLocal](https://www.mbsplugins.eu/HotKeySetLocal.shtml) to 1 will now process only within FileMaker and no longer block shortcuts in other applications.

### Blog Entries

- [MBS FileMaker Plugin, version 11.5pr3](https://www.mbsplugins.de/archive/2021-10-25/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.4pr4](https://www.mbsplugins.de/archive/2015-10-29/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 21st October 2015 , last changed 21st October 2015

  
[HotKey.SetKeyUp](HotKeySetKeyUp.md) - [HotKey.SetName](HotKeySetName.md)

[HTML Version](HotKeySetLocal.shtml)