ghost_act
Find a UI element by name or role and click, type, double-click, right-click, or hover in one call, even on covered or hidden windows. Runs in the background, preserving the user's focus and cursor.
Instructions
Find an element and act on it in one call. Target window = window= (anchored) or the session anchor. Under the default background policy the window is NEVER raised and the cursor never moves: click = UIA Invoke or a posted click, type = ValuePattern / WM_SETTEXT with read-back, and the response reports {verified, focus_preserved, cursor_preserved}. Works on covered windows, Chromium/Electron pages and hidden-desktop apps. If a windowless control's own provider activates its window anyway (Chromium does on SetValue), the foreground is handed straight back to the window the human had and the response carries focus_guard. Identify the element by name|role (description needs vision and a screen-facing window). verified=false = dispatched but nothing visibly changed: ghost_see before retrying. background=true is accepted for compatibility; it is already the default behaviour.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | ||
| name | No | ||
| role | No | ||
| text | No | ||
| index | No | Act on the nth match (0-based) when several elements share the name/role. Honoured on every route (background, hidden desktop, CDP, foreground); use ghost_find with the same name/index first to see the matches count | |
| action | Yes | Action to perform | |
| window | No | Title substring of the window to act in (anchors it). Omit to use the anchor. | |
| background | No | Compatibility flag: background dispatch is already the default. Real Win32 controls get posted messages; windowless (WinUI/Chromium/Electron) controls get UIA Invoke/ValuePattern; double_click/right_click/hover need a windowed control. focus_preserved in the response reports the truth. | |
| text_input | No | Text to type when action=type (use this to avoid param collision with text-target) | |
| description | No |