Skip to main content

Set window state

Sophie avatar
Written by Sophie
Updated over 2 weeks ago

Definition and Usage

This command allows you to restore, maximize, or minimize a specific window. You can target windows using different methods including window objects, window titles, class names, or UI elements.


Parameter Values

Input parameters

Parameter

Description

Possible Values

Required

Options / Notes

Get window by

Specify the window to set

Window object, Title or class, Window UI element

Yes

Determines which subsequent parameters will be available

Window

Select a window object that was obtained earlier

Yes (when "Window object" is selected)

Must be a valid window object variable

Title

Enter title of the window

Yes (when "Title or class" is selected)

Case-sensitive by default

Specify window class

Specify window class

No

When checked, allows targeting windows by class name

Class name

Enter class name of the window

Yes (when "Specify window class" is checked)

Use RegEx

Use regular expressions like ^abc (starts with abc), \d+ (any numbers), or .*.csv$ (ends with .csv) to match specific text formats

No

Enables pattern matching for window titles or class names

Element

Select or capture an element to operate on

Yes (when "Window UI element" is selected)

Must be a valid UI element

Window state

Choose in which state to set the window

Restored, Maximized, Minimized

Yes

Controls the final state of the targeted window

Error handling

Parameter Name

Description

Throw error & stop

When an error occurs, the action will trigger an error and stop the execution of the entire app.

Retry command

If an error occurs, the action will retry the command in an attempt to resolve the issue and continue the process.

Ignore error & continue

When an error occurs, the action will be ignored, and the workflow will continue without interruption.

Variables produced

This action doesn't produce any variables.


Using Variables in Conditions

You can use variables in the parameter fields where you see the {x} icon. For example, you might use a variable to dynamically determine which window to target or what state to set it to. This is particularly useful when you need to handle multiple windows or implement conditional window management logic in your workflow.


Notes

  • The window must exist and be accessible for this command to work properly.

  • When using "Title or class" option, partial matches are supported; the command will affect the first window that matches the provided title or class.

  • Using regular expressions provides more flexibility for targeting windows with dynamic or complex titles.

  • If multiple windows match the specified criteria, only the first matching window will be affected.

  • For applications with multiple windows or tabs, ensure you're targeting the correct one to avoid unexpected behavior.

Did this answer your question?