Folder Action scripts and delay loop

Hi my friends,
Folder action scripts are an good old way to process items but the concept was never thought to the end

Now the unresolved old problem with this folder actions is how to add a smart delay loop able to process files in batch.
Quantity and (quality) or size change the delay just to talk about picture files, coming in from different devices like the phone, a stick or as download from the web
I’d like to have folder action script -folders to activate after the last item has been dropped into the designated folder.

Unfortunately, I have no idea how to build a smart delay loop.
Of course my script could wait for a long time but if the delay isn’t dynamic I would have to wait forever every time I submit a bunch of files in different sizes.
Somebody who tried already and experimented the same issue? It’s bothersome to get dialogs for each and every file I submit in a folder action scripts folder, when I need to process them all at once when all are physically available.

I’m happy about some brainstorming too :slight_smile:

So to get this straight, you want to hold the queue of the folder action itself so it can be filled by other files from difference devices and the user will start the queued folder action when he wants to (or started by an delay)?

I think the easiest way is to tag every file using folder actions and when the last item is added to the folder you’ll process all tagged files and untag them when you’re done. By tagging them you could use extended file attributes (xattr on command line) to add temporarily information. It’s like the finder tags a file with with the value ‘brokMACS’ during copy, this way the interface knows to gray out a file even when copied by the Finder on another machine.

Na… Very late reply, I know…
I found out, folder action scripts don’t take into account multiple files, just… single files for: incoming files. At least, if the added files need some time to load! therefore, the time window is too short to consider multiple added files if they come in slowly. But that is exactly the core of my question!

Let’s say I tag all incoming files, then my script will still be unable to kick in after the last file has been added and continue with the actual processing. Because it executes a new instance
Exception made… if I write a text file who counts added files. Maybe a task for Shane’s preference library script?

The whole idea is to create your own queue and only use the folder action itself as an trigger.

Right, it’s useless to fiddle around with ideas when the core code isn’t written better. I thought the same.
Just for curiosity: “path to temporary items folder from user domain” seems abandoned from MacOs 10.12 upwards?
Was so cozy to use for temporary items!

Not really my point :). Your arguments is still based on the flaws in folder actions. The idea of tracking the dropped items is to bypass these flaws, not to re-use them ;). You can create an queue that is shared between multiple folder actions instances.