Skip to main content
Known Participant
October 9, 2008
Question

[AS] How to disable crash log report

  • October 9, 2008
  • 5 replies
  • 3064 views
I have a big batch process running. If PS crashes, then I get a big message about sending a crash report to Adobe. How do I disable this warning? (Applescript)
This topic has been closed for replies.

5 replies

Known Participant
October 15, 2008
Hi X,
I wrapped the whole statement in try/on error. I also put a timeout of 600 seconds. So if after 600 seconds the file rasterize process hasn't occurred/error's out, a series of additional Try's happens. One will dismiss my AScript studio app's (potential) message about "connection is invalid", another will try to dismiss the ACR dialog, another will just try to send keystroke return to the front window of PS, if PS is still in the system events processes, which ought to dismiss any other message (I get one that says "an unrecoverable error occurred and PS will now quit"). Generally the dismissal of the ACR has to happen a little later since that takes several seconds to appear, I just recall the dismissal of that dialog a little later in my loop for good measure.
Looks like Mark's script is generally the sort of construct I have. Mine is structured a little different.
Known Participant
October 15, 2008
This would return me a text file of paragraphs with something like the following:

Untitled-1.jpg This document may be damaged (the file may be truncated or incomplete). Continue?
Known Participant
October 15, 2008
X, I don't know what AutoKey for the PC does my guess is that it is some sort of macro for providing a key stroke to dismiss the dialog? if this is the case then System Events in AppleScript can do this for you. I my case I also want a record (text file) of those images that were forced open so that they can be checked after the script has run its course. This does not take into account images that fail to open or crash the app.

property Error_Report : (path to desktop folder as Unicode text) & "Problem Image Report.txt"
property PS_Info : ""
--
set The_File to choose file
--
tell application "Adobe Photoshop CS2"
set notifiers enabled to false
set User_Rulers to ruler units of settings
set ruler units of settings to pixel units
set foreground color to {class:RGB color, red:0.0, green:0.0, blue:0.0}
set background color to {class:RGB color, red:255.0, green:255.0, blue:255.0}
set display dialogs to never
end tell
--
tell application "Adobe Photoshop CS2"
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 CS2"
keystroke return
end tell
my Problem_Images(The_File, PS_Info)
end tell
end try
set Doc_Ref to the current document
tell Doc_Ref
-- do your stuff here
end tell
end tell
--
on Check_For_Dialogs()
tell application "System Events"
if UI elements enabled then
tell window 1 of application process "Adobe Photoshop CS2"
if title = "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
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
Known Participant
October 14, 2008
Well FWIW, I think I have a solution that uses GUI scripting to send the escape key press to Adobe Crash Reporter app, or to return key to any other PS dialog box. Not the best solution but it seems to work for me.
Honestly I'm less concerned with what's crashing PS than to keep my process running. Users can fix bad files by hand but I have a mountainload of files to process and if my machines are left with dialog boxes hanging, then I'm losing productivity.
Known Participant
October 14, 2008
SuperMacGuy@adobeforums.com wrote:
> Well FWIW, I think I have a solution that uses GUI scripting to send the escape key press to Adobe Crash Reporter app, or to return key to any other PS dialog box.

Do you know if this will also work with the dialog that pops up when Ps tries to
read a corrupted image? It should be possible to make it throw an exception when
you try to open an image from a script, but it doesn't do that in all cases so
the script just freezes at this point. I've been able to take care of the
problem on the PC (AutoKey) but was never able to get anything working on the Mac.

-X
Known Participant
October 13, 2008
I would be more concerned with what is causing the crash of Photoshop? The only thing I could suggest without seeing your code is in side the loop for processing files call a system sub routine that uses system events to check and see if the Photoshop process is running if not then check for the dialog box dismiss it and re-activate the app. If you are using Photoshops internal batch function then I do not know how you could handle this.