Re: Getting count of paragraphs in Scriptable Text Editor
Re: Getting count of paragraphs in Scriptable Text Editor
- Subject: Re: Getting count of paragraphs in Scriptable Text Editor
- From: Michelle Steiner <email@hidden>
- Date: Thu, 14 Jun 2001 12:58:02 -0700
On 6/14/01 8:44 AM, Michelle Steiner <email@hidden> wrote:
>
set theFile to (choose file with prompt "Locate file 'Try List'") as alias
>
set foo to read theFile
>
set {tid, text item delimiters} to {text item delimiters, return}
>
set numOfParas to count text items of foo
>
set text item delimiters to tid
>
numOfParas
Doh. Sometimes I don't see the forest for the trees.
set numOfParas to count paragraphs of foo
or even better:
set numofparas to count paragraphs of (read theFile)
Then there's no reason to mess with TIDs.
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------