Clipboard.GetText
-----------------

Queries clipboard content as text.

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

MBS( "Clipboard.GetText" { ; Type } ) 

**MBS**( **"Clipboard.GetText";** /\* Queries clipboard content as text. \*/  
**$Type**) /\* Optional; The data type.   
By default NSStringPboardType, but can be other Mac types.  
Mac only.e.g. "" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Type | The data type.    By default NSStringPboardType, but can be other Mac types.   Mac only. | "" | Optional |

### Result

The text from the clipboard. Empty if no text is there.

### Description

Queries clipboard content as text.  
Examples for type parameter: public.utf8-plain-text, CorePasteboardFlavorType 0x54455854, public.rtf,CorePasteboardFlavorType 0x75747874.  
  
For server this will query the clipboard of the user account running the server app on the server computer and not the clipboard of any client.  
  
You may want to use [Text.ReplaceNewLine](TextReplaceNewLine.md) function with mode = 1 on the text to normalize line endings to what FileMaker expects.  
  
To query FileMaker’s XML for ValueList, Script, ScriptStep, Layout, CustomFunction, Table or Field, please check [Clipboard.GetFileMakerData](ClipboardGetFileMakerData.md) function.  
### Examples

Get text from clipboard:

 MBS ("Clipboard.GetText")  
Query addressbook data from Contacts app:

 MBS ("Clipboard.GetText"; "ABPeopleDictPboardType")  
Get design from clipboard after copying it in FileMaker:

 MBS ("Clipboard.GetText"; "dyn.agk8u")  
### See also

- [Clipboard.AddText](ClipboardAddText.md)
- [Clipboard.GetData](ClipboardGetData.md)
- [Clipboard.GetFiles](ClipboardGetFiles.md)
- [Clipboard.GetHTMLText](ClipboardGetHTMLText.md)
- [Clipboard.GetPDF](ClipboardGetPDF.md)
- [Clipboard.GetStyledText](ClipboardGetStyledText.md)
- [Clipboard.GetTypes](ClipboardGetTypes.md)
- [Clipboard.SetHTMLText](ClipboardSetHTMLText.md)
- [Clipboard.SetRTFText](ClipboardSetRTFText.md)
- [Clipboard.SetText](ClipboardSetText.md)

### Release notes

- **Version 14.1**
    - Added fallback to [Clipboard.GetText](https://www.mbsplugins.eu/ClipboardGetText.shtml) for Windows to read ANSI text if unicode text is not available.
- **Version 8.5**
    - Fixed issue with [Clipboard.GetText](http://www.mbsplugins.eu/ClipboardGetText.shtml) not returning last byte for text.
- **Version 8.2**
    - Changed [Clipboard.GetText](http://www.mbsplugins.eu/ClipboardGetText.shtml) and [Clipboard.SetText](http://www.mbsplugins.eu/ClipboardSetText.shtml) to work better with UTF16 on MacOS.

### Example Databases

- [Clipboard](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Clipboard.shtml#1Button71.0000000422.000000096.0000000535.0000000LayoutObjectAnchor_)
- [WebViewer/WebView Copy and Paste](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/WebView%20Copy%20and%20Paste.shtml#1Button11.0000000687.000000045.0000000793.0000000LayoutObjectAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 14.1pr4](https://www.mbsplugins.de/archive/2024-02-26/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.5pr3](https://www.mbsplugins.de/archive/2018-10-24/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.2pr6](https://www.mbsplugins.de/archive/2018-05-07/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [Comparing Base Elements Plugin to MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2017-10-24/Comparing_Base_Elements_Plugin/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 2.6pr7](https://www.mbsplugins.de/archive/2012-03-16/MBS_Filemaker_Plugin_version_2/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 1/2026, Seite 10](https://filemaker-magazin.de/neuigkeit/4312-Die-neue-Ausgabe-FMM_202601-steht-online)
- [Ausgabe 3/2021, Seite 28](https://filemaker-magazin.de/neuigkeit/4145-Appetithappen-FMM_202103)

This function checks for a license.

Created 18th August 2014 , last changed 2nd June 2025

  
[Clipboard.GetStyledText](ClipboardGetStyledText.md) - [Clipboard.GetTypes](ClipboardGetTypes.md)

[HTML Version](ClipboardGetText.shtml)