Re: Process all files in a text list!
Re: Process all files in a text list!
- Subject: Re: Process all files in a text list!
- From: "Marc K. Myers" <email@hidden>
- Date: Wed, 29 Aug 2001 14:37:52 -0400
- Organization: [very little]
>
Date: Wed, 29 Aug 2001 07:54:41 -0600
>
Subject: Process all files in a text list!
>
From: Rachel <email@hidden>
>
To: <email@hidden>
>
>
Here is the result that worked. Thanks Marc for the tip on "paragraph" vs
>
"line".
>
set currFolder to "FolderLocation:"
>
set fileList to (currFolder & "FileNameTextList")
>
***
>
tell application "Tex-Edit Plus"
>
open fileList
>
repeat with i from 1 to (count lines of window 1)
>
open (currFolder & (paragraph i of window 1))
>
--do various scripts
>
close front window saving yes
>
end repeat
>
close window 1 saving no
>
***
>
My question would be: If one refers to a sentence as a paragraph, then how
>
does one refer to a paragraph?(in case I want to select paragraphs)
>
>
Michelle:
>
I tried the statements you suggested and they run-time errored. Don't know
>
why.
>
>
Entity Marc K. Myers spoke thus:
>
>
> Your script would work pretty much as-is if you would refer to
>
> paragraphs instead of lines in TE+. When you refer to lines what you
>
> get includes the carriage return at the end of the line, which messes up
>
> your file names since they don't really end in carriage returns. When
>
> you refer to paragraphs you'll get only the characters before the
>
> carriage return.
As far as TE+ is concerned, a paragraph is any group of characters that
ends with a carriage return. TE+ doesn't recognize the concept of a
sentence at all. If you need to refer to a group of paragraphs and
return a list with a paragraph in each item you'd say "paragraphs of
window 1" or "paragraphs 1 thru 3 of window 1". If you want all the
contents of a series of paragraphs as a single block of text you'd say
"text from paragraph 1 to paragraph 3 of window 1".
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[8/29/01 2:35:18 PM]