Show macOS notifications from shell scripts

published on in category macOS , Tags: macos apple

Table of contents

macOS has the osascript command line tool that allows you to run embedded AppleScript right from within shell scripts. As AppleScript also has capabilities to show notifications, you can utilize this to show messages in the macOS Notification Center.

Here is an example:

osascript -e 'display notification "Something happened" with title "Test"'

If you have any further tips that will help people supercharge their shell scripts on macOS, feel free to leave them as a comment.