Re: Re: Repeat With question (newbie level)
Re: Re: Repeat With question (newbie level)
- Subject: Re: Re: Repeat With question (newbie level)
- From: email@hidden
- Date: Wed, 14 Feb 2001 20:52:51 EST
Michelle Steiner said:
>
repeat with currentLetter in the alphalist
There is a caveat with this approach (which is a correct and very good
approach BTW, being standard Applescript and all). A script will demonstrate:
set alphaList to {"a", "b", "c"}
repeat with aLetter in alphaList
if aLetter is equal to "b" then beep 1
if aLetter is "b" then beep 1
if aLetter = "b" then beep 1
if aLetter is equal to "b" then beep 1
if (aLetter as string) is equal to "b" then beep 1 -- only this line
makes a beep
end repeat
It is entirely likely that many of you have an osax installed which quietly
does a coercion, making this problem not show on your machine but causing
silent and frustrating to diagnose problems when moved to other machines. My
osax are on the lite side - Tanaka's, Akua, Jon's, Sigma's, Satimage.
Jeff Baumann
email@hidden
www.linkedresources.com
Congratulations to Charles who answered the last trivia question.
Next Trivia question - what is the linking element amongst Thalia Menninger,
Chatsworth Osborne, Jr., and Mr. Pomfritt?
In a message dated 2/14/01 12:53:27 PM, Michelle Steiner wrote:
>
On 2/14/01 8:51 AM, Bill Planey <email@hidden> wrote:
>
>
>Is there a way to set each alphabetic character into a list
>
>{"a", "b", "c", "d", etc.} and have the variable be redefined
>
>to the next letter in the list upon the completion of a step
>
>until the last letter has been used? I know this is possible
>
>with numbers (ie,: Repeat with i from 1-9), but how about letters?
>
>
set the alphalist to {"a", "b", "c", "d"}
>
repeat with currentLetter in the alphalist
>
display dialog currentLetter
>
end repeat
and in a message dated 2/14/01 12:53:27 PM, g3pb wrote:
>
set ans to ""
>
set chList to {"a", "b", "c", "d"}
>
repeat with anitem in chList
>
set ans to ans & anitem
>
end repeat