Overwrite Original

Is there a way when creating a file list with finder to set the files allow overwriting the orginal? Here is a sample that only opens photoshop EPS files. I can create a new folder and save into that location easy enough.

set inputFolder to choose folder with prompt "Where's the folder?"
tell application "Finder"
	set filesList to (files of inputFolder whose file type is "EPSF" and creator type is "8BIM")
	set outputFolder to make new folder at inputFolder with properties {name:"TIFF Preview"}
end tell
repeat with aFile in filesList
	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"
		set display dialogs to never
		open theFile
		save current document in file (outputFolder as string) as Photoshop EPS with options ¬
			{embed color profile:false, encoding:binary, preview type:eight bit TIFF}
		close current document
	end tell
end repeat

What I can’t do is this

set inputFolder to choose folder with prompt "Where's the folder?"
tell application "Finder"
	set filesList to (files of inputFolder whose file type is "EPSF" and creator type is "8BIM")
end tell
repeat with aFile in filesList
	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"
		set display dialogs to never
		open theFile
		save current document in file theFile as Photoshop EPS with options ¬
			{embed color profile:false, encoding:binary, preview type:eight bit TIFF}
		close current document
	end tell
end repeat

doing this manually I would need to say its OK to overwrite the original. Is this possible? Hope i’ve explained myself clearly enough!

I don’t have Photoshop, but if the default for the dialog is “OK”, you might try

ignoring applicaton responses
– do stuff
end ignoring

That may well just hang. If it does, see if you can use System Events to keystroke return (assuming that will dismiss the box).

Found where my problems lay in the second example theFile is a alias of aFile if I change the save to (aFile as text) or (aFile as string) it works fine. In photoshop in both cases “set display dialogs to never” was on. Appears my problem was nothing more than a noobie error. sorry for any inconvenience caused folks especially adam. This now works

set inputFolder to choose folder with prompt "Where's the folder?"
tell application "Finder"
	set filesList to (files of inputFolder whose file type is "EPSF" and creator type is "8BIM")
end tell
repeat with aFile in filesList
	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"
		set display dialogs to never
		open theFile
		save current document in file (aFile as string) as Photoshop EPS with options ¬
			{class:EPS save options, embed color profile:false, encoding:binary, preview type:eight bit TIFF}
		close current document
	end tell
end repeat

had also missed “class:EPS save options,” in the save options tut tut.