Trigger script on Event?


I have a DAC that is connected to the RP with USB.
When I turn on the DAC I can see two events happening:
“USB DAC Connected”
“Configuration updated, Player successfully restarted”
I would like to run a script when either of these events are triggered.
Can someone suggest how best to do this?