Display Alert Giving Up After Broken?
Display Alert Giving Up After Broken?
- Subject: Display Alert Giving Up After Broken?
- From: Todd Blume <email@hidden>
- Date: Mon, 18 Jul 2005 14:59:17 -1000
Title: Display Alert Giving Up After
Broken?
I'm trying to use "display alert" with the optional
"giving up after" parameter. If the alert gives up then I
want to re-issue the alert for a certain number of tries, so I've put
the "display alert" in a repeat while loop to manage the
retries.
What I see is that the first time through the alert
waits the expected amount of time before giving up, but on subsequent
calls in the loop it gives up immediately. I check the variable
holding the give up timeout value after the loop and it is OK. So this
appears to be an AppleScript bug where the compiled code is optimized
(polite term ;-) in some way that forgets to reset the give-up
state.
Is this indeed a bug or am I just doing something
wrong?
Here's a simplified test case:
set giveUpTime to
10
set pauseTime to
2
set maxTries to
5
set tryCount to
0
set remind to true
repeat
while
remind
set
theButton
to "OK"
set
theReply to display
alert "Don't touch
that button!" as
critical buttons
{theButton} giving up after giveUpTime
if not gave
up of
theReply
then
set
remind to
false
else
set
tryCount
to
tryCount + 1
if
tryCount maxTries then
set
remind to
false
else
delay pauseTime
end
if
end if
end
repeat
beep
giveUpTime
Any insights would be appreciated.
Aloha,
--
Todd Blume
Tiger Island Software
http://www.TigerIsland.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden