FM.ScriptIDForScriptName
------------------------

Queries the ID for script with given name.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [FM](component_FM.md) | [5.1](newinversion51.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "FM.ScriptIDForScriptName"; ScriptName { ; FileName } ) 

**MBS**( **"FM.ScriptIDForScriptName";** /\* Queries the ID for script with given name. \*/  
**$ScriptName**; /\* The name of the script.e.g. "Test" \*/   
**$FileName**) /\* Optional; The name of the file to look inside.  
If empty, we default to current file.  
  
Using a table in another database file may require you adding the other file as an external data source and adding the external table to your relationship graph to grant access. \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| ScriptName | The name of the script. | "Test" |  |
| FileName | The name of the file to look inside.   If empty, we default to current file.      Using a table in another database file may require you adding the other file as an external data source and adding the external table to your relationship graph to grant access. |  | Optional      Added in version **7.5**. |

### Result

Returns number or error.

### Description

Queries the ID for script with given name.  
### Examples

Query script ID:

 MBS ("FM.ScriptIDForScriptName"; "Send Campaign")  
### Release notes

- **Version 7.5**
    - Added FileName parameter to [FM.ScriptNameForScriptID](http://www.mbsplugins.eu/FMScriptNameForScriptID.shtml), [FM.ScriptIDForScriptName](http://www.mbsplugins.eu/FMScriptIDForScriptName.shtml) and [FM.ScriptNames](http://www.mbsplugins.eu/FMScriptNames.shtml).

### Blog Entries

- [News about the MBS FileMaker Plugin 10.2](https://www.mbsplugins.de/archive/2020-05-19/News_about_the_MBS_FileMaker_P/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 7.5pr2](https://www.mbsplugins.de/archive/2017-10-16/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.1pr2](https://www.mbsplugins.de/archive/2015-03-23/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 23th March 2015 , last changed 20th March 2023

  
[FM.SQL.XMLRecords](FMSQLXMLRecords.md) - [FM.ScriptNameForScriptID](FMScriptNameForScriptID.md)

[HTML Version](FMScriptIDForScriptName.shtml)