How to create a new subfolder when it doesn't exist?

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Hey all,

I have a folder "Phase 3A" in which there are 30+ subfolders (e.g. Listening File 1, Listening File 2, etc.). Inside these "Listening File" subfolders, I want to create a sub-sub-folder with the name "Processed" (if that folder doesn't yet exist).

I've figure out how to get Hazel to look inside sub-folders of "Phase 3A," but I'm having trouble going further than that. I have two specific questions:

1) Trigger - How do I have it run when a sub-sub-folder does *not* exist in a sub-folder?

It'd be insanely troublesome to have this run at the sub-folder "Listening File" depth because that'd mean 30+ rules that only urn once. I need it to run at the top Phase 3A level, but I'm not sure how to look for non-existence of a sub-sub-folder. If it helps, there will be no other sub-sub-folders (i.e. if there is a folder within "Listening File" subfolder, then it means that subfolder does contains a "Processed" sub-sub-folder). Any ideas?

2) How can I create a sub-sub-folder?

It doesn't look like there's a way to create a folder (at least not that I can see?), I figured I'd need a script--but that's beyond me and Automator seems to require a location for creating a folder, which I can't give it since it would be in a different place every time. Help?

Thanks!
PcB8H9WXqQXGjsL4
 
Posts: 2
Joined: Tue Feb 26, 2019 11:13 pm

There's no action to create a folder without putting a file in it. You would indeed need Automator or a script to do that part.

As for rules, you can have a rule check the subfolder level so that you only need one rule to do this.
Mr_Noodle
Site Admin
 
Posts: 7865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support