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

Automator

Hi everyone, I am trying to get Automator to work with the map action including all the subdirectories. When a file is added to a directory or a subdirectory of the given map, it should copy the specific file to the similar folder on the external network drive. If the directory does not exist, it should be created. From what I've seen, I can only get this done for the specific folder without the subdirectories. Does anyone know if and how this can be achieved ? I have no knowledge of Applescript en would therefore rather use the map action with Automator than Applecript.


Thank you for taking to time to look into this and to respond.

iMac 27″, macOS 11.2

Posted on Apr 17, 2021 5:42 AM

Reply
Question marked as Best answer

You're right in that applying a Folder Action to a folder only affects the top level - changes/additions to subfolders won't trigger the script.


There are two basic solutions to this.


One is to apply the Folder Action to every folder in the subdirectory (with some magic to automatically apply the Folder Action script to newly-created folders).


The other option is to step out of folder actions and to write a stay-open script that periodically polls the folder tree looking for changes. The caveat here is that the script will only trigger on a schedule (e.g. once per minute), so there may be a delay between adding files and the script acting on them. There may also be cases where a file is added and subsequently removed before the script notices, which may or may not be a problem depending on your use case.


Both of these are outside the scope of what Automator can do (other than manually applying an automator Folder Action to each sub-folder)

Posted on Apr 19, 2021 1:21 PM

Similar questions

5 replies

Apr 18, 2021 9:00 AM in response to allurenl

Hey there allurenl,


We'd like to answer your question as best we can regarding automatically creating subdirectories on your external network drive when a new file is saved inside of one within your Mac.


It's good to hear that files are automatically doing this when only saved in one folder on your Mac.


While you may need to script your own actions, we wanted to provide the Automator User Guide for Mac.


Take care!

Question marked as Best answer

Apr 19, 2021 1:21 PM in response to allurenl

You're right in that applying a Folder Action to a folder only affects the top level - changes/additions to subfolders won't trigger the script.


There are two basic solutions to this.


One is to apply the Folder Action to every folder in the subdirectory (with some magic to automatically apply the Folder Action script to newly-created folders).


The other option is to step out of folder actions and to write a stay-open script that periodically polls the folder tree looking for changes. The caveat here is that the script will only trigger on a schedule (e.g. once per minute), so there may be a delay between adding files and the script acting on them. There may also be cases where a file is added and subsequently removed before the script notices, which may or may not be a problem depending on your use case.


Both of these are outside the scope of what Automator can do (other than manually applying an automator Folder Action to each sub-folder)

Automator

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