You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Automator Folder Action not behaving

I have a Folder Action, created in Automator, with the following 5 Actions…



Find Finder Items in ‘Desktop/DROP’ whose file extension is ‘jpg’ or ‘jpeg’

Rename Finder Items: Replace Text ‘_2’, in basename, with nothing (ie: delete ‘_2’)

Change type of images to ‘HEIF’ (Pixelmator Action)

Find Finder Items in ‘Desktop/DROP’ whose file extension is ‘heic’

Move Finder Items to ‘Desktop/COMPLETED’


It works! All jpgs are successfully renamed, changed to .heic and moved, but a random* number of the files remain in ‘DROP’ (as well) and, although they are .heics, the script keeps trying to ‘change’ the filetype to .heic, this slows my Mac† down dramatically and runs the fans. Manually deleting the duplicates solves the problem but…


Why is the script creating duplicates in ‘DROP’?

Why is the script acting on .heic files?

How do I stop it doing this?


*the random files are not necessarily consecutive, I haven’t spotted any reason for those particular files to cause a problem. How many there are also seems random, eg: batch convert 7 files and get 3 random duplicates; batch convert 10 files and get 1 random duplicate!? 


†’17 MacBook Pro · macOS10.15.7

MacBook Pro 15″, macOS 10.15

Posted on Sep 29, 2021 12:23 PM

Reply
Question marked as Top-ranking reply

Posted on Sep 29, 2021 3:00 PM

Unless I have somehow misread your post, you are imposing subsequent write operations on the dropped files in that DROP folder by renaming and converting to .heic while the files are still in it. Each subsequent write operation forces the Folder Action to run again on that folder. That is why I suggested you detect the files in that folder with a Folder Action, but move them to the Completed folder where your renaming and image conversion write activities do not trigger the Folder Action to rerun itself.

Similar questions

5 replies
Question marked as Top-ranking reply

Sep 29, 2021 3:00 PM in response to Wikisnoodle

Unless I have somehow misread your post, you are imposing subsequent write operations on the dropped files in that DROP folder by renaming and converting to .heic while the files are still in it. Each subsequent write operation forces the Folder Action to run again on that folder. That is why I suggested you detect the files in that folder with a Folder Action, but move them to the Completed folder where your renaming and image conversion write activities do not trigger the Folder Action to rerun itself.

Automator Folder Action not behaving

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