How to create alert in osx?


Problem 😱

How to create alert in osx which could be triggered via command line?


Solution 🤓

function alert() { osascript -e 'display notification "'"$1"'" with title "'"Alert"'"' && say $1; }

Usage:

alert "Wow it's so nice 🤓"

alert in osx