I’m trying to process folders full of TIFF files. Some are bitmap, color or grayscale. I don’t want to process the bitmap files and am trying to test the color mode and if they are bitmap, just close the file and move on to the next one.
I don’t think I have the syntax correct on my if statement because the script is processing all files.
on run
with timeout of 36000 seconds
set sourcePath to choose folder with prompt "Please select SOURCE folder:"
tell application "Finder" to set fileList to (files of entire contents of sourcePath whose size > 1 and name ends with ".tif") as alias list
repeat with aFile in fileList
tell application "Adobe Photoshop CS6"
activate
open file (aFile as string)
set theMode to mode of current document
set possibleModes to {"bitmap"}
if possibleModes is theMode then
close current document
else
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
close current document
end if
end tell
end repeat
end timeout
activate
display dialog "LZW Script is done"
end run