Folder trigger with dynamically created folder?

Building off work with @noisneil and @Zabobon in another thread -- how about using a folder-watching macro to spy on the first folder, and re-write a second macro's trigger to point to any newly-created subfolder? The second macro is the one that'll do your actual processing, like moving files.

As it stands, the macros look at a folder on your Desktop called "Elmedia Output" -- change the folder of the trigger of "Main Watcher" to suit your situation but don't change "Subfolder Watcher"s trigger.

As written the "Subfolder" macro will check the "item" added -- if it's a folder it will flash a notification for each file in that folder (none if the folder is empty), but if it's a file it will notify you of the file name. That's because I don't know the order in which the subfolder and screen shot are written this should cope regardless of whether Elmedia creates a folder (triggering the first macro to change the second) then a file (spotted by the second macro), or a folder with a file (for which the second macro may not have had its trigger set in time to respond).

You can replace the "Display text" actions with whatever you want to do. There's probably a way of doing the processing without duplicating the steps for both cases, but let's see if it works first...

This is new ground for me and, while I've done some tests, you should check it very carefully before using it in anger!

Watch Elmedia Screenies Macros.kmmacros (7.0 KB)

(The meat is in the AppleScript, most of which doesn't show in an image, so no piccy included...)

1 Like