What is Copy to Clipboard?
Copy to Clipboard is a deterministic extraction tool that executesCtrl+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
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
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
- Agent selects the text/data on screen (e.g., triple-click, drag selection, or keyboard shortcuts)
- Agent calls
copy_to_clipboardwith a runtime variable key name - System executes
Ctrl+Con the remote machine - Clipboard contents are captured and returned to the agent
- Data is automatically saved as a runtime variable:
{{key_name}} - The captured value can be used in subsequent workflow steps
- At run completion, runtime values are included when generating final
output_dataJSON
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
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
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
- First Select the Text: Describe how to select the data (triple-click, drag, Ctrl+A, etc.)
- Specify the Key Name: Choose a clear, descriptive name for the runtime variable
- Use the Value Later: Reference the variable as
{{key_name}}in subsequent steps - 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
Legal: Copying Case References
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
❌ 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
Clipboard vs Vision Extraction: Detailed Comparison
Real-World Scenario
Extracting an Account Number: Withcopy_to_clipboard (Deterministic)
"1234567890" (exact text, instant)
With focused_action (Vision-Based)
"Account number: 1234567890" or "1234567890" (interpreted, may include extra text)
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
copy_to_clipboardcaptures exact text from fields → saved as runtime variablesfocused_actionextracts additional data → saved as runtime variables- 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:Troubleshooting
Clipboard is Empty
If the clipboard returns empty aftercopy_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_actionto 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_actionfor 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_actionwith vision-based extraction instead