Skipping warnings when opening images in Adobe Photoshop

Yesterday I came across a problem where the Photoshop warning shown below often caused an automated image workflow to stop.

The warning only appears with a small amount of our images. Unfortunately it cannot be suppressed by using the «set display dialog to never» command.

But as the workflow needs to run continuously without any user interaction, we urgently needed a solution for this problem. And that is how we now skip the warnings:


on run
	tell application "AppleScript Utility"
		set GUI Scripting enabled to true
	end tell
	
	set imgfilepath to "Macintosh HD:Users:martin:Desktop:0907092015033031.jpg"
	
	tell application "Adobe Photoshop CS"
		activate
		ignoring application responses
			open (imgfilepath as alias)
		end ignoring
		-- the delay might need to be adjusted depending on the
		-- image size
		delay 4
		my hitenter()
	end tell
end run

on hitenter()
	tell application "System Events"
		key code 36
	end tell
end hitenter

Maybe someone else can also make good use of it :slight_smile:

Happy Scripting!

Martin, I have been using a very similar approach for some time now. However with an unwatched batch scripts you may want to record the data of damaged files that were forced to open with the ‘return keystroke’ have system events do this.

tell window 1 of application process "Adobe Photoshop CS2"
if title contains "Adobe Photoshop" then set PS_Info to value of static text 2
end tell

Then write the File’s name & tab & PS_Info out to a text file