Plugin.RegisterScriptStep
-------------------------

Registers a script step dynamically.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Plugin](component_Plugin.md) | [15.3](newinversion153.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Plugin.RegisterScriptStep"; Script Step ID; Name; Definition; Expression; Description { ; Flags } ) 

**MBS**( **"Plugin.RegisterScriptStep";** /\* Registers a script step dynamically. \*/  
**$Script Step ID**; /\* The script step ID.  
Must be unique and 3 or higher.  
  
MBS function is ID 1 and MBS script step is ID 2.e.g. 3 \*/   
**$Name**; /\* The name of the custom function.e.g. "Concat" \*/   
**$Definition**; /\* An XML to define the script step. \*/   
**$Expression**; /\* The expression to run.e.g. "1+2" \*/   
**$Description**; /\* The description to show in the user interface. \*/   
**$Flags**) /\* Optional; The flags for the function.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Script Step ID | The script step ID.   Must be unique and 3 or higher.      MBS function is ID 1 and MBS script step is ID 2. | 3 |  |
| Name | The name of the custom function. | "Concat" |  |
| Definition | An XML to define the script step. |  |  |
| Expression | The expression to run. | "1+2" |  |
| Description | The description to show in the user interface. |  |  |
| Flags | The flags for the function. | 0 | Optional      Added in version **15.4**. |

### Result

Returns OK or error.

### Description

Registers a script step dynamically.  
Allows you to define custom script steps for your solution.  
Please register the same script step each time your solution opens with the same IDs. FileMaker usually finds script steps by ID.  
  
See also [Plugin.RegisterFunction](PluginRegisterFunction.md) for registering a function.  
  
| Flag | Description |
|---|---|
| 0 | Evaluate with FileMaker |
| 1 | Use Duktape JavaScript engine |
| 2 | Use WebKit JavaScript engine if available (see [JavaScript.Available](JavaScriptAvailable.md)) or fall back to Duktape. |
| 4 | Add 4 to use a per thread JavaScript context, so globals are shared within the scripts running on tha thread. in FileMaker Pro you only have one thread, but on server, you may have multiple threads. |
| 8 | Add 8 to secure the script step and prevent it from being unregistered or replaced. |

  
If you use JavaScript, you should declare a function in JavaScript to take the right number of parameters. Your function should return a result as text, boolean or number. If you have objects or arrays, please use JSON.stringify function to serialize them to text. Your JavaScript can define additional things you use in your function.   
### Examples

Register a script step:

 MBS ( "Plugin.RegisterScriptStep";   
// internal ID. Must be unique   
123;   
// name of script step  
"Concat";   
// XML definition of parameters  
"&lt;PluginStep&gt;  
 &lt;Parameter Type=\\"target\\" Label=\\"Destination\\" ShowInLine=\\"true\\"/&gt;  
 &lt;Parameter Type=\\"calc\\" DataType=\\"text\\" ShowInline=\\"true\\" Label=\\"FirstName\\" ID=\\"0\\"/&gt;  
 &lt;Parameter Type=\\"calc\\" DataType=\\"text\\" ShowInline=\\"true\\" Label=\\"SecondName\\" ID=\\"1\\"/&gt;  
&lt;/PluginStep&gt;";  
// calculation   
"MBS (\\"[Plugin.ScriptStepParameter](PluginScriptStepParameter.md)\\"; 0) &amp; MBS (\\"[Plugin.ScriptStepParameter](PluginScriptStepParameter.md)\\"; 1)";   
// description  
"Concat two texts" )  
### See also

- [JavaScript.Available](JavaScriptAvailable.md)
- [Plugin.RegisterFunction](PluginRegisterFunction.md)
- [Plugin.ScriptStepParameter](PluginScriptStepParameter.md)
- [Plugin.UnregisterScriptStep](PluginUnregisterScriptStep.md)

### Release notes

- **Version 15.4**
    - Added flags for [Plugin.RegisterFunction](https://www.mbsplugins.eu/PluginRegisterFunction.shtml)and [Plugin.RegisterScriptStep](https://www.mbsplugins.eu/PluginRegisterScriptStep.shtml) functions, so you can turn on JavaScript.
- **Version 15.3**
    - Added [Plugin.RegisterScriptStep](https://www.mbsplugins.eu/PluginRegisterScriptStep.shtml) function.

### Blog Entries

- [MBS FileMaker Plugin, version 15.4pr4](https://www.mbsplugins.de/archive/2025-08-25/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 15.3 News](https://www.mbsplugins.de/archive/2025-07-29/MBS_FileMaker_Plugin_153_News/monkeybreadsoftware_blog_filemaker)
- [Neues MBS Plugin 15.3 für Claris FileMaker](https://www.mbsplugins.de/archive/2025-07-15/Neues_MBS_Plugin_153_für_Clar/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 15.3 for Claris FileMaker](https://www.mbsplugins.de/archive/2025-07-15/MBS_Plugin_153_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 15.3pr5](https://www.mbsplugins.de/archive/2025-07-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 27th June 2025 , last changed 2nd October 2025

  
[Plugin.RegisterFunction](PluginRegisterFunction.md) - [Plugin.ScriptStepParameter](PluginScriptStepParameter.md)

[HTML Version](PluginRegisterScriptStep.shtml)