Hello there -
I’ve got a script working that I would like to take the current file, append the file name with “_cckp_lay”, save it with this name as a Photoshop file then remove the ‘’_lay" and save it as an EPS.
I would prefer it to save to the same folder too but haven’t unearthed the obvious solution to that yet.
Here’s what I have so far:
tell application “Adobe Photoshop CS”
activate
set currDoc to current document
set fileName to ((name of currDoc) as string)
set newAppend to (“_cckp_lay” as string)
set newFileName to ((characters -5 through 1 of fileName) as string)
set EPSOptions to {class:EPS save options, embed color profile:true}
–check to see if file has already been saved with appendage
if last character of fileName is “y” then
save currDoc in (choose folder) as Photoshop format
save currDoc in (choose folder) as Photoshop EPS with options EPSOptions appending no extension without copying
else
save currDoc in (choose folder) as Photoshop EPS with options EPSOptions appending no extension without copying
end if
end tell
This should do more or less what you were after, you did not say if the originals were to be kept or not so this leaves as is.
set inputFolder to choose folder with prompt "Where are the files."
tell application "Finder"
set filesList to files in inputFolder
end tell
repeat with aFile in filesList
set fileIndex to 0
tell application "Finder"
set theFile to aFile as alias
end tell
tell application "Adobe Photoshop CS"
set display dialogs to never
close every document saving no
open theFile
set docRef to the current document
-- your stuff here
tell docRef
set docName to name of docRef
set docBaseName to getBaseName(docName) of me
set newFileName to (inputFolder as string) & docBaseName & "_cckp_lay"
end tell
save docRef in file newFileName as Photoshop format with options {embed color profile:true, save alpha channels:true, save layers:true, save spot colors:true} appending lowercase extension with copying
set newFileName to (inputFolder as string) & docBaseName & "_cckp"
save docRef in file newFileName as Photoshop EPS with options {embed color profile:true, encoding:binary, preview type:eight bit TIFF, vector data:true} appending lowercase extension with copying
close current document without saving
end tell
end repeat
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
I am writing a script which will provide two fucntions:
set 'Path 1" to clipping path for a large batch of files, and
resave the files as EPS (they are currently EPS) with the following options
a) encoding: medium quality, and b) preview type: eight bit Mac OS…
a simplified version follows:
tell application “Adobe Photoshop CS2”
set fileName to name of document 1
set folderPath to path to desktop folder as string
set filePath to folderPath & fileName as string
make clipping path path item 1 of document 1 flatness 7
save document 1 in file filePath as Photoshop EPS with options {encoding:medium quality JPEG, preview type:eight bit Mac OS}
close document 1
end tell
…the clipping path conversion works fine, but it saves all files as default encoding and default preview type (monochrome tiff, and binary respectively)…
it is clear to me that i am doing something wrong – but i can’t figure out what it is…
that is exactly right… funny, i got to there yesterday, but realize i have a somewhat different problem… can i ‘get’ the encoding before saving?
what i want to do is check to see how a file is currently encoded, and if it is maximum quality jpeg to save it with that encoding, and otherwise save it as medium quality…
i can’t seem to be able to get the current encoding tho…