Problem with a window in photoshop...

Basically I have 600 autocad DWG files that have to be converted into a 40x40 thumbnail jpg… so what Im doing is converting them to an *.ai file in illustrator and then opening photoshop and converting the ai files to jpegs and shrinking them. however my problem comes in when I open the file in photoshop, I have to click OK to tell it what size i want it to open as and I cant figure out how to get around it… if anyone could help htat would be much appreciated. here is my code

with timeout of 36000 seconds
	set sourceFolder to choose folder with prompt "Source folder?"
	tell application "Finder" to set fileList to every file of folder sourceFolder as alias list
	
	set destinationFolder to choose folder with prompt "Destination folder?"
	set destinationPath to destinationFolder as string
	
	
	repeat with aFile in fileList
		tell application "Finder" to set fileName to name of aFile
		set newFilePath to destinationPath & fileName
		
		tell application "Illustrator CS"
			activate
			open aFile without dialogs
			if window 
			save current document in newFilePath as Illustrator
			close current document saving no
			
		end tell
		
		
	end repeat
	
	
	tell application "Finder" to set fileList2 to every file of folder destinationPath as alias list
	
	repeat with bfile in fileList2
		tell application "Finder" to set fileName2 to name of bfile
		set newFilePath2 to destinationPath & fileName2
		tell application "Adobe Photoshop CS"
			activate
			open bfile without dialogs
			if (mode of current document is not RGB) then change mode of current document to RGB
			save current document in newFilePath2 as JPEG with options {class:JPEG save options, quality:12}
			close current document saving no
		end tell
		
	end repeat
	
end timeout

That I know of, there’s no way you can open Illustrator files into Photoshop without a dialog. Instead of saving native Illustrator files, can you export from Illustrator as another file format (eps, tiff, pdf, etc…)? I’m not familiar with scripting Illustrator, but if you choose a different file format, you can easily script Photoshop to open them without a dialog.

Carl.

I know Im always going to get the dialog but I just need help on saying ‘ok’ to it so I dont have to hit it 600 times…

Well, my suggestion was to rethink your workflow, so you won’t get a dialog in the first place.

well I tried making it so I could export it as a gif but it wouldnt let me use export. I had to use ai

Can’t get current document of “G5:Users:alink:Desktop:untitled folder:new:addition outline copy.dwg”. it stops at the export line and gives me that error…as if it was trying to import instead of export

export current document in newFilePath as GIF

besides I still need help with pushing the button as it asks me a Q about how big I hsould open the DWG in illustrator (orig. size, fit artboard, or a %) so I still need help with that…