Ryo14, I see no reason why this whole process can’t be handled in one complete script. It requires a few repeat loops but all pretty standard to what I have in some of mine. A few more questions your origianal .ai files is that the names and stacking order top to bottom of the layers for all files? if so this should make things a bit easier to process. What are the sizes of your colour GIF’s large & small in pixels height & width. I have yet to have a problem with fonts if they are open for illustrator to use in the file then embedding them in the .eps should work fine. Do you mind if we try this first? Heres what I have so far just needs a bit of fine tuning.
set inputFolder to choose folder with prompt "Where is folder the Temp."
tell application "Finder"
set filesListA to files in inputFolder
set MyFolderA to make new folder at inputFolder with properties ¬
{name:"Colour Illustrator EPS"}
set MyFolderB to make new folder at inputFolder with properties ¬
{name:"Mono Illustrator EPS"}
set MyFolderC to make new folder at inputFolder with properties ¬
{name:"Photoshop Mono JPEG"}
set MyFolderD to make new folder at inputFolder with properties ¬
{name:"Photoshop Large GIF"}
set MyFolderE to make new folder at inputFolder with properties ¬
{name:"Photoshop Small GIF"}
end tell
repeat with aFile in filesListA
set fileIndex to 0
tell application "Finder"
set theFile to aFile as alias
end tell
tell application "Illustrator CS"
activate
open theFile with options {update legacy text:true} without dialogs --You may want to set to {update legacy text:false}
set docRef to the current document
tell the current document
do script "Delete Unused Palette Items" from "Default Actions" without dialogs
do script "Delete Unused Palette Items" from "Default Actions" without dialogs
-- The two lines above clean out all the rubbish from the palettes don't ask why it needs to run twice I have no idea.
-- We need to delete the layers A & B here
set docName to name of docRef
set docBaseName to getBaseName(docName) of me
set newFileName to (MyFolderA as string) & docBaseName & "_Colour" & ".eps"
end tell
save docRef in file newFileName as eps with options ¬
{class:EPS save options, preview:color Macintosh, overprint:discard, embed all fonts:true, embed linked files:true, include document thumbnails:true, compatible gradient printing:false, CMYK PostScript:true, PostScript:level 2}
close current document without saving
end tell
end repeat
repeat with aFile in filesListA
set fileIndex to 0
tell application "Finder"
set theFile to aFile as alias
end tell
tell application "Illustrator CS"
activate
open theFile with options {update legacy text:true} without dialogs --You may want to set to {update legacy text:false}
set docRef to the current document
tell the current document
do script "Delete Unused Palette Items" from "Default Actions" without dialogs
do script "Delete Unused Palette Items" from "Default Actions" without dialogs
-- Dito here.
-- We need to delete the layers A & C here
set docName to name of docRef
set docBaseName to getBaseName(docName) of me
set newFileName to (MyFolderB as string) & docBaseName & "_Mono" & ".eps"
end tell
save docRef in file newFileName as eps with options ¬
{class:EPS save options, preview:color Macintosh, overprint:discard, embed all fonts:true, embed linked files:true, include document thumbnails:true, compatible gradient printing:false, CMYK PostScript:true, PostScript:level 2}
close current document without saving
end tell
end repeat
tell application "Finder"
set filesListB to files in MyFolderB
end tell
tell application "Adobe Photoshop CS"
set display dialogs to never
close every document saving no
end tell
repeat with aFile in filesListB
set fileIndex to 0
tell application "Finder"
set theFile to aFile as alias
end tell
tell application "Adobe Photoshop CS"
set ruler units of settings to pixel units
set background color to {class:RGB color, red:255, green:255, blue:255}
open theFile as EPS with options ¬
{class:EPS open options, mode:grayscale, resolution:300, use antialias:true, constrain proportions:true}
set docRef to the current document
tell the current document
set docName to name of docRef
set docBaseName to getBaseName(docName) of me
set newFileName to (MyFolderC as string) & docBaseName
end tell
save docRef in file newFileName as JPEG with options ¬
{embed color profile:false, quality:9} appending lowercase extension with copying
close current document without saving
end tell
end repeat
tell application "Finder"
set filesListC to files in MyFolderA
end tell
tell application "Adobe Photoshop CS"
set display dialogs to never
close every document saving no
end tell
repeat with aFile in filesListC
set fileIndex to 0
tell application "Finder"
set theFile to aFile as alias
end tell
tell application "Adobe Photoshop CS"
set ruler units of settings to pixel units
set background color to {class:RGB color, red:255, green:255, blue:255}
open theFile as EPS with options ¬
{class:EPS open options, mode:RGB, resolution:72, use antialias:true, constrain proportions:true}
set docRef to the current document
tell the current document
flatten
set docName to name of docRef
set docBaseName to getBaseName(docName) of me
set newFileName to (MyFolderD as string) & docBaseName & "_LG"
end tell
save docRef in file newFileName as CompuServe GIF with options ¬
{colors in palette:256, dither:none, forced colors:web, matte:none, palette:local selective, preserve exact colors:false, transparency:true} appending lowercase extension with copying
tell the current document
resize image height 200 resolution 72 resample method bicubic sharper -- This will be to your choice
end tell
set newFileName to (MyFolderE as string) & docBaseName & "_SM"
save docRef in file newFileName as CompuServe GIF with options ¬
{colors in palette:256, dither:none, forced colors:web, matte:none, palette:local selective, preserve exact colors:false, transparency:true} appending lowercase extension with copying
close current document without saving
end tell
end repeat
-- Returns the document name without extension (if present)
on getBaseName(fName)
set baseName to fName
repeat with idx from 1 to (length of fName)
if (item idx of fName = ".") then
set baseName to (items 1 thru (idx - 1) of fName) as string
exit repeat
end if
end repeat
return baseName
end getBaseName