Re: Stepping through lines in a variable of text
Re: Stepping through lines in a variable of text
- Subject: Re: Stepping through lines in a variable of text
- From: Andy Wylie <email@hidden>
- Date: Sat, 01 Dec 2001 13:33:35 +1300
on 1/12/01 12:13 PM, email@hidden at email@hidden wrote:
>
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.
set textvariable to "I am
the line to read
of text variable"
set AppleScript's text item delimiters to return
set lineStringList to text items of textvariable
set AppleScript's text item delimiters to ""
repeat with i in lineStringList
display dialog i
end repeat
_____________________________ Andy