Skip to content

Instantly share code, notes, and snippets.

@dergachev
Created January 28, 2013 19:29
Show Gist options
  • Save dergachev/4658306 to your computer and use it in GitHub Desktop.
Save dergachev/4658306 to your computer and use it in GitHub Desktop.
Compile and run this in Applescript Editor to test if Growl is installed and can be called from Applescript.
on run
sendGrowlNotification("Growl works!")
end run
on sendGrowlNotification(message)
--display alert ("Message: " & |message|)
-- see http://growl.info/documentation/applescript-support.php
tell application "System Events"
set isGrowlRunning to (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0
end tell
if isGrowlRunning then
tell application "GrowlHelperApp"
-- Make a list of all the notification types
-- that this script will ever send:
set the allNotificationsList to ¬
{"Public URL"}
set the enabledNotificationsList to allNotificationsList
-- Register our script with growl.
-- You can optionally (as here) set a default icon
-- for this script's notifications.
register as application ¬
"CopyDropboxURL" all notifications allNotificationsList ¬
default notifications enabledNotificationsList ¬
icon of application "Dropbox"
notify with name ¬
"Public URL" title ¬
"Copy Public URL" description ¬
(message) application name "CopyDropboxURL"
end tell
-- icon of file (path to me)
-- icon of application "Dropbox"
end if
end sendGrowlNotification
@dergachev
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment