Re: Repeat-Dialog-Error
Re: Repeat-Dialog-Error
- Subject: Re: Repeat-Dialog-Error
- From: Daniel Shockley <email@hidden>
- Date: Wed, 28 Feb 2001 22:23:01 -0800 (PST)
>
Message: 5
>
Date: Wed, 28 Feb 2001 18:45:02 -0800
>
Subject: Repeat-Dialog-Error
>
From: Brad Giesbrecht <email@hidden>
>
To: AS list <email@hidden>
>
>
Hello,
>
>
<snip>
>
try
>
repeat while (not done)
>
set x to the button returned of --optionreturn
>
(display dialog "" buttons {"Cancel", "Look", "Continue"} as text
>
set done to true
>
if x is "Look" then
>
process_windows()
>
set done to false
>
end if
>
end repeat
>
on error
>
display dialog "Cancel failed."
>
end try
>
<snip>
>
>
Why when I click the cancel button, do I get the
>
"Cancel failed" dialog.
Paul made some good points about how the "Cancel" button genereating an actual error is a good
thing. Nevertheless, if you want a Cancel button that just acts like a regular old button, name it
" Cancel " Notice the spaces on each end of the name? AppleScript generates the "User Cancelled
error when a button named "Cancel" is clicked and released, but " Cancel " is just another button
with a text name.
Hope that helps,
=====
Daniel A. Shockley
email@hidden
http://www.danshockley.com
http://www.krioni.com
And now for a message from my sponsor... *grin*
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/