Skip to main content
Skip table of contents

Get-Set Clipboard Text

This script contains a custom function that's able to retrieve and set clipboard text using P/Invoke.

GetClipboard - retrieves the current clipboard text

Example: create a new string variable containing the text output of the GetClipboard function.

CODE
var cbtext = GetClipboard();

SetClipboard - set a text/string to the clipboard

Syntax

CODE
SetClipboard(string text);

Example: set clipboard text to "test 123" or perhaps a text output from a control such as an editbox.

CODE
SetClipboard("test 123");

SetClipboard(MainWindow.FindControl(className : "Document:Edit", title : "Text Editor").GetText());

getSetClipboardText_v1.0.cs

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.