Batch process (Illustrator CSII) stalls when opening certain document

I have an applescripted batch process (Illustrator CSII) which stalls when opening certain EPS files.

(Basically all I’m aiming to do is convert EPS files created in Illustrator v3 to v10 format with modified tiff previews.
There are 33,000 files to process (in small batches) so I could really do with automating the process!)

My script (below) works perfectly except for the occasional file which throws up the error message
“Can’t finish previewing. Not enough memory was available or an object was too complex.”

I suspect the error may be due to an unrecognized font. It’s certainly not due to a lack of memory, or for that matter an overly complex file (all the files are very simple images around 28 - 40KB). If I ‘okay’ the message, the script happily carries on with the rest of the files.

Is there a way I can prevent the message from interupting my script?

Thanks for your input :slight_smile:


tell application "Finder"
	set sourceFolder to choose folder with prompt "Select the folder containing files to be processed."
	set destFolder to choose folder with prompt "Select the destination folder."
	set fileList to every file of folder sourceFolder as alias list
	set fileCount to count folder sourceFolder
	if fileCount is not 0 then
		repeat with aFile in fileList
			set fName to name of aFile
			set newFilePath to destFolder & fName as string
			tell application "Adobe Illustrator"
				activate
				open aFile with options {update legacy text:true} without dialogs -- This intended to avoid the freeze experienced when processing files containing legacy text elements. 
				do script "EPS logos" from "Racing" without dialogs				save current document in file newFilePath as eps with options {class:EPS save options, compatibility:Illustrator 10, preview:transparent color TIFF, embed linked files:false, include document thumbnails:false, embed all fonts:false, CMYK PostScript:true, PostScript:level 2} with replacing 		   
				close current document saving no
			end tell
		end repeat
	end if
end tell

Model: G5
AppleScript: 1.10.3
Browser: Safari 417.9.2
Operating System: Mac OS X (10.4)

How about setting the “user interaction level”?


tell application "Finder"
	set sourceFolder to choose folder with prompt "Select the folder containing files to be processed."
	set destFolder to choose folder with prompt "Select the destination folder."
	set fileList to every file of folder sourceFolder as alias list
	set fileCount to count folder sourceFolder
	if fileCount is not 0 then
		repeat with aFile in fileList
			set fName to name of aFile
			set newFilePath to destFolder & fName as string
			tell application "Adobe Illustrator"
				activate
				set user interaction level to never interact --turns off the majority of dialogs
				open aFile with options {update legacy text:true} without dialogs
				do script "EPS logos" from "Racing" without dialogs
				save current document in file newFilePath as eps with options {class:EPS save options, compatibility:Illustrator 10, preview:transparent color TIFF, embed linked files:false, include document thumbnails:false, embed all fonts:false, CMYK PostScript:true, PostScript:level 2} with replacing
				close current document saving no
				set user interaction level to interact with all --should be turned back on before script exits...
			end tell
		end repeat
	end if
end tell

:smiley: Woohoo!!!
You beauty.
That works a treat.
No interruptions at all, and a perfect result.
Applescript’s great.
I owe you one.
Thanks.