I have the script below that works, but most of the time it takes sooo long for the Finder to create the list of files to process. There are a lot of files to process, ~8,000 total. I was just running the script and after 15min of waiting for it to start the part in Photoshop, I force quit. To get these through I will split up the subfolders into smaller groups (less files per batch).
I’m wondering if there is a better way to code the script so that it does get so hung up. I know Applescript doesn’t have a For statement, but my logic is:
For each Tif files in all subfolders of Source folder
process in Photoshop
on run
set sourcePath to choose folder with prompt "Please select SOURCE folder:"
with timeout of 36000 seconds
tell application "Finder" to set fileList to (files of entire contents of sourcePath whose size > 1 and name ends with ".tif") as alias list
end timeout
tell application "Adobe Photoshop CS6"
activate
set possibleMode to {bitmap}
repeat with aFile in fileList
open file (aFile as string)
set theMode to mode of current document
--display dialog "Mode: " & theMode & "PossibleMode: " & possibleModes
if possibleMode does not contain theMode then
set myOptions to {class:TIFF save options, byte order:IBM PC, image compression:LZW}
save current document as TIFF in (aFile as string) with options myOptions appending lowercase extension with replacing
end if
close current document
end repeat
end tell
activate
display dialog "LZW Script is done"
end run