File Path issue

I’ve got a script that looks at a specified folder and determines which files are larger than 1mb (they are TIFF files). It then opens each file that is 1mb or greater in Photoshop and saves it with LZW compression.

I just upgraded from Photoshop CS3 to CC and the script stopped working. I get this error on the line

open myFilePath

:

error “Adobe Photoshop CC got an error: File some object wasn’t found.” number -43

I threw in the line

display dialog "FilePath: " & myFilePath

just for debugging so I could see what the file path was.

ex.: FilePath: Macintosh HD:Users:dsuser:Desktop:TestLZW:araujo:00000025.tif

on run
	tell application "Finder"
		set sourcePath to choose folder with prompt "Please select SOURCE folder:"
		set savePath to choose folder with prompt "Please select DESTINATION folder:"
		set fileList to (files of entire contents of sourcePath whose size > 1.0E+6) as alias list
	end tell
	repeat until fileList = {}
		set myFilePath to item 1 of fileList as alias
				
		tell application "Adobe Photoshop CC"
			display dialog "FilePath: " & myFilePath
			open myFilePath
			save document 1 in myFilePath as TIFF with options {class:TIFF save options, byte order:IBM PC, image compression:LZW} appending lowercase extension
			
			close document 1
		end tell
		
		set fileList to rest of fileList
	end repeat
end run

Hi,

try to open the file as file specifier instead of an alias specifier


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.0E+6) as alias list

repeat with afile in fileList
	tell application "Adobe Photoshop CC"
		
		open file (afile as text)
		save document 1 in afile as TIFF with options {class:TIFF save options, byte order:IBM PC, image compression:LZW} appending lowercase extension
		close document 1
		
	end tell
end repeat



I’m getting an error with your suggested script at the save line.

error "Adobe Photoshop CC got an error: General Photoshop error occurred. This functionality may not be available in this version of Photoshop.

  • " number 8800

I don’t have CC, probably the terminology has changed.
Please read the AppleScript dictionary