Device.getClipboardString()

Overview

Retrieves the string contents of the device's clipboard.

Added in version 2.1.1

Format

var clipboardContents= Device.getClipboardString();

Parameter Description Type Required Notes
clipboardContents The contents of the clipboard as a string. String Return value If the clipboard is empty or cannot be converted to a string, the function may return undefined or an empty string.

Example

Copy
/* Send the clipboard contents as if it were scan data.
*/
var clipboardContents = Device.getClipboardString();
if(clipboardContents) {
    Device.fakeScan('clipboard', clipboardContents);
}