Clipboard.GetData
-----------------

Queries data from clipboard item.

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

MBS( "Clipboard.GetData"; ClipboardType; ResultType { ; Param1; Param2 } ) 

**MBS**( **"Clipboard.GetData";** /\* Queries data from clipboard item. \*/  
**$ClipboardType**; /\* The clipboard type to query. On Windows can also be a number.e.g. "com.apple.icns" \*/   
**$ResultType**; /\* How to return the data. Can be "hex" for hex encoded, "base64" for base 64 encoded, "text" for trying to read data as text, "file" for a container value containing a file or "image" for reading data as image.e.g. "image" \*/   
**$Param1**; /\* Optional; For ResultType "file" the filename of the container value. For ResultType "image" the image type. Can be PNG, JPEG, GIF or BMP.e.g. "JPEG" \*/   
**$Param2**) /\* Optional; For ResultType "image", the file name of the image in the container value.e.g. "image.jpg" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| ClipboardType | The clipboard type to query. On Windows can also be a number. | "com.apple.icns" |  |
| ResultType | How to return the data. Can be "hex" for hex encoded, "base64" for base 64 encoded, "text" for trying to read data as text, "file" for a container value containing a file or "image" for reading data as image. | "image" |  |
| Param1 | For ResultType "file" the filename of the container value. For ResultType "image" the image type. Can be PNG, JPEG, GIF or BMP. | "JPEG" | Optional |
| Param2 | For ResultType "image", the file name of the image in the container value. | "image.jpg" | Optional |

### Result

Returns text or error.

### Description

Queries data from clipboard item.  
We look at the clipboard for a matching item with given type and return it in the format type you request.  
  
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.  
### Examples

Queries icon from clipboard:

 MBS ("Clipboard.GetData"; "com.apple.icns"; "image")  
### See also

- [Clipboard.GetFiles](ClipboardGetFiles.md)
- [Clipboard.GetPDF](ClipboardGetPDF.md)
- [Clipboard.GetText](ClipboardGetText.md)
- [Clipboard.GetTypes](ClipboardGetTypes.md)
- [Clipboard.SetText](ClipboardSetText.md)

### Blog Entries

- [MBS Filemaker Plugin, version 4.4pr1](https://www.mbsplugins.de/archive/2014-09-21/MBS_Filemaker_Plugin_version_4/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 20th September 2014 , last changed 9th November 2021

  
[Clipboard.DetectFileMakerDataType](ClipboardDetectFileMakerDataType.md) - [Clipboard.GetFileMakerData](ClipboardGetFileMakerData.md)

[HTML Version](ClipboardGetData.shtml)