• 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 With question (newbie level)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Repeat With question (newbie level)


  • Subject: Re: Repeat With question (newbie level)
  • From: Bill Planey <email@hidden>
  • Date: Wed, 14 Feb 2001 11:43:40 -0600

>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
>
>--Michelle


Thanks Michelle,

I implemented your suggestion thus:


set the alphalist to {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
"k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x",
"y", "z"}
repeat with currentLetter in the alphalist
set FindString1 to "^p" & currentLetter
set FindString2 to currentLetter & "^p"
set ChangeString1 to " " & currentLetter
set ChangeString1 to currentLetter & " "
tell TextSubObject
yesCReplace(FindString1, ChangeString1)
yesCReplace(FindString2, ChangeString2)
if currentLetter = "n" then
JustSave()
end if
end tell
end repeat

... as I had two separate lists of replaces (26 x 2) to make,
one where the character preceded a carriage return (^p) and
one where it followed. This saved a lot of space!! Just for
good measure, I tossed in an if statement to save the document
when the currentLetter was at the halfway point through the
list (using the JustSave handler defined elsewhere).

Thanks!!!

Bill Planey


  • Prev by Date: Re: Choose a file dialog box?
  • Next by Date: Re: Two Questions
  • Previous by thread: Re: Repeat With question (newbie level)
  • Next by thread: Re: Re: Repeat With question (newbie level)
  • Index(es):
    • Date
    • Thread