Clipboard.AddText
-----------------

Adds text to the clipboard.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Clipboard](component_Clipboard.md) | [13.2](newinversion132.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |

MBS( "Clipboard.AddText"; Text; Type ) 

**MBS**( **"Clipboard.AddText";** /\* Adds text to the clipboard. \*/  
**$Text**; /\* The new txt for the clipboard.e.g. "Hello World" \*/   
**$Type**) /\* The data type.   
By default NSStringPboardType, but can be other Mac types.e.g. "" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Text | The new txt for the clipboard. | "Hello World" |
| Type | The data type.    By default NSStringPboardType, but can be other Mac types. | "" |

### Result

Returns OK or error.

### Description

Adds text to the clipboard.  
This function allows on macOS to put multiple things on the clipboard, like both a text representation and a xml one.  
So if user pastes to a text editor, they get the text editor, but if they paste into your app, you can get back the xml.  
### Examples

Add two text things and query back:

 # set   
Set Variable \[ $r ; Value: MBS ( "[Clipboard.SetText](ClipboardSetText.md)"; "Hello World" ) \]   
Set Variable \[ $r ; Value: MBS ( "Clipboard.AddText"; "{\\"text\\": \\"Hello World\\", \\"RowID\\": 123 }"; "JSON" ) \]   
\# query   
Set Variable \[ $$json ; Value: MBS ( "[Clipboard.GetText](ClipboardGetText.md)"; "JSON") \]   
Set Variable \[ $$text ; Value: MBS ( "[Clipboard.GetText](ClipboardGetText.md)"; "") \]  
Add both xml and text to clipbord:

 # put script step on clipboard   
Set Variable \[ $r ; Value: MBS ( "[Clipboard.SetFileMakerData](ClipboardSetFileMakerData.md)"; "auto"; "&lt;fmxmlsnippet type=\\"FMObjectList\\"&gt;&lt;Step enable=\\"True\\" id=\\"62\\" name=\\"Pause/Resume Script\\"&gt;&lt;PauseTime value=\\"ForDuration\\"&gt;&lt;/PauseTime&gt;&lt;Calculation&gt;&lt;!\[CDATA\[1\]"&amp;"\]&gt;&lt;/Calculation&gt;&lt;/Step&gt;&lt;/fmxmlsnippet&gt;" ) \]   
\# and a text for Text editors   
Set Variable \[ $r ; Value: MBS ( "Clipboard.AddText"; "Pause/Resume Script \[ Duration (seconds): 1 \]"; "" ) \]   
\# now you can paste in code editor   
### See also

- [Clipboard.GetText](ClipboardGetText.md)
- [Clipboard.SetFileMakerData](ClipboardSetFileMakerData.md)
- [Clipboard.SetText](ClipboardSetText.md)

### Release notes

- **Version 13.2**
    - Added [Clipboard.AddText](https://www.mbsplugins.eu/ClipboardAddText.shtml) function.

### Blog Entries

- [New in MBS FileMaker Plugin 13.2](https://www.mbsplugins.de/archive/2023-05-17/New_in_MBS_FileMaker_Plugin_13/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.2pr3](https://www.mbsplugins.de/archive/2023-04-20/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 15th April 2023 , last changed 25th February 2026

  
[ClearRegistration](ClearRegistration.md) - [Clipboard.Clear](ClipboardClear.md)

[HTML Version](ClipboardAddText.shtml)