CNContactPicker.SetTrigger
--------------------------

Sets the script trigger.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Contacts](component_Contacts.md) | [10.1](newinversion101.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "CNContactPicker.SetTrigger"; FileName; ScriptName ) 

**MBS**( **"CNContactPicker.SetTrigger";** /\* Sets the script trigger. \*/  
**$FileName**; /\* The name of the FileMaker File that contains the script.e.g. "test.fmp12" \*/   
**$ScriptName**) /\* The name of the script to run.e.g. "MyScript" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| FileName | The name of the FileMaker File that contains the script. | "test.fmp12" |
| ScriptName | The name of the script to run. | "MyScript" |

### Result

Returns OK or error.

### Description

Sets the script trigger.  
This script is called when a contact is selected.  
### Examples

Setup trigger:

 # use picker sheet/popover to select contact   
Set Variable \[ $r ; Value: MBS ( "CNContactPicker.SetTrigger"; Get(FileName); "Picked") \]   
Set Variable \[ $r ; Value: MBS ( "[CNContactPicker.Show](CNContactPickerShow.md)") \]   
If \[ MBS ("IsError") \]   
 Show Custom Dialog \[ "Failed to show picker" ; $r \]   
End If  
### See also

- [CNContactPicker.SetDisplayedKeys](CNContactPickerSetDisplayedKeys.md)
- [CNContactPicker.Show](CNContactPickerShow.md)
- [IsError](IsError.md)

### Example Databases

- [Mac and iOS/Contacts/Contacts Dialogs](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/Contacts/Contacts%20Dialogs.shtml#4ScriptAnchor_)

### Blog Entries

- [New in the MBS FileMaker Plugin 10.1](https://www.mbsplugins.de/archive/2020-03-17/New_in_the_MBS_FileMaker_Plugi/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 31st January 2020 , last changed 13th January 2021

  
[CNContactPicker.SetDisplayedKeys](CNContactPickerSetDisplayedKeys.md) - [CNContactPicker.Show](CNContactPickerShow.md)

[HTML Version](CNContactPickerSetTrigger.shtml)