Re: Final Reality Check (Was... I lost count)
Re: Final Reality Check (Was... I lost count)
- Subject: Re: Final Reality Check (Was... I lost count)
- From: "Marc K. Myers" <email@hidden>
- Date: Fri, 07 Sep 2001 11:23:55 -0400
- Organization: [very little]
email@hidden wrote:
>
tell application "Finder"
>
activate
>
select every item of container window of folder "FilesToConvert"
>
open selection
>
tell application "PmScript" -- The app that runs scripts in PM
>
run script "PrintToPSFile"
>
end tell
>
end tell
I'd do it this way:
tell application "Finder"
set fileList to files of folder "FilesToConvert"
repeat with aFile in fileList
open (contents of aFile)
tell application "PmScript" -- The app that runs scripts in PM
run script "PrintToPSFile"
end tell
end repeat
end tell
This avoids opening all the files at the same time. It opens each one
consecutively and initiates your PM script for the one that's open. I'm
assuming that your PM script will close the files when it is done with them.
I know nothing about PM. Specifically, I don't have any idea how your
PM script is going to know what files to process. Does it simply
process whatever is open?
>
2. I need to have the script(s) loop (I think) through the folder until
>
all files have been converted.
>
>
3. Finder script seems to find the PM script, but I get an error "Apple
>
Event Timed Out" with the line: run script "PrintToPSFile" hi-lited.
This should answer points 2 & 3. The timeout occurs when AS has to wait
more than 60 seconds for an app to tell it that it has completed its
task. By processing one file at a time you should be within that
margin. If not, you can reset the timeout limit.
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[9/7/01 11:14:29 AM]