app_press_dialog_button
Press a named button in an open Altium dialog by caption, even when the scripting engine is blocked, with irreversible actions gated unless explicitly allowed.
Instructions
Press ONE named button in an open Altium dialog.
The missing primitive. Dialogs could be listed, read and their checkboxes set, but the only code that pressed anything was buried inside a single task-specific driver, so answering an arbitrary dialog meant writing a script.
BY CAPTION, not position. Accelerator ampersands and a trailing ellipsis are ignored, so "Report Changes" finds "&Report Changes...".
IT WORKS WHILE ALTIUM IS BLOCKED, because it addresses the button's window handle over Win32 and never touches the bridge. That is the whole point: when a modal has the scripting engine stuck, this is what gets it unstuck.
IRREVERSIBLE PRESSES ARE GATED. A caption that commits a change
order or applies a wizard is refused unless
allow_irreversible is set, so a driver walking an unfamiliar
dialog cannot execute one by reflex.
For a whole sequence rather than one press, use
app_drive_dialogs, which decides each step from what is on
screen instead of from a script.
Args: button_caption: the visible caption. dialog_title: substring picking one dialog when several are open. Empty uses the first. allow_irreversible: permit a committing press.
Returns:
ok, the dialog and button actually matched, and whether
the dialog closed afterwards.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dialog_title | No | ||
| button_caption | Yes | ||
| allow_irreversible | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||