Posted By

vonsko on 07/23/12


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vonsko


growl notification


 / Published in: AppleScript
 

  1. tell application "System Events"
  2. set isRunning to (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0
  3. end tell
  4.  
  5. if isRunning then
  6. tell application id "com.Growl.GrowlHelperApp"
  7. -- Make a list of all the notification types
  8. -- that this script will ever send:
  9. set the allNotificationsList to ¬
  10. {"Test Notification", "Another Test Notification"}
  11.  
  12. -- Make a list of the notifications
  13. -- that will be enabled by default.
  14. -- Those not enabled by default can be enabled later
  15. -- in the 'Applications' tab of the Growl preferences.
  16. set the enabledNotificationsList to ¬
  17. {"Test Notification"}
  18.  
  19. -- Register our script with growl.
  20. -- You can optionally (as here) set a default icon
  21. -- for this script's notifications.
  22. register as application ¬
  23. "Growl AppleScript Sample" all notifications allNotificationsList ¬
  24. default notifications enabledNotificationsList ¬
  25. icon of application "Script Editor"
  26.  
  27. -- Send a Notification...
  28. notify with name ¬
  29. "Test Notification" title ¬
  30. "Test Notification" description ¬
  31. "This is a test AppleScript notification." application name "Growl AppleScript Sample"
  32.  
  33. notify with name ¬
  34. "Another Test Notification" title ¬
  35. "Another Test Notification :) " description ¬
  36. "Alas — you won't see me until you enable me..." application name "Growl AppleScript Sample"
  37.  
  38. end tell
  39. end if
  40.  

Report this snippet  

You need to login to post a comment.