Dialog Removal Woes

I have an applescript, that opens numerous files from an input folder, does vaious things to them, makes me a thumbnail and a High res image.

The problem I’m having is that when a file has been corrupted durring the upload process I Photoshop CS gives me an message saying:

“This file may be damaged (the file may be truncated or incomplete) continue?”



tell application "Adobe Photoshop CS"
		set display dialogs to never
		close every document saving no
	end tell
	
	repeat with aFile in filesList
		try
			set fileIndex to 0
			tell application "Finder"
				set theFile to aFile as alias
				set theFileName to name of theFile
			end tell
			tell application "Adobe Photoshop CS"
				open theFile
				set docRef to the current document
				if (mode of docRef is not RGB) then
					change mode docRef to RGB
				end if
				--Do a bunch of other stuff thats not important on the forums
			end tell
		on error
			tell application "Finder"
				delete theFile
			end tell
		end try
		
	end repeat


This is a very automated proccess, I don’t want to have to constantly watch this.

When there is a problem with a file, I just want to trash it and move on. I want the applescript to click OK or shut off the message all together. Can anyone help me out?!?

I don’t have PS, but clearly it is PS that generates the modal dialog. I’ve handled that with other applications as follows:

if (name of window 1 is "dialog1") then tell application "System Events" to key code 76 -- dismiss the dialog

In your case, you’ll have to discover what the dialog is called if not “dialog 1”, and since key code 76 is “enter” that may not be what you want. You’ll have to find out how to interact with the button you want (which I’ve never seen).