Skip to content

Instantly share code, notes, and snippets.

@kosugi
Created April 25, 2010 06:09
Show Gist options
  • Save kosugi/378196 to your computer and use it in GitHub Desktop.
Save kosugi/378196 to your computer and use it in GitHub Desktop.
(* Growl Toggler *)
(* based on http://veadardiary.blog29.fc2.com/blog-entry-2449.html *)
tell application "System Events"
set isRunning to (count of (every process whose name is "GrowlHelperApp")) > 0
end tell
if isRunning then
tell application "GrowlHelperApp"
set the allNotificationsList to {"Growl Toggler"}
register as application "Growl Toggler" all notifications allNotificationsList default notifications allNotificationsList icon of application "GrowlMenu"
notify with name "Growl Toggler" title "Growl" description "stopped" application name "Growl Toggler"
end tell
delay 5
tell application "GrowlHelperApp" to quit
else
tell application "GrowlHelperApp" to launch
tell application "GrowlHelperApp"
set the allNotificationsList to {"Growl Toggler"}
register as application "Growl Toggler" all notifications allNotificationsList default notifications allNotificationsList icon of application "GrowlMenu"
notify with name "Growl Toggler" title "Growl" description "started" application name "Growl Toggler"
end tell
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment