New in version 1.15.
Notifications are only available on Mountain Lion (10.8) and later. Calling
notify() on earlier systems will silently fail.
Alfred 2 allows you to post notifications, but only at the end of a workflow, and only with its own icon.
notify module lets you post notifications
whenever you want, and with your workflow’s icon.
1 2 3
from workflow.notify import notify notify('My Title', 'My Text')
This is the full API:
notify(title=u'', text=u'', sound=None)¶
Post notification via Notify.app helper.
- title (str, optional) – Notification title.
- text (str, optional) – Notification body text.
- sound (str, optional) – Name of sound to play.
ValueError– Raised if both title and text are empty.
True if notification was posted, else False.
See the API documentation for details of the other functions.