Understand focus requirements for Ghost OS tools
mainGhost OS tools are categorized by whether they require the target application to be in focus:
Background Tools (No focus needed)
These tools work regardless of whether the app is focused or even in a different Space. Note that ghost_screenshot will fail if all windows of an app are closed.
ghost_context,ghost_state,ghost_find,ghost_read,ghost_inspect,ghost_element_at,ghost_screenshot
AX-Native Tools (No focus needed, but may auto-focus)
These attempt AX-native interaction first, falling back to synthetic events that auto-focus the app.
ghost_click,ghost_type
Focus-Required Tools (Always pass the app parameter)
These tools require the target app to be focused to function correctly.
ghost_press,ghost_hotkey,ghost_scroll,ghost_hover,ghost_long_press,ghost_drag