Running rules in subfolders

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

Moderator: Mr_Noodle

Running rules in subfolders Sun Apr 03, 2022 11:20 pm • by wdavies39
I'm sorry, I've read the explanation on how to run rules in subfolders - but I can make no sense of it at all.

My problem is I have a folder called TV, and in it are lots of subfolders which contain movie files and other non media files that are just junk. I want to send the junk files to the trash.

So I set up Hazel to monitor the TV folder, and I wqnt it to monitor all the subfolders - then do I tell Hazel to do this:

1."If kind is not Movie"
2. Move to folder Trash
3. Run rules on folder contents.

Or is the order of instructions different?

Incidentally, this monitored folder is on an always connected network server - does Hazel work on Network folders?

Thanks for any help

a very old fogey!
wdavies39
 
Posts: 5
Joined: Wed Jul 01, 2015 10:21 pm

Re: Running rules in subfolders Mon Apr 04, 2022 9:23 am • by Mr_Noodle
Well, that rule is a bit dangerous. "Kind is not Movie" will also match folders and move those to the trash. You should add a condition to filter out folders, at least.

If you look at the chapter on subfolders, it will emphasized not putting everything into one rule. "Run rules on folder contents" does not make sense if you try and match it against files. One way to look at it is to set up your rules to work as if all the files were at the top level. Then add the subfolder rule and tweak that to tell Hazel which folders it should go into.
Mr_Noodle
Site Admin
 
Posts: 11867
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Running rules in subfolders Mon Apr 04, 2022 1:16 pm • by wdavies39
Mr_Noodle wrote:Well, that rule is a bit dangerous. "Kind is not Movie" will also match folders and move those to the trash. You should add a condition to filter out folders, at least.

If you look at the chapter on subfolders, it will emphasized not putting everything into one rule. "Run rules on folder contents" does not make sense if you try and match it against files. One way to look at it is to set up your rules to work as if all the files were at the top level. Then add the subfolder rule and tweak that to tell Hazel which folders it should go into.


Thanks so much for the quick feedback.

After a lot of trial and error last night, I arrived at what you are suggesting - I did a test run and, as you said, Hazel did return a few folders. So I changed the search to any of "Extension is jpg" and "Extension is nfo", and that solved the folder problem.

I also worked out, by trial and error, you need to tell Hazel to Go into Subfolders as the first rule , and then set out the other search extensions rules, followed by the move to Trash rule.

Once I got over that logic, as a safeguard, I'm searching in a directory on a headless UnRaid Server accessing it by a MBP, so I'm using the Mac's Trash as a safeguard - I can check that everything is OK before I press the final Empty.

It's been running for a few hours now, and it's doing a great job - zipping through around 200 folders, each with up to 50 individual files, and it hasn't made a single error yet.

Thanks for your help.
wdavies39
 
Posts: 5
Joined: Wed Jul 01, 2015 10:21 pm


Return to Support