Skip to main content

What is Copy to Clipboard?

Copy to Clipboard is a deterministic extraction tool that executes Ctrl+C on the remote machine, captures the clipboard contents, and automatically saves the result as a runtime variable. It provides a fast, reliable alternative to vision-based extraction methods.
In your prompts, always refer to this tool as copy_to_clipboard (lowercase, with underscores).

Why This Tool Exists

Cyberdesk offers two primary methods for extracting data from screens: Vision-Based Extraction (focused_action, extract_prompt)
  • Uses AI to read and interpret screenshots
  • Best for: Complex layouts, tables, ambiguous text, visual verification
  • Trade-offs: Requires AI inference, slightly slower, interpretation-based
Clipboard-Based Extraction (copy_to_clipboard)
  • Deterministic copy via Ctrl+C, captures exact clipboard text
  • Best for: Selectable/copyable fields—IDs, numbers, dates, text inputs
  • Trade-offs: Only works if text is copyable, requires explicit selection
The copy_to_clipboard tool is ideal when you want fast, deterministic extraction without vision model inference—but only works when text is selectable. Use vision-based extraction when text is embedded in images, PDFs, charts, or other non-copyable formats.

How It Works

  1. Agent selects the text/data on screen (e.g., triple-click, drag selection, or keyboard shortcuts)
  2. Agent calls copy_to_clipboard with a runtime variable key name
  3. System executes Ctrl+C on the remote machine
  4. Clipboard contents are captured and returned to the agent
  5. Data is automatically saved as a runtime variable: {{key_name}}
  6. The captured value can be used in subsequent workflow steps
  7. At run completion, runtime values are included when generating final output_data JSON
The clipboard data is automatically saved as a runtime variable, making it immediately available for:
  • Use in later workflow steps via {{variable_name}} syntax
  • Automatic inclusion in the final workflow output when you have an output schema defined
This means you don’t need to manually include clipboard values in your output—they’re captured automatically alongside focused action observations when transforming to the final output JSON.

Choosing Between Vision and Clipboard Extraction

Both extraction methods are valid—choose based on your use case:

Use Copy to Clipboard When:

  • The text is selectable and copyable (works with Ctrl+C)
  • You know exactly which field to select
  • You want deterministic, byte-for-byte accuracy
  • The field has consistent location/structure
  • Speed is critical (no AI inference needed)
  • You’re extracting simple IDs, numbers, or short text

Use Vision-Based Extraction When:

  • The text cannot be copied (rendered in images, PDFs, scanned documents, charts)
  • The text is not selectable (displayed as graphics, embedded in screenshots)
  • Layout is complex or changes between runs
  • Data is in tables or complex formats
  • You need to verify visual states or conditions
  • Text location is unpredictable
  • You need decision-making alongside extraction
Pro Tip: For workflows with output schemas, copy_to_clipboard is often faster and more reliable for extracting known fields like IDs, dates, or account numbers. The captured values automatically flow into your final output data.

When to Use Copy to Clipboard

1. Extracting Non-Selectable IDs

2. Capturing Protected Text

3. Getting Values from Legacy Systems

4. Extracting Data for Later Use

5. When Vision is Required (Non-Copyable Text)

Vision-based extraction is essential when working with scanned documents, image-based UIs, charts, graphs, or any content where the text isn’t selectable. If you try copy_to_clipboard on non-copyable content, it will capture whatever was previously on the clipboard (likely empty or wrong).

How to Prompt for Copy to Clipboard

Best Practices

  1. First Select the Text: Describe how to select the data (triple-click, drag, Ctrl+A, etc.)
  2. Specify the Key Name: Choose a clear, descriptive name for the runtime variable
  3. Use the Value Later: Reference the variable as {{key_name}} in subsequent steps
  4. Be Specific: Indicate exactly what text should be selected and copied

Prompt Template

Real-World Examples

Healthcare: Extracting Patient MRN

Finance: Capturing Account Numbers

Insurance: Extracting Claim IDs

Working with Runtime Variables

Setting the Variable

Using the Variable

Multiple Clipboard Operations

Common Selection Patterns

