Hey all,
I work in a graphic related environment, and produce quite an amount of graphic files per week. For compatibility reasons, I save both Illustrator and Photoshop files in EPS format, but, to do a more efficient backup, resave them to .AI and (compressed) .EPS format every friday. This is, you can imagine quite a tedious task.
I’m a complete rookie when it comes to scripting, but I tried to write a script that would automate this task, saving me both time and patience, yet, it turns out, I messed up somewhere.
If it’s not much of a problem, I would like to post the code, and the error message I get, this is as far as I got, this is where I’m stuck, this is, where the frustration of an ignorant comes to new heights.
The second thing I wanted to know (if anyone can help me out), is how to make this script work, not only with the chosen folder, but with every subfolder within.
Anyways, here’s the error message:
- Can’t make alias “Bigfoot Main:Users:giga:Desktop:ot 16932:Lf-vmol-95x90 x1.eps” into a «class alst». (that’s one file where it doesn’t work)
Note: The odd thing is, it works just fine with some files. And I have no clue why.
Here’s the code, as far as I got:
on SaveFilesAsPhotoshopCS2(fileListA, sourceFolder)
set destPath to sourceFolder as string
repeat with aFile in fileListA
tell application "Finder" to set fileName to name of aFile
set newFilePath to destPath & fileName
tell application "Adobe Photoshop CS2"
open aFile
save current document in file newFilePath as Photoshop EPS ¬
with options {class:EPS save options, encoding:high quality JPEG, preview type:eight bit TIFF, transparent whites:false, vector data:false}
close current document saving no
end tell
end repeat
end SaveFilesAsPhotoshopCS2
on SaveFilesAsIllustratorCS2(fileListB, sourceFolder)
set destPath to sourceFolder as string
repeat with aFile in fileListB
tell application "Finder" to set fileName to name of aFile
set newFilePath to destPath & fileName
tell application "Adobe Illustrator"
open aFile
save current document in file newFilePath as Illustrator ¬
with options {class:Illustrator save options, PDF compatible:false}
close current document saving no
end tell
end repeat
end SaveFilesAsIllustratorCS2
--Call Handler
set sourceFolder to choose folder with prompt "Source Folder?"
tell application "Finder"
set fileListA to (every file of sourceFolder whose file type is "EPSF" and creator type is "8BIM") as alias list
set fileListB to (every file of sourceFolder whose file type is "EPSF" and creator type is "ART5") as alias list
end tell
SaveFilesAsPhotoshopCS2(fileListA, sourceFolder)
SaveFilesAsIllustratorCS2(fileListB, sourceFolder)
tell application "Finder"
delete (every file of sourceFolder whose file type is "EPSF" and creator type is "ART5")
end tell
that’s it. First script. It’s ok, you can laugh. But please, help, help, help. I really would like to see this working.
Thanks a lot for your time and patience
Pat aka Klayman
PD: I hope i got it right this time.
Model: G4 460
Browser: Safari 312.6
Operating System: Mac OS X (10.3.9)