ScriptWorkspace.ScriptText
--------------------------

Copies text of current script.

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

MBS( "ScriptWorkspace.ScriptText" { ; SelectedOnly; EndOfLine } ) 

**MBS**( **"ScriptWorkspace.ScriptText";** /\* Copies text of current script. \*/  
**$SelectedOnly**; /\* Optional; Return only selected text lines.  
Default is 0.e.g. 1 \*/   
**$EndOfLine**) /\* Optional; The character for end of line within script steps, e.g. multi line comments.  
If not specified or empty, defaults to Char(13). \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| SelectedOnly | Return only selected text lines.   Default is 0. | 1 | Optional      Added in version **9.5**. |
| EndOfLine | The character for end of line within script steps, e.g. multi line comments.   If not specified or empty, defaults to Char(13). |  | Optional |

### Result

Returns text or error.

### Description

Copies text of current script.  
Same as copy button in Script Workspace.  
### Examples

Query text with double &lt;CR&gt; for delimiter within comments:

 MBS ("ScriptWorkspace.ScriptText"; 0; "&lt;CR&gt;")  
### See also

- [HotKey.Register](HotKeyRegister.md)
- [HotKey.SetEvaluate](HotKeySetEvaluate.md)
- [ScriptWorkspace.CopyScriptText](ScriptWorkspaceCopyScriptText.md)
- [ScriptWorkspace.ScriptNames](ScriptWorkspaceScriptNames.md)
- [ScriptWorkspace.ScriptPaths](ScriptWorkspaceScriptPaths.md)
- [ScriptWorkspace.StyledScriptText](ScriptWorkspaceStyledScriptText.md)
- [SyntaxColoring.AddContextMenuCommand](SyntaxColoringAddContextMenuCommand.md)

### Release notes

- **Version 11.2**
    - Added EndOfLine parameter for [ScriptWorkspace.ScriptText](https://www.mbsplugins.eu/ScriptWorkspaceScriptText.shtml) function.
- **Version 10.1**
    - Fixed [ScriptWorkspace.ScriptText](https://www.mbsplugins.eu/ScriptWorkspaceScriptText.shtml) and related to copy script with tab characters included.
- **Version 9.5**
    - Added SelectedOnly parameter for [ScriptWorkspace.ScriptText](http://www.mbsplugins.eu/ScriptWorkspaceScriptText.shtml) function.
- **Version 9.0**
    - Added [ScriptWorkspace.ScriptText](http://www.mbsplugins.eu/ScriptWorkspaceScriptText.shtml) function.

### Blog Entries

- [MBS FileMaker Plugin, version 11.2pr8](https://www.mbsplugins.de/archive/2021-05-14/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.1pr5](https://www.mbsplugins.de/archive/2020-02-24/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Define hot keys for functions in the FileMaker development](https://www.mbsplugins.de/archive/2019-11-15/Define_hot_keys_for_functions_/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.5pr7](https://www.mbsplugins.de/archive/2019-11-07/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.6pr5](https://www.mbsplugins.de/archive/2018-12-23/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 20th December 2018 , last changed 16th November 2023

  
[ScriptWorkspace.ScriptPaths](ScriptWorkspaceScriptPaths.md) - [ScriptWorkspace.ScriptsVisible](ScriptWorkspaceScriptsVisible.md)

[HTML Version](ScriptWorkspaceScriptText.shtml)