Triple-Click Selection

Ctrl+A Selection

Drag Selection

Context Menu Copy

Integration with Other Tools

With Focused Action

With Terminal Commands

With Workflow Output Schema

Automatic Output Generation: When you define an output schema, Cyberdesk automatically transforms runtime values (from copy_to_clipboard) and focused action observations into the final structured output. You don’t need to manually construct the output JSON—just extract the values and they’ll be included automatically.

Error Prevention

Common mistakes to avoid:
  1. Calling copy_to_clipboard without first selecting the text
  2. Using the same key name multiple times (will overwrite previous values)
  3. Forgetting to select text before copying
  4. Not accounting for empty clipboard (if Ctrl+C fails)

❌ Incorrect Usage

✅ Correct Usage

Advanced Patterns

Extracting from Read-Only Fields

Copying from Non-Input Elements

Extracting Multiple Values in Sequence

Combining with Data Validation

Tips for Reliable Copying

Selection is Key: The quality of your clipboard capture depends entirely on proper text selection. Be explicit about the selection method (triple-click, Ctrl+A, drag, etc.)
Wait After Selection: If the system is slow, consider adding a brief wait between selection and copy: “wait 0.5 seconds, then use copy_to_clipboard”
Verify the Copy: For critical data, you can verify: “use copy_to_clipboard with key name ‘value’, then type {{value}} into the verification field to confirm it was captured correctly”

Clipboard vs Vision Extraction: Detailed Comparison

Real-World Scenario

Extracting an Account Number: With copy_to_clipboard (Deterministic)
Result: "1234567890" (exact text, instant) With focused_action (Vision-Based)
Result: "Account number: 1234567890" or "1234567890" (interpreted, may include extra text)
Choose clipboard for: Selectable text fields (IDs, account numbers, dates, amounts) where you want exact text without interpretation.Choose vision for: Non-copyable content (images, PDFs, scanned docs, charts), tables, or when text isn’t selectable/copyable.

Example Workflow with Output Schema

Here’s a complete workflow that demonstrates clipboard extraction with automatic output generation:

Define Output Schema

Workflow Instructions

What Happens Behind the Scenes

  1. copy_to_clipboard captures exact text from fields → saved as runtime variables
  2. focused_action extracts additional data → saved as runtime variables
  3. At run completion, Cyberdesk transforms all runtime values into structured output_data:
No manual output construction needed! Just extract the values with copy_to_clipboard and focused_action, and Cyberdesk handles the rest.

Best of Both Worlds: Hybrid Extraction

For maximum reliability and efficiency, combine both methods in a single workflow:
Hybrid Strategy: Use copy_to_clipboard for selectable text fields (faster, deterministic), and focused_action for non-copyable content (images, PDFs, charts) or complex data that requires interpretation. You get speed where possible, and vision where necessary!

Troubleshooting

Clipboard is Empty

If the clipboard returns empty after copy_to_clipboard:
  • Ensure text was properly selected before copying
  • Some applications block clipboard access - try a different selection method
  • Consider adding a small wait after selection: “wait 0.3 seconds before copying”
  • Fallback: Use focused_action to extract via vision instead

Wrong Value Captured

If the wrong text is captured:
  • Be more specific about the selection method
  • Use visual cues: “the field with the label ‘Account #’”
  • Take a screenshot before copying to verify the selection
  • Alternative: Switch to focused_action for that specific field

Application Doesn’t Support Ctrl+C

Some legacy applications may not support standard copy:
  • Try using the application’s menu: “right-click and select Copy”
  • Use keyboard alternatives: “press F2 to edit, then Ctrl+A and Ctrl+C”
  • Best solution: Use focused_action with vision-based extraction instead

Text is Not Selectable (Use Vision Instead)

Some scenarios where clipboard won’t work and you must use vision-based extraction: Text in Images
PDF Documents
Chart/Graph Data
Non-Selectable UI Labels
If text is displayed as an image, graphic, or in a non-selectable format (common in legacy systems, PDFs, or scanned documents), copy_to_clipboard will fail. Always use vision-based extraction (focused_action or extract_prompt) for non-copyable content.