Copy to Clipboard

Verb: copyToClipboard

Copies the selected content in the active window to the operating system clipboard.

Syntax

copyToClipboard

Example

The Launch and Attach Window command launches a Notepad window and Focus Window focuses on the same window. Then the Type Text command types the text "IBM Robotic Process Automation" into Notepad and Press or Release Key selects the text with the Ctrl and A keys. Lastly, the Copy to Clipboard command copies the selected content, with another Notepad window being opened and focused, and the Paste from Clipboard command pastes the contents into the new window.

defVar --name notepad01 --type Window
defVar --name notepad02 --type Window
launchWindow --executablepath "notepad.exe" notepad01=value
focusWindow --window ${notepad01}
typeText --text "IBM"
keyboard --type "KeyPress" --key "ControlKey"
keyboard --type "KeyDown" --key "A"
copyToClipboard
launchWindow --executablepath "notepad.exe" notepad02=value
focusWindow --window ${notepad02}
paste

See Also

  • Clear Clipboard
  • Get Clipboard Content
  • Increment Clipboard Value
  • Paste from Clipboard
  • Send to Clipboard