how to display notification with osascript


Does anyone know an easier way to display notification with osascript, than using ‘run script’? For instance I can get the notification banner or alert with:

do shell script "osascript -e 'run script \"display notification \\\"hello\\\"\"'"

But all those slashes with the extra quotes are confusing. Without the ‘run script’ the notification only show in the notification list.


That’s alright. I found that it works when run as AppleScript app and not in AppleScript Editor:

do shell script "osascript -e 'display notification \"hello\"'"

Edited: the AppleScript Editor was the culprit all this time. :slight_smile:

Thanks anyway,