Retrieve data from the clipboard. Recognized formats are 'TEXT', 'RTF'. Unknown data formats are assigned a type of 'UNKNOWN'.


First available in version 3.0 build 2039.

Input Parameters:

asText - [Optional] - A boolean value that allows you to override the clipboard format and retrieve the data as text. This is useful for converting RTF from the clipboard to plain text. The default value is false. Valid values include: true and false.

Output Parameters:

result - Data retrieved from the clipboard. See the 'type' to find out how to interpret the data.

type - Indicates the type of data retreieved from the clipboard.

Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.Clipboard.getData( paramsObject [, callbackParamsObject] [, errorParamsObject] );

Synchronous Mode:

When this method is called synchronously, a return object containing the output parameters is returned to the caller immediately.

var returnObject = ssCore.Clipboard.getData( paramsObject );


When using the asText option, it may not always be possible to convert what's on the clipboard to text. If the data can't be converted to text, the result will be an empty string and the type will be returned as "TEXT" instead of "UNKNOWN" as you would get without using asText.


var return_obj = ssCore.Clipboard.getData({asText:true});