(* Save this as an Application, Stay-Open This script will delay quitting until it has finished with its run handler *) on run display dialog "We'll quit now, OK?" buttons "OK" 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 end idle on activate beep delay 2 beep delay 1 beep end activate