Stepping through lines in a variable of text
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.