Skip to main content

Get From Clipboard

Retrieves the contents of the clipboard

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Output

  • Clipboard Data - The text data retrieved from the clipboard.

The node retrieves the string data stored on the clipboard, and outputs it through the Clipboard Data property.

Note: The clipboard is a shared resource and can be accessed concurrently by multiple applications. Hence the data on the clipboard may change before it is retrieved by the node.

How It Works

The Get From Clipboard node performs the following steps:

  1. Accesses System Clipboard - Connects to the operating system's clipboard service
  2. Reads Clipboard Content - Retrieves the current text content stored in the clipboard
  3. Converts to String - Ensures the clipboard data is in string format
  4. Outputs Data - Returns the clipboard content through the Clipboard Data output property
  5. Handles Empty Clipboard - If clipboard is empty, returns an empty string

Requirements

  • Clipboard Access - The automation must have permission to access the system clipboard
  • Desktop Environment - Must run in an environment with clipboard support (desktop automation, not server-only)
  • Text Format - The clipboard must contain text data (images and files are not supported)
  • Operating System Support - Compatible with Windows, macOS, and Linux desktop environments

Error Handling

Error CodeDescriptionSolution
CLIPBOARD_ACCESS_DENIEDUnable to access the system clipboardEnsure the automation has proper system permissions
NO_TEXT_DATAClipboard contains non-text data (image, file, etc.)Verify that text data is copied to clipboard before retrieval
CLIPBOARD_LOCKEDClipboard is locked by another processWait briefly and retry, or check for conflicting applications
CLIPBOARD_EMPTYNo data available on the clipboardEnsure something is copied before attempting to retrieve
UNSUPPORTED_ENVIRONMENTRunning in an environment without clipboard supportUse a desktop environment or virtual desktop for automation

Usage Examples

Example 1: Retrieve Copied Data

Capture data that a user has copied manually:

Scenario: User copies customer ID from a website
1. User manually copies: "CUST-12345"
2. Get From Clipboard executes
3. Clipboard Data output: "CUST-12345"
4. Use this ID for further processing

Example 2: Extract Data from Legacy Application

Get data from applications that don't support automation APIs:

Workflow:
1. Use keyboard shortcut to select all text (Ctrl+A)
2. Copy text to clipboard (Ctrl+C)
3. Get From Clipboard
4. Clipboard Data contains the extracted text
5. Parse and process the extracted data

Example 3: Verify Copy Operation

Confirm that a copy operation was successful:

Workflow:
1. Click element in web page
2. Send keyboard shortcut: Ctrl+C
3. Add small delay (100ms)
4. Get From Clipboard
5. Verify Clipboard Data contains expected content

Usage Notes

  • Timing Considerations - Add a small delay after copy operations before reading clipboard to ensure data is available.
  • Clipboard State - The clipboard retains its content until overwritten, so data may be from a previous operation.
  • Concurrent Access - Other applications or users can modify clipboard content between operations.
  • Text Only - This node only retrieves text. Images, files, and formatted content are not supported.
  • Empty Results - An empty string output may indicate either an empty clipboard or non-text content.
  • Cross-Platform Differences - Clipboard behavior may vary slightly between Windows, macOS, and Linux.
  • Security - Be aware that clipboard content may contain sensitive data copied by users.

Tips

  • Add Delays - Always add a small delay (100-200ms) after programmatic copy operations before reading clipboard.
  • Validate Content - Check that retrieved data matches expected format before processing.
  • Clear Clipboard - Consider clearing clipboard with Set To Clipboard after retrieving sensitive data.
  • Error Handling - Use Try-Catch to handle cases where clipboard is empty or contains non-text data.
  • Avoid Race Conditions - In multi-threaded environments, synchronize clipboard access to prevent conflicts.
  • Log for Debugging - Log clipboard content during development to verify data flow.
  • User Interaction - In attended automation, inform users when clipboard will be used to avoid conflicts.
  • Temporary Storage - Store clipboard data in a variable immediately to prevent loss if clipboard changes.
  • Set To Clipboard - Write text data to the clipboard
  • Send Keys - Send keyboard shortcuts like Ctrl+C to copy data
    • Alternative method to extract text from web elements
    • Click elements before copying their content