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: Tue, 28 Aug 2001 12:54:16 -0400
- Organization: [very little]
>
Date: Tue, 28 Aug 2001 07:54:19 -0600
>
Subject: Process all files in a text list?
>
From: Rachel <email@hidden>
>
To: AppleScript List <email@hidden>
>
>
What is the best way to run a script on every file in a text list then save
>
that file?
>
Is there a way to "open a folder as default folder" and then every file
>
opened would be relative to that folder?
>
This is what I cobbled together, but I don't know how to manage the 2 open
>
windows or how to assemble the filename string.
>
>
set currFolder to "Rachel:Project:Dreams:"
>
tell application "Tex-Edit Plus"
>
activate
>
open file (currFolder & "DreamList")
>
repeat with i from (count lines of window 1) to 1 by -1 -- process
>
backwards thru filenames
>
open (currFolder & (line i of window 1))
>
--do scripts
>
close front window saving yes
>
end repeat
>
end tell
>
>
Problem being that it opens 33 "untitled "windows.
>
>
Thanks for any help
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.
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[8/28/01 12:45:53 PM]