Skip to main content

Close window

Ask a window to close (like clicking its X; the program may ask to save).

Command in the Window toolkit · id ooa.window/close · 5 inputs, 1 output

Inputs​

InputTypeRequiredDefaultWhat it is
TitleStringNoText in the window title, a pattern with * or ? (e.g. Invoice*- Excel), or re: and a regular expression; case-insensitive. The first visible window that matches is used. May be empty when process_id is given.
AlternativesDictionaryNoFallbacks when no title matches: title_pattern (wildcards or re:), class_name, process_name, and index (with class_name). The one that works is logged.
Timeout (seconds)NumberNo0Wait up to this many seconds for the window to appear; 0 looks once.
Wait until closed (seconds)NumberNo0Wait up to this many seconds for the window to disappear; 0 does not wait.
Process IDNumberNoProcess id from Start program: use that program's main window instead of finding it by title; title, when given, then only narrows the choice.

Outputs​

OutputTypeWhat it is
closedBooleanTrue when the window was gone by the end of wait_closed_seconds (always true when not waiting).