Created
January 28, 2013 19:29
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Created for dergachev/copy-public-url#10