Clipboard.SetStyledText
-----------------------

Put styled text on the clipboard.

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

MBS( "Clipboard.SetStyledText"; Text ) 

**MBS**( **"Clipboard.SetStyledText";** /\* Put styled text on the clipboard. \*/  
**$Text**) /\* The styled text to put in clipboard.e.g. "Hello World" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Text | The styled text to put in clipboard. | "Hello World" |

### Result

Returns OK or error.

### Description

Put styled text on the clipboard.  
  
This is direct way for styled text without converting in-between to RTF.  
For Windows or cross platform solutions you can combine [Text.TextToRTF](TextTextToRTF.md) and [Clipboard.SetRTFText](ClipboardSetRTFText.md).   
  
For server this will modify the clipboard of the user account running the server app on the server computer and not the clipboard of any client.  
  
Implemented for Windows with version 11.3 of MBS Plugin.  
### Examples

Put red text on the clipboard:

 MBS ( "Clipboard.SetStyledText"; TextColor ( "Hello World" ; RGB ( 65535 ; 0 ; 0 ) ) )  
Put formatted and colorized JSON on the clipboard:

 Let ( \[  
 json = MBS ("[JSON.Format](JSONFormat.md)"; "{\\"test\\":1}");  
 coloredJSON = MBS ("[JSON.Colorize](JSONColorize.md)"; json);  
 r = MBS ( "Clipboard.SetStyledText"; coloredJSON )  
\]; r )  
### See also

- [Clipboard.GetStyledText](ClipboardGetStyledText.md)
- [Clipboard.SetHTMLText](ClipboardSetHTMLText.md)
- [Clipboard.SetRTFText](ClipboardSetRTFText.md)
- [JSON.Colorize](JSONColorize.md)
- [JSON.Format](JSONFormat.md)
- [Text.TextToRTF](TextTextToRTF.md)

### Release notes

- **Version 15.2**
    - Upgraded NSAttributedString handling to better work with postscript font names. This affects [Clipboard.SetStyledText](https://www.mbsplugins.eu/ClipboardSetStyledText.shtml), [Clipboard.GetStyledText](https://www.mbsplugins.eu/ClipboardGetStyledText.shtml) and other functions on macOS using styled text.
- **Version 14.5**
    - Improved styled text conversion on macOS to include better support for highlight, underline and strikethrough, e.g. for [RichText.SetFormattedText](https://www.mbsplugins.eu/RichTextSetFormattedText.shtml) and [Clipboard.SetStyledText](https://www.mbsplugins.eu/ClipboardSetStyledText.shtml) functions.
- **Version 11.3**
    - Implemented [Clipboard.GetStyledText](https://www.mbsplugins.eu/ClipboardGetStyledText.shtml) and [Clipboard.SetStyledText](https://www.mbsplugins.eu/ClipboardSetStyledText.shtml) for Windows.

### Example Databases

- [Clipboard](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Clipboard.shtml#1Button25.0000000556.000000050.0000000669.0000000LayoutObjectAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 15.2pr3](https://www.mbsplugins.de/archive/2025-04-10/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 14.5pr4](https://www.mbsplugins.de/archive/2024-10-25/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Neues MBS FileMaker Plugin 11.3](https://www.mbsplugins.de/archive/2021-07-12/Neues_MBS_FileMaker_Plugin_113/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 11.3 - More than 6500 Functions In One Plugin](https://www.mbsplugins.de/archive/2021-07-12/MBS_FileMaker_Plugin_113_-_Mor/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.3pr1](https://www.mbsplugins.de/archive/2021-06-03/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 17th November 2014 , last changed 27th February 2026

  
[Clipboard.SetRTFText](ClipboardSetRTFText.md) - [Clipboard.SetText](ClipboardSetText.md)

[HTML Version](ClipboardSetStyledText.shtml)