Hey everybody, working on my very first applescript and I could use a little help. I have searched extensively online, and in these forums, and have yet to find a satisfactory answer to my question.
I have written a very basic script that sounds an emergency alert sound and opens a doppler radar app when I receive an e-mail containing the words “tornado warning.” It is triggered by the rules feature in Mail:
tell application "Finder"
activate
open application file "RadarScope.app" of folder "Applications" of startup disk
end tell
set savedSettings to get volume settings
set volume output volume 80
repeat 2 times
tell application "Play Sound"
play "Macintosh HD:System:Library:Sounds:EAS1.aif"
end tell
delay 19
say "The national weather service in Nashville has issued a tornado warning for Rutherford county in Middle Tennessee. Please seek shelter now." using "Alex"
delay 2
tell application "Play Sound"
play "Macintosh HD:System:Library:Sounds:EAS2.aif"
end tell
delay 9
end repeat
set volume output volume (output volume of savedSettings)
What I would like to know, is how to get an alert dialog to stop the script. So that I don’t have to hear it repeat (preferably I would like it to repeat ad infinitum until some button is pressed such as an alert dialog button)
I appreciate all of your help in advance. If you have any questions, I would be glad to answer them.