Manage "horn" by alarm script

Hi,
I want manage an horn when appear an alarm
If I shelve the alarm the horn shut off until when end the shelve or appear a new alarm.

someone can help me?