How do you execute a shell script whenever a Growl notification is shown? And make it application specific. For instance, run a the shell script
say "You have new mail" whenever a growlMail notification is shown?
To play a custom sound in response to a Growl notification:
Create a sound file and make it available to the system:
say -o YouHaveMail "You have Mail"
creates the sound file, "YouHaveMail.aiff". Sudo cp the file to /System/Library/Sounds/.
Configure Growl to use that sound for the particular app and notification:
Growl preference pane | Applications
In the Application list, select your application.
Configure | Notifications
In the Notifications: dropdown, select a notification.
In the Play Sound: dropdown, select YouHaveMail.