This is a script to run some actions when a volume button is pressed:
The volume setting technique is taken from @omz script for setting the volume.

It basically verifies if the volume changed(increased or decreased) and does two actions ( one for increased and one for decreased)

Here is the Script