A snapshot of the foreground window, or null when no focusable window is active.
Finds all visible windows matching the given filter criteria.
Optionalquery: WindowQuery | null
Object with optional title and/or process filters. Omit or pass null to return every visible top-level window.
An array of matching WindowInfo objects. Empty array if none match.
The title filter is treated as a regular expression when valid, falling back to substring match if the pattern is invalid. The process filter is always a case-insensitive substring match on the executable name.
Brings the specified window to the foreground.
The id from a WindowInfo object.
true if the window was successfully focused.
Moves a window to an absolute physical virtual-screen position and optionally resizes its outer bounds.
The id from a WindowInfo object.
Absolute new left edge.
Absolute new top edge.
Optionalw: number
Positive signed-32-bit outer width. Omit to keep the current width.
Optionalh: number
Positive signed-32-bit outer height. Omit to keep the current height.
true if the operation succeeded.
x and y set the outer window's top-left corner; they are not relative offsets. The signed coordinate space is shared with Mouse, Screen, and overlays, so monitors left of or above the primary monitor use negative values. Width and height are physical pixels and are not DPI-scaled.
Sends a close request (WM_CLOSE) to the specified window. The window may prompt the user before closing.
The id from a WindowInfo object.
Registers a callback that fires whenever a different window becomes the foreground window. The script enters an event loop and stays alive as long as this handler is registered.
Handler receiving the newly activated window's WindowInfo, or null if it closed before dispatch.
Returns information about the currently active (foreground) window, or
nullif no window is focused.