glass_set_value
Set an editable element's value by its accessibility snapshot id, supporting text, numbers, toggles, and dropdowns, with read-back confirmation.
Instructions
Set an editable element's value — pick the element's #id from glass_a11y_snapshot. Where the platform can write the value directly this is instant and takes no keystrokes; where it has to be typed, glass taps the element, clears it and types, then reads the element back to confirm — up to three accessibility reads, since a field may commit a frame or two later. Errors if the element isn't editable, if it changed since the snapshot (re-snapshot), if the element does not hold the requested value afterwards, or if the app exposes no accessibility tree. A separate error says the text WAS typed but the write could not be confirmed — the read-back failed, or could not tell which element now holds it. Do NOT write again on that one: the keystrokes already went out, and re-snapshotting is how you see where they landed. Optional return: "snapshot" settles the UI then folds a fresh a11y tree into the result (and refreshes the snapshot cache); "settle" waits for the UI to stop changing (text-only); omit or "none" for no observe (default).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The element `#id` from `glass_a11y_snapshot`. | |
| text | Yes | The value to set. For a text field, the text. For a spin/slider, a number. For a switch/checkbox/toggle, a boolean (`"true"`/`"false"`/`"on"`/`"off"`/ `"1"`/`"0"`) — idempotent. For a dropdown/combo box, an option label (case-insensitive); glass opens it and picks that option. | |
| return | No | Optional observe folded into the result: "snapshot" (wait for the UI to settle, then fold a fresh a11y tree, also refreshing the snapshot cache), "settle" (wait for the UI to stop changing, text-only), or "none" (default). |