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
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
- 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
Common mistakes to avoid:
- Calling
copy_to_clipboardwithout first selecting the text - Using the same key name multiple times (will overwrite previous values)
- Forgetting to select text before copying
- 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 into the verification field to confirm it was captured correctly”
Clipboard vs Vision Extraction: Detailed Comparison
| Aspect | Copy to Clipboard | Vision-Based (focused_action / extract_prompt) |
|---|---|---|
| Text Requirement | ✅ Text must be selectable & copyable | ✅ Works with ANY visible text (even non-copyable) |
| Speed | ⚡ Instant (no AI inference) | 🐌 2-5 seconds per extraction |
| Accuracy | 📍 Deterministic, byte-exact | 🎯 Interpretation-based, may vary |
| Selection | ✋ Requires explicit text selection | 👁️ Reads from screenshot automatically |
| Use Case | Copyable fields, IDs, numbers, dates | Non-copyable text, images, charts, PDFs |
| Cost | 💰 No AI tokens | 💳 Uses vision model tokens |
| Reliability | ✅ If copy works, always succeeds | ⚠️ Depends on OCR/vision quality |
| Format | 📝 Literal clipboard text | 🧠 AI interprets and formats |
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)
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
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: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 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
Text is Not Selectable (Use Vision Instead)
Some scenarios where clipboard won’t work and you must use vision-based extraction: Text in ImagesIf 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.