Topic: https://brettterpstra.com/2010/09/25/clear-sticky-growl-notifications-with-a-keyboard-shortcut/
hide preview

What's next? verify your email address for reply notifications!

vedran 14y, 64d ago

Works great, and its just what i needed!
Thanks

hide preview

What's next? verify your email address for reply notifications!

Seth Milliken 14y, 101d ago

I had a similar itch, myself. There are a couple of enhancements and differences in my version:

<ul>
<li>mine posts a (non-sticky!) growl notification after restarting</li>
<li>mine is toggles Growl off and on rather than just restarting</li>
<li>mine kills and opens the menu item (this gives me a visual indicator of whether Growl is running; I generally don't use it as a menu)</li>
<li>mine is a shell script since it appears to run faster than an AppleScript (I use a Quicksilver "Run script" trigger for activation).</li>
</ul>

#!/bin/bash
GROWLAPP=/Library/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app
GROWLMENU=/Library/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlMenu.app
NOTIFICATION_SCRIPT=/usr/local/bin/growlnotify

function running {
TARGET=$1
MATCH=$2
RESULT=`ps x | grep Growl | grep -v grep`
if [[ $RESULT != "" ]]
then
killall -m -HUP Growl
else
open ${GROWLAPP}
sleep 1
${NOTIFICATION_SCRIPT} 'Growl' -a'GrowlHelperApp' -m'Restarted'
open ${GROWLMENU}
fi
}

running
remark link
hide preview

What's next? verify your email address for reply notifications!

Brett 14y, 101d ago

If you want a toggle, this is great (I just want to restart it to clear out a bunch of sticky notifications from the keyboard). If I may, I'd suggest that the killall -m could be a bit general, as it would match every process with "Growl" in the name. You might try: RESULT=ps auxwww|grep GrowlHelperApp|grep -v grep|awk '{print $2}' and then kill $RESULT. Works great, though!

hide preview

What's next? verify your email address for reply notifications!

Jason Clarke 14y, 176d ago

This is awesome. Thanks!

hide preview

What's next? verify your email address for reply notifications!