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

Move Folders and Contents by Name with Automator or Script

Hello!


I am looking for a solution to un-nest and move subfolders with a script. Automator comes close to completing this task, but continues to move folders to the wrong location.


I have hundreds of folders with a name given by a serialized code. Inside of each of these folders are subfolders ending in "_C", "_W" and "_E" . I want to drop all of the main folders and have a script split the subfolders and their contents into like folders so that hundreds of C folders, W folders and E folders are all grouped together.


Thank you for any insights! Automator workflow included for reference.



Posted on Nov 20, 2019 2:20 PM

Reply
Question marked as Best reply

Posted on Nov 21, 2019 11:03 PM

This is one of the (many) non-intuitive aspects of Automator.


Your problem is that the 'Find Finder Items' actions are cumulative - it does not reset between each 'Find', so the first 'Find Finder Items' files all the items with '_C' and moves them to the _C folder.

The workflow then moves on to find all the '_E' files and adds these to the list of items, which then all get moved to the _E folder.

Finally, the third find grabs all the _W files and adds them to the existing list of _C and _E files, and all of them get moved to _W, which matches what you're seeing.


The solution, though, is simple - for each 'Find Folder Items' action, click the 'Options' link and turn ON 'Ignore this action's input'. This will effectively start a new list of items and should get you the result you're after.


Similar questions

5 replies
Question marked as Best reply

Nov 21, 2019 11:03 PM in response to Robo_Dial

This is one of the (many) non-intuitive aspects of Automator.


Your problem is that the 'Find Finder Items' actions are cumulative - it does not reset between each 'Find', so the first 'Find Finder Items' files all the items with '_C' and moves them to the _C folder.

The workflow then moves on to find all the '_E' files and adds these to the list of items, which then all get moved to the _E folder.

Finally, the third find grabs all the _W files and adds them to the existing list of _C and _E files, and all of them get moved to _W, which matches what you're seeing.


The solution, though, is simple - for each 'Find Folder Items' action, click the 'Options' link and turn ON 'Ignore this action's input'. This will effectively start a new list of items and should get you the result you're after.


Move Folders and Contents by Name with Automator or Script

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