notification Action

An action to post notifications to macOS Notification Centre.

{
  "notification": {
    "post": {
      "title": "Fruits",
      "text": "Banana and Orange"
    }
  }
}
Note

On external Alfred UIs, notifications only appear if the window is not frontmost. They are always added to the Notifcation Centre regardless.

Properties

post
OBJECT | ARRAY

An OBJECT containing the details of the notification to post, or an ARRAY of these OBJECTs to post multiple notifications.

uid
STRING
Default: A random UUID

A UID for the notification. If this is assigned, any previous notifications with the same uid will be replaced.

title
STRING

The notification title.

text
STRING

The notification content.

remove
STRING | ARRAY

A string or array of uid strings to remove from macOS notification centre.

Examples

Show a notification

{
  "type": "button",
  "text": "Post a notification",
  "events": [
    {
      "triggers": "actioned",
      "action": {
        "type": "json",
        "src": {
          "notification": {
            "post": {
              "title": "I am the notification title",
              "text": "I am the notification text"
            }
          }
        }
      }
    }
  ]
}