Folder Action issue

I currently have a workflow that works like this:

A droplet will take any number of files, determine their type, open them in Illustrator CS or Photoshop CS (whichever is appropriate to the filetype) and save them as a JPEG named and numbered according to their associated job number. Then:

The “Thumbnails” folder they are saved into has a folder action that will move the JPEGs to our server and add the filepaths to our FileMaker database (linking each to its appropriate job).

Everything works as explained when I manually drop the JPEG files into the folder all at once, or when my droplet saves them there one at a time, but spaced out over time by a few seconds. My issue occurs when my droplet adds the JPEG files into the folder one at a time to quickly. Some of the files seem to be forgotten or overlooked.

Does anyone expereince similar folder action issues?

Thanks in advance for any comments & suggestions,
jON bEEBE

I don’t know how the Folder Actions system distinguishes between a single drop of several items and several individual drops. But once an ‘on adding folder items to’ script starts to process a drop, any later arrivals will retrigger the action. As far as I can make out, the system can handle a small number of overlapping or queued actions, but will abandon actions in progress if there get to be too many.

I’ve just been experimenting with 206 files and a droplet that moves them into a “watched” folder all at once. The action attached to that folder recognises that there are 206 items in the drop. So it might be an idea for your droplet to store its processed files somewhere else first and move them en masse to the action folder when it’s finished. Alternatively, it could perform the folder action script’s tasks itself.

Thanks Nigel, I have a feeling I will have to do as you suggested and put the folder action script into my droplet and take care of it all at once. If I find another way I will post how I did it.

I had another question regarding folder actions - how do people out there debug them? The only way I know of is to put dialogs along the way that notify me of what is happeninging. Perhaps I am overlooking something. What about Script Debugger, does it have tools that I am overlooking for debugging a folder action and seeing how it is running step by step? I find them difficult to develop becuause errors will cause them to fail with no warning unless I have programmed in a dialog.

Thanks,
jON bEEBE

I always do things the hard way: dialogs, running bits separately in Script Editor, etc. The thing is to get as much of the script working as possible before actually turning it into a folder action or droplet.

I had a similiar problem and solved it by adding a stay open script that refreshes the finder windows every x seconds and this seems to kick off any folder actions etc. You could use something like this

on idle
try
tell application “Finder” to update (get items of windows)
end try
return 10 – idle time, in seconds, between executions
end idle

You could just add a refresh to an existing script but this way works best for me as the refesh script does other stuff as well