Skip to main content
April 22, 2009
Question

How to Suppress Warning Dialogs in Photoshop CS3

  • April 22, 2009
  • 1 reply
  • 5986 views

Hi All,

     I am automating photoshop to process image conversion(using python and appscript) and at times photoshop comes up with a "Warning Dialogs" for some images when trying to open. I tried to suppress this warning when opening a PDF file by using the options

PDF_open_options -- Settings related to opening a generic PDF document

suppress_warnings boolean -- supress any warnings that may occur during opening

Still Photoshop opens the warning dialogs.I want a solution so that I can manually or programatically(using appscript or python) make photoshop not to show any warning dialogs.

This topic has been closed for replies.

1 reply

Participating Frequently
May 9, 2009

Hi. Have a same problem. Have You a solution?

May 9, 2009

Yep hade a solution

You are welcome to try this for what its worth. It should do 2 things. First if there is a Photoshop "warning" record the info the dismiss the dialog proceed with file else record the "error" info kicked back to AppleScript but not process this file. This is a far as I got with this and you would be well advised to do some testing of your own. Requires Enable access for assistive devices this is in system prefs.

property Error_Report : (path to desktop folder as Unicode text) & "Problem Image Report.txt"

global PS_Info

set PS_Info to ""

--

set The_File to choose file

--

tell application "Adobe Photoshop CS3"

activate

try

with timeout of 2 seconds

open The_File

end timeout

on error

my Check_For_Dialogs()

tell application "System Events"

tell application process "Adobe Photoshop CS3"

keystroke return

end tell

my Problem_Images(The_File, PS_Info)

end tell

end try

if exists document 1 then

set Doc_Ref to the current document

tell Doc_Ref

-- do your stuff here

end tell

end if

end tell

--

on Check_For_Dialogs()

-- This should catch the text of a Photoshop warning dialog

try

tell application "System Events"

if UI elements enabled then

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

else

tell application "System Preferences"

activate

set current pane to pane "com.apple.preference.universalaccess"

display dialog "UI element scripting is not enabled. Check \"Enable access for assistive devices\""

end tell

end if

end tell

return PS_Info

-- This should catch an error kicked back to AppleScript

on error eM number eN

set PS_Info to "Error: " & eN & ". " & eM

return PS_Info

end try

end Check_For_Dialogs

--

on Problem_Images(The_File, PS_Info)

-- Whatever info about the file you want a record of…

set File_Name to name of (info for The_File)

-- String of records to write to "Problem Image Report" text file…

set The_Info to File_Name & tab & PS_Info & return

try

open for access file the Error_Report with write permission

write The_Info to file the Error_Report starting at eof

close access file the Error_Report

on error

close access file the Error_Report

end try

end Problem_Images

Writes out a report at desktop with info like:
11234567890 copy 3.tif Error: -2763. Cannot open the file because the open options are incorrect
hfgfhr.jpg This document may be damaged (the file may be truncated or incomplete).  Continue?

Participant
May 29, 2009

Thanks for that script Harold, its what I was looking for.  Do you know off hand how I can make that work with "on run argv"?  I need to use that exact script, but have the file name/path passed to it via an argument instead of selecting it manually.  I've been unsuccesful in editing what you posted to work this way.  Any help would be appreciated.

Regards,

Daniel