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