Show macOS notifications from shell scripts

published on in category macOS , Tags: macos apple

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.

I run this site without advertisement of any kind. All information is free and my only goal is to give back something to the amazing free software development community. If you find some value in this, please consider donating me a cup of coffee using PayPal. Thank you so much!