capture-screen
Capture Screen
Programmatic screenshot capture on macOS: find windows, control views, capture images.
Select observation or foreground control
For an existing view, enumerate and capture the exact window without activating it. Skip Step 2 when no view change is needed. A window image proves visible content in that capture, not keyboard focus, input delivery or a successful business action.
Before opening/raising windows, scrolling, selecting, changing zoom or sending keys, the executing agent checks user activity and other agents' ownership. Use a concrete task handoff or an existing explicit idle-desktop authorization; under the latter, coordinate exclusive access and proceed without asking again. Idle input alone is not ownership. Busy/unknown occupancy or unexpected input stops foreground actions; continue independent reads and do not restore old focus after human takeover.