• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Display Alert Giving Up After Broken?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Display Alert Giving Up After Broken?
      • From: tim <email@hidden>
    • Re: Display Alert Giving Up After Broken?
      • From: Matthew Smith <email@hidden>
References: 
 >Lots of Excel text (From: Hanaan Rosenthal <email@hidden>)

  • Prev by Date: Re: AS driving Perl (or vice-versa)
  • Next by Date: Re: TextEdit script (Applescript-users Digest, Vol 2, Issue 470)
  • Previous by thread: Re: Lots of Excel text
  • Next by thread: Re: Display Alert Giving Up After Broken?
  • Index(es):
    • Date
    • Thread