Send to Clipboard
Verb: setClipboard
Sends content to the operating system's clipboard.
Syntax
setClipboard --file(String) --image(String) --text(String) --mode(ClipboardMode) [--timeout(TimeSpan)] (Boolean)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--file | File | Only whenMode is File | Text | Path of the file to be sent to the clipboard. |
--image | Image | Only whenMode is Image | Text | Path of the image to be sent to the clipboard. |
--text | Text | Only whenMode is Text | Text | Text that should be sent to the clipboard. |
--mode | Mode | Required | ClipboardMode | Options of the type of file to send to the clipboard.
|
--timeout | Timeout | Optional | Time Span, Number, Text | Maximum wait time to send the desired content to clipboard.
In case no value is defined for the timeout parameter, the execution uses the context timeout defined by the Set Timeout command. If that command is not used on the script, the default timeout is 5 seconds. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
value | Success | Boolean | Returns "True" if the content was successfully sent to the clipboard within the set time, or "False" if the content was not sent. |
Example
The Send to Clipboard command sends the text "clipboard example" to the clipboard, while the Get Clipboard Content command gets this content sent and Log Message displays it.
defVar --name success --type Boolean
defVar --name text --type String --value "clipboard example\r\n"
setClipboard --text "${text}" --mode "Text" success=value
getClipboardContent text=textcontent
logMessage --message "${text}" --type "Info"
//Result: clipboard example
Remarks
Only one type of content is allowed at a time.