My problem i’ve decided to utilise a Dual 1.8Ghz PowerPC G5 mac running 10.5.4, this mac will be the centre for converting RGB TIFFs to CMYK EPSs and applying a profile mainly done by the Photoshop action (the TIFFs can be as little as 10mb and as large as 70mb) and saving them to a directory on a SGI running RedHat.
The files will be from some 6 to 8 other macs using airport (not the fastest way to transfer 2gb of photography) to transfer/copy to a shared folder on the G5 mac that has the script below attached as a folder action (thanks to a post i found on this site). The script works well and as you can see i’ve added two delays, the reason is files could still be in the process of being copied to the folder while Photoshop converts and saves, without the delays photoshop “catches up” with the copied files and tries to open a file still in the process of being copied and there the process ends.
Now the the crux of the problem, does applescript have a smarter way than the delay to wait till all files are copied ie “before opening each file check there is an EOF” or “the folder is still receiving file(s) i’ll wait till i’m no longer receiving file(s)”
I’d like to add that I am new to applescript and scripting in general and to this site but not to workflows as most of my work is done using Dalims Twist (hence the SGI running redhat), before the questions start Twist can do alot but it lacks the finesse of Photoshop to convert RGB to CMYK, Photoshop does a better job, the files are from a remote photographic studio using a 10mb link in to our network.
This is probably one of the longest posts for such a small script and I apologise beforehand.
on adding folder items to this_folder after receiving added_items
delay 30
set destinationFolder to ("Macintosh HD:Users:mymac:Desktop:test")
repeat with oneItem in added_items
try
do_PS_action(oneItem, (destinationFolder & name of (info for oneItem)))
end try
end repeat
tell application "Finder" to delete added_items
end adding folder items to
on do_PS_action(I, N)
delay 30
tell application "Adobe Photoshop CS3"
do action "tiff to eps" from "convert.atn"
save current document in file N
close current document saving no
end tell
end do_PS_action