Created
April 26, 2010 20:32
-
-
Save quackingduck/379866 to your computer and use it in GitHub Desktop.
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
# See: http://growl.info/documentation/applescript-support.php | |
# This is still pretty much voodoo to me | |
# | |
# The name argument specifies the name that will appear in the "Applications" | |
# tab of the Growl preferences pane. | |
def RBGrowl(name, title, body, icon = 'Console') | |
name, title, body, icon = [name, title, body, icon].map { |v| v.inspect } | |
ascript = %{tell application "GrowlHelperApp" | |
-- Make a list of all the notification types that this script will ever send: | |
set the allNotificationsList to {#{name}} | |
-- Make a list of the notifications that will be enabled by default. | |
set the enabledNotificationsList to {#{name}} | |
-- Register our script with growl. | |
register as application #{name} ¬ | |
all notifications allNotificationsList ¬ | |
default notifications enabledNotificationsList ¬ | |
icon of application #{icon} | |
-- Send a Notification... | |
notify with name #{name} ¬ | |
title #{title} ¬ | |
description #{body} ¬ | |
application name #{name} | |
end tell} | |
system 'osascript', '-e', ascript | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment