Read or answer the console's open dialog
gma3_dialogReads open grandMA3 console dialogs or safely presses a named button after verifying the dialog's title, message, and button state before acting.
Instructions
For a dialog no structured tool answers, e.g. a macro's Lua Confirm() (gma3_run_macro reports an open dialog). action read (read-only): the top modal's class, title, message and buttons (text, enabled), or open: false. action press: clicks one button, named by its exact text, after checking that the open dialog still shows expect_title and/or expect_text as read returned them ("" for a dialog without a title) and that the button is there and enabled; a different dialog is never answered. Then the dialog is read again: closed, replaced by another dialog, or still open, with the console's last command (which does not name the button: check the effect on the object). Requires exclusive: true for press. What a button does has NO UNDO. Buttons that delete, overwrite, load a show or discard changes are pressed only because the call names them: read the message first. Tools that open their own dialogs (gma3_save_show, gma3_patch_move) answer them themselves. Needs bridge 0.42.0.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| button | No | press: the button's text exactly as read lists it, e.g. "OK". | |
| exclusive | No | press: required, must be true: nobody else operates the console meanwhile. | |
| expect_text | No | press: the dialog's message as read returned it (whitespace is compared collapsed). | |
| expect_title | No | press: the dialog's title as read returned it ("" when it has none). |