An error dialog appears
Runs the macro when any app shows an alert, sheet or system dialog, with its text and buttons.
An error dialog appears in app
Details #
Watches every running app for a new alert, sheet or system dialog and runs the macro when one appears. The macro is handed what the dialog said, so it can log it, explain it, copy it or press one of its buttons.
A new window counts as a dialog when it is a sheet, or its role is a dialog, a system dialog, or a floating window that has buttons, and it holds some text. Alerts from the system's own alert helpers (UserNotificationCenter and CoreServicesUIAgent) count too and arrive with kind set to system.
The macro gets these inputs, which you can use as {{ text }}, {{ buttons }} and so on:
| Input | What it holds |
|---|---|
app | The bundle identifier of the app that showed it. |
title | The window's title, often empty for an alert. |
text | Every line of text in the dialog, joined with line breaks. |
buttons | The titles of its buttons, left to right, as a list. |
kind | dialog, sheet or system. |
{{triggerValue}} is the dialog's text.
All three parameters narrow it down, and all are optional. With none, every dialog in every app runs the macro.
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
app | text | A bundle identifier such as com.apple.finder. Only dialogs from that app count. | ||
button | text | A button title such as Don't Save. Only dialogs that have that button count. | ||
text | text | A regular expression, matched without regard to case against the dialog's text and title. An expression that is not valid matches nothing. |
Every trigger also takes Limits: a cooldown, the first time each day, every nth time, twice within seconds, a chance, only while you are at the Mac, on one Mac, or in a State. See Limits on any trigger.
Examples #
- An error dialog appears
- Show “{{ app }}: {{ text }}” for 4 s
- An error dialog appears in TextEdit saying “save the changes” with the “Delete” button
- Press the “Delete” button
Gotchas #
Switchboard only watches while at least one turned-on macro uses this trigger. With none, no app is observed at all.
An app that does not answer Accessibility within a quarter of a second is skipped. It is tried again the next time it comes to the front.
The dialog's contents are read about a fifth of a second after it opens, once the app has laid them out. A dialog that closes faster than that does not fire.
A macro that presses a button in the dialog does not trigger itself again: the dialog is gone by then.
Text in the dialog can include file names and other private details. A macro that sends it to a model or a web service sends those too.