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

Re: Stepping through lines in a variable of text


  • Subject: Re: Stepping through lines in a variable of text
  • From: Michelle Steiner <email@hidden>
  • Date: Sat, 1 Dec 2001 10:52:54 -0700

On 12/1/01 9:40 AM, Kai Edwards <email@hidden> wrote:

>So, while I'm sure someone will come up with a better suggestion, you could
>just try modifying your script to read something like this:
>
>set {TID, text item delimiters} to {text item delimiters, return}
>repeat with x from 1 to (count text items in textvariable)
> set linetoread to text item x of textvariable
> -- do analysis of that line (linetoread) here
>end repeat
>set text item delimiters to TID

set textvariable to ,
"this is line 1
this is line 2
this is line 3
this is line 4
this is line 5"

repeat with x from 1 to (count paragraphs of textvariable)
set linetoread to paragraph x of textvariable
--analysis here
end repeat

Alternatively,

set linestoread to paragraphs of textvariable
repeat with linetoread in linestoread
--analysis here
end repeat

--Michelle

----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------


  • Follow-Ups:
    • Re: Stepping through lines in a variable of text
      • From: Kai Edwards <email@hidden>
  • Prev by Date: Re: Dynamic Records?? (or other alternatives)
  • Next by Date: Re: Dynamic Records?? (or other alternatives)
  • Previous by thread: Re: Stepping through lines in a variable of text
  • Next by thread: Re: Stepping through lines in a variable of text
  • Index(es):
    • Date
    • Thread