Apple Automator Folder Action issue

Hello,


I work as a photographer and often shoot "tethered" so that the files end up directly in a computer. My camera produces both raw files and jpeg files.


I have created a folder action that moves only jpeg files to a different folder. This works pretty good until I shoot too many files in a short period of time. Then the action starts skipping to move the jpegs and they get left in the original folder.


Is there any way to work around this? Can you set the action to cycle every 30 seconds or so?


/Albin

Posted on Nov 14, 2020 5:59 AM

Reply

Similar questions

2 replies

Nov 14, 2020 9:15 AM in response to albin145

The very nature of a drop folder is that anything dropped on it is the trigger event to fire the associated workflow. You would have to dispense with the drop folder concept, and instead, tell launch control to watch a folder for added files, and then fire the associated script to process the folder. With launch control, you can tell it to check the designated folder with a particular time granularity (e.g. every 15 minutes).

Nov 16, 2020 4:32 PM in response to albin145

Actually, yes you can...


Ordinarily (>99% of the time) Folder Actions are used to process the files dropped in a folder. That completely ignores the other oft-overlooked parts of Folder Actions.


Folder Actions can also trigger when files are removed from a folder, or even when the folder's window is opened or closed in the Finder.


Ultimately, though, all of these are just triggers that initiate the script.


There is nothing that says the Folder Action is restricted to the new files.


Ultimately you could write a Folder Action that just looks in the folder for ANY .jpeg file and moves it to the destination. This will catch any .jpegs that weren't moved in a prior invocation due to the race condition that you describe. In this way you completely ignore the dropped files because they're irrelevant to what you're trying to achieve


on adding folder items to this_folder after receiving listOfAlias
	tell application "Finder"
		set files2Move to every file of folder this_folder whose name extension is "jpeg"
		move files2Move to folder "JPEG Images" of folder (path to desktop)
	end tell
end adding folder items to


Now if any JPEGs are skipped in error, they'll just be moved over the next time any file is added to the folder.

Or you could change the action to a 'on opening folder' action so any residual files are moved when the folder is opened. All kinds of possibilities.


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Apple Automator Folder Action issue

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.