Re: repeat dialog (was (no subject))
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>) |