ui_switch_window
Retarget UI automation to a different top-level window of the same process, enabling interaction with modal dialogs, file pickers, or popups. All subsequent UI calls operate inside the new window.
Instructions
Retarget the UI backend at a different top-level window of the same process.
Use this to enter modal dialogs, file pickers, or popups that appear as sibling windows of the app's main window. After switching, all subsequent ui_* calls (find_element, click, send_keys, etc.) operate inside the new window's subtree.
Typical flow:
ui_get_window_tree() → inspect "windows" array
ui_switch_window(name="Create collection") → enter dialog
ui_find_element(control_type="Edit") → locate dialog TextBox
ui_send_keys_batch(keys=["Characters", "{ENTER}"]) → type + submit
After dialog closes, ui_switch_window(name="Main App Title") to return to the original window
Requires the FlaUI bridge backend; the pywinauto fallback raises NotImplementedError. At least one of name or automation_id must be provided; automation_id is matched first.
Args: name: Window title (e.g., the dialog's Title/Name property) automation_id: Window's AutomationId property (if any)
Returns: {"switched": True, "title": "...", "automationId": "..."} on success
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| automation_id | No |