(* Save this as an Application, Stay-Open This script will have its run interrupted by an untrapped error (the "Cancel" button). It then idles until Quit is chosen from the menu or Command-Q is pressed. *) on run display dialog "We'll quit now, OK?" buttons "Cancel" tell me to quit tell me to saySomething() tell me to activate end run on saySomething() say "Something" end saySomething on quit continue quit end quit on idle beep return 1 end idle on activate beep beep delay 2 beep delay 1 beep end activate