• 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
Stepping through lines in a variable of text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stepping through lines in a variable of text


  • Subject: Stepping through lines in a variable of text
  • From: email@hidden
  • Date: Fri, 30 Nov 2001 18:13:55 EST

I've got a script that reads through a file on the hard-drive, line-by-line:

repeat
set linetoread to read originalfile before return
-- do analysis of that line (linetoread) here
end repeat


I need to do the same thing, but reading line-by-line through a global
variable of text.

I'm guessing it would be something like:

repeat with x = 1 to the number of lines in textvariable
set linetoread to line x of textvariable
-- do analysis of that line (linetoread) here
end repeat

That's the way I'd do it in Macromedia Director-Lingo - - - how would I do
this in AppleScript? It doesn't appear to like the "repeat with x = 1" part.


  • Prev by Date: Re: Run Script upon Waking?
  • Next by Date: Re: Applescipt Studio? [OT - ribbing ahead]
  • Previous by thread: Re: Copy/Move a file in X
  • Next by thread: Re: Applescipt Studio? [OT - ribbing ahead]
  • Index(es):
    • Date
    • Thread