Hello all…
This script works as is, but would like it to do more… it’s simply a script to open Photoshop files in Photoshop CS2, do some stuff and save to a prexisting folder. I’ve reduced as much as possible to the point that it still works. The final saves out 4 versions of the file to different folders, but I should be able to take the single answer and repeat it for the other saves that I left out.
What I want… when I save to the ‘alphabetical’ subfolder, if that file already exists, it overwrites the file. I can’t have that! I’d like it to make a folder named “Duplicates” in the parent folder and save in there; I can even have the folder “Duplicates” there ahead of time because the folders are stationary.
Also, is it odd the way I have the files saving to the appropriate subfolders? the parent folder has 36 subfolders (0-9 and A-Z) and the file is suppose to save to the corresponding subfolder determined by the first letter in the name of the file.
set inputFolder to choose folder
tell application "Finder"
activate
set filesList to files in inputFolder
end tell
tell application "Adobe Photoshop CS2"
set display dialogs to never
end tell
repeat with aFile in filesList
tell application "Finder"
set theFile to aFile as alias
set theFileName to name of theFile
set alphabetical to ""
set alphabetical to the first character of theFileName
set outputfolder4 to folder alphabetical of folder "BAMPF" of folder "Desktop" of folder "work" of folder "Users" of startup disk
end tell
tell application "Adobe Photoshop CS2"
activate
open theFile
set docRef to the current document
set docHeight to height of docRef
set docWidth to width of docRef
set myOptions2 to {class:JPEG save options, embed color profile:false, format options:standard, quality:6, scans:3}
set docName to name of docRef
set newFileName4 to (outputfolder4 as string) & docName
-- Photoshop stuff
if (mode of docRef is not grayscale) then change mode docRef to grayscale
save docRef in file newFileName4 as JPEG with options myOptions2 appending lowercase extension with copying
close docRef without saving
end tell
end repeat
I suppose one more question: I find it odd I go from Finder, to Photoshop, to Finder and again to Photoshop… think I can eliminate or move around some of my steps?
Thanks in advance for any help!!