Is there a hook for triggering scripts when a particular notification is displayed? I'm trying to set up some system behaviors to occur when particular iCal or GCal events begin and end. Is there a way to hook into the notifications system (e.g., via a LaunchAgent) to make the Mac run a script when a particular notification fires?

Note that I'm not asking about triggering a notification from a script, but rather the other way around.
In calendar.app you’re able to set a file to run instead of an alert. Try creating an Automator file, and select the calendar type