Browse the docs

Show notification

Posts a macOS notification with a title, an optional body and an optional sound.

Show notification title

Keyboard Maestro: Notification, DisplayText

Details #

Posts a banner through Notification Center. The first time it runs, macOS asks whether Switchboard may send notifications. Use it for results you want to find later; for a message that disappears by itself use Show message.

The step's output is the title and body it showed.

Parameters #

ParameterTypeRequiredValuesWhat it does
titletextYesRequired in the schema. Shown in bold. If it is missing at run time, Switchboard is used.
bodytextThe second line. Leave it out for a title-only banner.
soundtextdefault plays the system alert sound. Any other value is the name of a sound file macOS can find (for example one in ~/Library/Sounds). Leave it out for silence.

Every step also accepts label, onFailure, timeout and dryRunSafe.

Examples #

Tell me when a download finishes
Do
  1. Show a notification “Download done”
Open in Switchboard to try it

Gotchas #

  • A dry run does not post it. The trace shows the step as simulated.

  • If notifications are switched off for Switchboard, the step fails and says to allow them in System Settings > Notifications.

  • A build with no app bundle (the bare engine used in tests) cannot show a banner. There the step still succeeds and the trace note says logged only with the reason.

See also #

Show message, Say aloud, Ask for input