Hello world. I have been trolling around the tubes for weeks now trying to put together a script (bundled inside an automator application) that will help me sort, process and delete old TIFF files. My current workflow requires that I drop some files with “xxx, xxy, xxz” in the name on a photoshop droplet that creates a .JPG and then drop the rest on a droplet that saves a compressed .TIF. I started in Automator and was able to get the files sorted into new folders and begin processing but thats when things fell apart. Photoshop’s droplets and actions don’t return anything back to automator so I couldn’t get it to wait until the jpg side was done before it started the tif part of the process. I have backtracked so many times and tried different methods of processing (telling photoshop directly, telling automator to use droplet ‘x’ etc.) that my head is spinning and I’m running out of time to figure this out myself. Here’e my workflow, I hope someone has the time here to point me in the right direction:
drop folder containing “_xxx.TIF, _xxy.TIF, _xxz.TIF, _YY.TIF” onto app.
grab xxx, xxy, xxz - save as JPG with options {class:JPEG save options, embed color profile:false, format options:optimized, quality:12}
delete xxx, xxy, xxz.TIF
grab whats left - save as TIF with options {class:TIFF save options, embed color profile:true, image compression:LZW, byte order:IBM PC}
sorting into folders can happen before or after, though I think Automator will have an easier time with after. My biggest hurdle that I keep running into is getting the script to get the path of the “Input” variable in Automator and use it. I have tried
set filePath to POSIX path of the input
and then recalled filePath as the location to save but I think I am just too new at this to have the correct syntax etc. in place. The reason for this is the final Automator app needing to run on ANY folder on ANY computer so this becomes a “drag and drop” solution. I process hundreds of files a day and I hope to be able to dedicate machines across my network to just run this badboy for me and let me stick to shooting. My (broken) code:
on run {input, parameters}
set myFile to POSIX path of folder of the input as string
tell application "Finder"
set fl to input as alias list
repeat with f in fl
tell application "Adobe Photoshop CS6"
set myOptions to {class:JPEG save options, embed color profile:false, format options:optimized, quality:12}
open f
save current document in file myFile as JPEG with options myOptions appending no extension without copying
activate
end tell
end repeat
end tell
end run
Thanks in advance for any insight/time spent.