Selective Sub-Folder Processing

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

Moderator: Mr_Noodle

Selective Sub-Folder Processing Wed Dec 13, 2023 1:23 am • by klind
I want to create a rule that moves files out of a given folder and other rules that act on files within that folder's subfolders. The problem is that if I use the process subfolder command it then moves every file from every folder. How can I create rules that act on subfolders and also empty the top-level folder?

I would post what I have tried, but I have lost many files because I have been unable to make this work so I don't want to post something that causes trouble.

Just to be clear, I have several rules that function properly on all the subfolders just like I want. But I wish to find a way to also move any file in the top-level elsewhere.

Is there a way?
klind
 
Posts: 33
Joined: Mon Jan 30, 2017 7:02 pm

Re: Selective Sub-Folder Processing Wed Dec 13, 2023 9:49 am • by Mr_Noodle
There are several ways to do this:

1. In your rule to tell Hazel to go into subfolders, add conditions to limit which subfolders to go into.
2. In your rules to process files, you can use Subfolder level to only match when the file is at a certain level.
3. In your rules to process files, use a nested condition to match against the parent folder.

Which solution you choose depends on the specifics of your situation though I suspect #2 would probably work (and is the easiest to implement).
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Selective Sub-Folder Processing Wed Dec 13, 2023 3:50 pm • by klind
OK, thanx. I will try to use your second option. If I understand correctly you are saying that the Go Into Subfolders will process for all rules. So if I want to move all top-level files, but not have this rule apply to any subfolders I should write something like this:

If 'all'
Kind is not Folder
Subfolder Depth is 0
Any File
Move to folder 'Catchall'

So this rule will not go into subfolders even though I have other rules that do go into subfolders, right?
klind
 
Posts: 33
Joined: Mon Jan 30, 2017 7:02 pm

Re: Selective Sub-Folder Processing Thu Dec 14, 2023 9:49 am • by Mr_Noodle
That rule will only match at the top level so shouldn't apply to anything below.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Selective Sub-Folder Processing Thu Dec 14, 2023 3:08 pm • by klind
I read a bunch of the manual last night. From what I read it would appear that the mentioned rule would work also if I left out the 'Anyfile' condition. Which way is better for Hazel?
klind
 
Posts: 33
Joined: Mon Jan 30, 2017 7:02 pm

Re: Selective Sub-Folder Processing Fri Dec 15, 2023 10:52 am • by Mr_Noodle
Right. "Any file" only makes sense if it's the only condition.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support