Apple Event: May 7th at 7 am PT

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

automator folder action adds date recursively

Hi,


I want to create a folder action with Automator to add the current date to the filename. My goal is that the date is appended to file names as the files are added to a particular folder.


I've made a folder action with Automator to do this. This consists of 2 actions: Get Specified Finder Items, followed by Rename Finder Items: Add Date or Time. See the screenshot below.


This runs but it recursively adds the date over and over. Thus if I drag a file named horse to the folder it renames the file as horse 11-27-2018 11-27-2018 11-27-2018 ...


I wonder what's going on? Is there a way to construct the Automator Script to avoid this? (The script also runs and acts recursively in the same problematic way if I remove the Get Specified Finder Items action.)


Any help will be appreciated.

thanks,

John

User uploaded file

MacBook Pro (Retina, 15-inch, Late 2013), macOS Mojave (10.14)

Posted on Oct 27, 2018 4:25 PM

Reply
Question marked as Best reply

Posted on Oct 27, 2018 11:41 PM

Unless you add it, or a folder action adds itself to other folders, it does not descend into the folder structure, so you could just put a folder in the watched folder (name it "Processed Items" or something) and move processed files into that.

Similar questions

6 replies

Oct 27, 2018 6:54 PM in response to red_menace

Thanks red_menace.


This explains what is happening. Consistent with your explanation, the problem is avoided when I add a Move Finder Items action which sends the file to another folder.


However this isn't as elegant a solution as I'd hoped for since the user now drops a file on a folder and it ends up in another, breaking the metaphor. I'll experiment with other approaches.


I'm surprised at this recursive behavior, but I understand that it is a consequence of the modular nature of the scripting process, so that events triggered by the renaming action are not treated in any special way and so trigger the renaming again.


thanks,

John

automator folder action adds date recursively

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