when quit is not quit
when quit is not quit
- Subject: when quit is not quit
- From: Don and/or Judi Hall <email@hidden>
- Date: Fri, 2 Nov 2001 00:35:32 -0700
Why does the dialog "returned from handleError" appear even though this
handler has a quit statement in it in the test script below?
Here is the sequence of events:
1. dialog in handleError appears, and I dismiss it.
2. dialog in quit appears, and I dismiss it.
3. "returned from handleError" dialog appears and I dismiss it.
4. "beep" sounds and there is a one second delay
5. app quits
Is there any way to get around this? I do not want my script to continue
executing statements after the call to quit in handleError.
Thanks for any advice,
Don
-- quit test --
-- save this as a stay open application and run from Finder
on run
set errMsg to "test message"
set errNum to -1
handleError(errMsg, errNum)
display dialog "returned from handleError" buttons {"OK"} default
button 1
beep
delay 1
end run
-- error handler --------------------------------------------------------
to handleError(errMsg, errNum)
activate me
beep
display dialog "error number " & errNum & ":" & return & errMsg &
return ,
buttons {"Quit"} default button "Quit" with icon stop
quit
end handleError
-- quit handler -- runs when program receives a quit
message -------------------------
on quit
display dialog "quitting"
continue quit
end quit