Photoshop error trapping

Hello all.
Does anyone have a suggestion for error trapping the open command in Photoshop? I am using OS 10.2.8 and Photoshop 7.0.1. If the process encounters a corrupt JPEG file, it is stopped with a dialog box stating the file is corrupt and the user must click “Cancel” or “OK”. I am using the try…on error, it works but the dialog box must be answered. How do I get around this?

According to the Photoshop dictionary, you can include this parameter with the open command:

[showing dialogs always/error dialogs/never]

I can’t offer specific code because I don’t have Photoshop (I checked the PDF version of the dictionary).

– Rob

Can’t figure out syntax. Adobe documentation says, “display dialogs” instead of “showing dialogs”.

It might go something like this.

tell application "Photoshop"
	open alias "path:to:file" showing dialogs never
end tell

-- OR

tell application "Photoshop"
	open alias "path:to:file" displaying dialogs never
end tell

– Rob

This works in PS 7:

Jon


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

Still not working. Photoshop still displays the dialog box. Any other suggestions?

Here is my code:
tell application “Adobe Photoshop 7.0”
activate
set err_flag to “true”
set file_type to (file creator of (info for (alias file_name)))
if file_type is equal to “ART3” or file_type is equal to “ART5” or file_type is equal to “ARTZ” then
try
open alias file_name(constrain proportions = true, mode = CMYK, resolution = 300, use antialias = true)
on error
set err_flag to “false”
set move_source_destination to “/Volumes/Firewire 75000/delivery/” & folder_name & “/high/” & this_file
set move_target_destination to “/Volumes/Firewire 75000/z_corrupt/”
do shell script “mv " & “”” & move_source_destination & “” “” & move_target_destination & “”"
end try
else
try
open alias file_name showing dialogs never
on error errMsg number errNum
display dialog errMsg & errNum
set err_flag to “false”
set move_source_destination to “/Volumes/Firewire 75000/delivery/” & folder_name & “/high/” & this_file
set move_target_destination to “/Volumes/Firewire 75000/z_corrupt/”
do shell script “mv " & “”” & move_source_destination & “” “” & move_target_destination & “”"
end try
end if

You don’t show where you define the variables you are using and that may make a difference. Still, this should get you going:

Jon


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]