Re: Documents conversion
Re: Documents conversion
- Subject: Re: Documents conversion
- From: "Marc K. Myers" <email@hidden>
- Date: Wed, 19 Dec 2001 17:57:23 -0500
- Organization: [very little]
>
From: "Fred Fred" <email@hidden>
>
To: email@hidden
>
Date: Wed, 19 Dec 2001 16:29:23 +0800
>
Subject: Documents conversion
>
>
Hi every one,
>
>
First, i'm french , so excuse my poor
>
english ;-)
>
>
Here is my problem :
>
>
I need to convert thousands of documents.
>
>
I have built a script which tell AppleWorks to
>
open a forder and convert the files inside
>
and save them into another folder. This
>
works great !
>
>
But I don't know how to scan every
>
sub-folders in the main folder ( 5 or 6
>
folders inside each other )...
>
>
Does anyone have an example to provide ?
>
>
Thanks in advance, Fred
Your English is perfect. Far better than my French.
This solution uses the "the entries in" command from the Akua Sweets
scripting addition to mine the nested folders as far down as they go.
It's set up to process only a hundred files in each pass to avoid the
memory problems you might have with a list of aliases for thousands of
files. You'll need to set the two properties for the type of file
you'll be seaking. I have them set for AppleWorks word processing documents.
property fileType : "CWWP"
property fileCreator : "BOBO"
set masterFldr to (choose folder with prompt "Select a folder to process:")
set startPt to 100
set procList to {"X"}
repeat until procList is {}
set procList to the entries in masterFldr from {startPt, 100} [optn-L]
whose types are in {fileType} [optn-L]
whose creators are in {fileCreator} [optn-L]
whose kinds are file [optn-L]
to a depth of -1 as alias
repeat with aFile in fileList
-- do what you do with a file
end repeat
set startPt to startPt + 100
end repeat
Note that "[optn-L]" replaces the AppleScript continuation character
which isn't displayed properly in this mail list.
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[12/19/01 5:56:58 PM]