Skip to content
PitestsCLI & tooling

Automate text replacement in TextEdit via AX tools

Session from pi-computer-use-sessions on Hugging Face by thomasmustier · MIT · condensed by Coders Talk

20ssession
0interventions
GOAL

Use accessibility automation to select all text in a TextEdit document and replace it with new content, then confirm the resulting AX value.

  1. Prompt · +0
    Screenshot TextEdit, select all text, replace with 'fully replaced ✅ 漢字', then quote the literal final AX value.
  2. Agent did · +0m
    Took a screenshot of TextEdit, selected the full text range (0 to -1, matching 33 chars), then typed the replacement string into the AXTextArea via type_text.
  3. Outcome · +0m
    Final AX value confirmed as 'fully replaced ✅ 漢字', matching the intended replacement.
VERDICT

I'd keep this exact structured prompt next time since it worked cleanly end to end with no corrections needed. The AX-based select-all and type_text approach handled unicode and emoji characters correctly without any coordinate-click fallback.

I tried this · 0

Discussion · 0

How Builds work