Batch Process Skipping files?

yo-

I have a droplet that takes my ai files and converts them to jpgs. Problem is that it has been randomly skipping files when I drag a group of files to the droplet. Is this a common problem? Is there a solution? Here is the code that selects the file(s).

Also when it creates a list of the files you have selected how does it process them, I mean does it process tham randomly or does it process them by their names, modification date, size, etc? Thanks


on open theFiles
	processfiles(theFiles)
end open
--if dropped then this is skipped
on run
	choose file with prompt "Hold cmd or shift for Multiple Selections" with multiple selections allowed without invisibles
	processfiles(result)
end run

on processfiles(theFiles)
	--choose where to save your eps files
	set theChoice to choose folder with prompt "Choose jpg file destination." without invisibles
	set choicePath to theChoice as string
	--create a list of the files you are going to process
	set theFiles to theFiles as list
	repeat with aFile in theFiles
		set aFile to aFile as alias
		set dropPath to choicePath
		set dupNames to {}
		set moveToPath to dropPath
		set modTime to (current date) as string
		
		--open illustrator and begin eps conversion
		tell application "Illustrator CS"
			activate
			set theImage to open aFile --open and process one of the files
			set thisDoc to current document

PROCESS OF CONVERSION BEGINS HERE....

I’ve seen several discussion of this problem (skipped files) when the Finder didn’t catch them all for the Folder Action. I think the solution was to drop them in a folder and process that.

On the second issue, in another thread (not here), the answer to that was indeterminate - nobody seemed to devise a test that would reveal just how the Folder Action decided the order of processing.