ScriptWorkspace.OpenScript
--------------------------

Opens a script by name.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [ScriptWorkspace](component_ScriptWorkspace.md) | [7.4](newinversion74.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |

MBS( "ScriptWorkspace.OpenScript"; ScriptName { ; Group } ) 

**MBS**( **"ScriptWorkspace.OpenScript";** /\* Opens a script by name. \*/  
**$ScriptName**; /\* The name of the script to select.  
Must be visible in the left list of scripts in Script Workspace.e.g. "Test" \*/   
**$Group**) /\* Optional; The group the script is inside.  
If the script is not found directly, we look for the group to open it, then search again. \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| ScriptName | The name of the script to select.   Must be visible in the left list of scripts in Script Workspace. | "Test" |  |
| Group | The group the script is inside.   If the script is not found directly, we look for the group to open it, then search again. |  | Optional      Added in version **16.1**. |

### Result

Returns OK or error.

### Description

Opens a script by name.  
The script list does not need to be visible.  
### Examples

Open a script in a second:

 Set Variable \[ $r ; Value: MBS ( "[Schedule.EvaluateAfterDelay](ScheduleEvaluateAfterDelay.md)"; 1; "MBS ( \\"ScriptWorkspace.OpenScript\\"; \\"Test Script\\" )" ) \]  
### See also

- [Schedule.EvaluateAfterDelay](ScheduleEvaluateAfterDelay.md)
- [ScriptWorkspace.TriggerScripts](ScriptWorkspaceTriggerScripts.md)

### Release notes

- **Version 16.1**
    - Added group parameter to [ScriptWorkspace.OpenScript](https://www.mbsplugins.eu/ScriptWorkspaceOpenScript.shtml) function.
- **Version 11.1**
    - Changed [ScriptWorkspace.OpenScript](https://www.mbsplugins.eu/ScriptWorkspaceOpenScript.shtml) to remove search string for script search if script is not found.

### Blog Entries

- [MBS FileMaker Plugin, version 16.1pr1](https://www.mbsplugins.de/archive/2026-02-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.1pr8](https://www.mbsplugins.de/archive/2021-03-04/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 13th August 2017 , last changed 16th January 2026

  
[ScriptWorkspace.LineCount](ScriptWorkspaceLineCount.md) - [ScriptWorkspace.ScriptNames](ScriptWorkspaceScriptNames.md)

[HTML Version](ScriptWorkspaceOpenScript.shtml)