Skip to main content

Overview

Performs a triple-click action on an element. Primarily used to select entire lines or paragraphs in text editors and fields.

Syntax

agent-desktop triple-click <ref>

Parameters

ref
string
required
Element reference from snapshot (@e1, @e2, etc.)

Response

{
  "version": "1.0",
  "ok": true,
  "command": "triple-click",
  "data": {
    "action": "triple_click",
    "ref_id": "@e6"
  }
}

Response Fields

action
string
The action performed (triple_click)
ref_id
string
The element reference that was triple-clicked
post_state
object
Element state after the action

AX-First Strategy

The triple-click command follows this hierarchy:
  1. Try native triple-click action via AX
  2. Three rapid kAXPressAction calls
  3. Mouse triple-click at element center

Usage Examples

Select a Line in Text Editor

agent-desktop snapshot --app TextEdit -i
agent-desktop triple-click @e4  # Select entire line
agent-desktop press cmd+c        # Copy line

Select Paragraph

agent-desktop snapshot --app Notes -i
agent-desktop triple-click @e3  # Select entire paragraph
agent-desktop type @e3 "New paragraph text"  # Replace with new text

Select and Delete Line

agent-desktop snapshot --app "Sublime Text" -i
agent-desktop triple-click @e2
agent-desktop press delete

Common Use Cases

  • Text Editing: Select lines for deletion or replacement
  • Code Editors: Select code lines for copying
  • Document Editing: Select paragraphs in word processors
  • Terminal: Select command lines in terminal apps

Behavior Differences

Application TypeTriple-Click Behavior
Text EditorsSelects entire line including newline
Word ProcessorsSelects entire paragraph
TerminalSelects command line
Web BrowsersSelects paragraph (varies by implementation)

Error Cases

Error CodeCauseRecovery
ELEMENT_NOT_FOUNDRef doesn’t exist in current refmapRun snapshot to refresh
STALE_REFElement no longer matches saved refRun snapshot and use new ref
ACTION_FAILEDElement doesn’t support triple-clickTry text selection with keyboard shortcuts

Notes

  • Triple-click selection behavior varies by application
  • Some apps select line, others select paragraph
  • Timing between clicks is platform-optimized
  • Use double-click for word selection
  • Always verify selection before performing operations on it

Build docs developers (and LLMs) love