Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

22
  • 9
    @ceilingcat This is AppleScript. To run it in Terminal, use osascript (see answer). Commented May 2, 2014 at 18:32
  • 16
    The only problem with display notification is that when you click on it, the open file dialog appears. Commented Aug 13, 2014 at 20:57
  • 10
    Is it possible to make the notificatiop popup exist forever (not auto-hide after N seconds) until explicitly clicked by the user? Commented Apr 1, 2015 at 22:15
  • 46
    Ladies and gentlemen, after an hour of investigation on the world wide web, I have found out how to let the notification window stay until dismissed by user! It was actually controlled by a setting in System Preference, rather than some parameter in the script written. These two images should explain it all i.imgur.com/cNOqFyX.jpg i.imgur.com/i8oyoan.jpg Have fun guys, and thanks @grgarside for the great answer. Commented Nov 7, 2015 at 0:31
  • 7
    Note that the text has to be in double quotes. Single quotes don't work. So if you need a variable in the text, you cannot write "display ... '$mytext' ...", but need escaped double quotes: "display notification \"$mytext\" ...". Commented Dec 12, 2015 at 11:14