• 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
Re: repeat dialog (was (no subject))
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: repeat dialog (was (no subject))


  • Subject: Re: repeat dialog (was (no subject))
  • From: Walter Ian Kaye <email@hidden>
  • Date: Wed, 28 Jul 2004 17:46:53 -0700

At 05:19p -0700 07/28/2004, Patrick Zittle didst inscribe upon an electronic papyrus:

Hey Everyone! I was just wondering what the format for a if-then script? I would like to ask a display a question and if they insert anything but the answer it asks the question again. How can I do this?

You can use a repeat loop. Try this:

set theQuestion to "Who wrote WorldWideWeb.app?"
set repeatQ to "Sorry, wrong answer. Try again." & return & theQuestion
set theAnswer to "Tim Berners-Lee"
repeat
display dialog theQuestion default answer ""
if text returned of result contains theAnswer then
exit repeat
else
set theQuestion to repeatQ
beep
end if
end repeat


-Walter
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


References: 
 >(no subject) (From: Patrick Zittle <email@hidden>)

  • Prev by Date: Re: Switching Processes - Previous and Next
  • Next by Date: Jamie Kahn Genet has sent you a 10% discount
  • Previous by thread: (no subject)
  • Next by thread: if-then script (was: (no subject))
  • Index(es):
    • Date
    • Thread