ui_press
Activate a widget's own action through AT-SPI after verifying it still matches the expected name or role, preventing wrong presses when the interface tree shifts.
Instructions
Invoke a widget's own action through AT-SPI -- the preferred way to act on this desktop. Requires expect_name or expect_role, and refuses if the path no longer points at that widget, so a shifted tree cannot make you press the wrong thing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | A widget number from the last screen_map; path, expect_name and expect_role are filled from it. Give ref OR path, never both. | |
| look | No | What to show you afterwards. Default "auto": wait for the screen to stop changing, measure how much this action changed, and attach a picture of the affected window only if something did change -- so a click that hit nothing costs no tokens and says so. "window" always attaches it, "screen" uses the whole desktop (slower, 6x the tokens), "region" uses look_at, false skips all of it. Use false for the middle of a sequence you are going to check at the end anyway. | auto |
| path | No | Index path from ui_find, e.g. "gedit/0/3/1" | |
| look_at | No | Rectangle for look:"region", in screen pixels. Object form {x, y, width, height} or array form [x, y, width, height]. | |
| expect_name | No | Name the widget should still have (substring) | |
| expect_role | No | Role the widget should still have | |
| action_index | No | ||
| settle_max_s | No | How long to wait for the screen to stop changing before looking. Raise it for an app that animates slowly; set it to 0 to capture immediately. |