Skip to content

Instantly share code, notes, and snippets.

@lwilli
Created July 24, 2021 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lwilli/a02fb638a24235725b99a805180c7b19 to your computer and use it in GitHub Desktop.
Save lwilli/a02fb638a24235725b99a805180c7b19 to your computer and use it in GitHub Desktop.
#!/usr/bin/env osascript
# Send macOS notifications to yourself.
# Useful for notifying yourself when a long-running process is complete.
#
# Usage: ding [title]
#
# For example:
# gw test; ding Finished tests
on run argv
if (count of argv) equals 0 then
set notificationTitle to "Ding!"
else
set {TID, text item delimiters} to {text item delimiters, space}
set notificationTitle to argv as text
set text item delimiters to TID
end if
display notification with title notificationTitle sound name "Glass"
# You could also specify more details like this:
# display notification "Body" with title "Title" subtitle "Subtitle" sound name "Pop"
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment