Move folder contents to Trash; leave folder

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

Moderator: Mr_Noodle

Move folder contents to Trash; leave folder Sun Dec 04, 2022 11:12 pm • by TallTrees
I've written a rule that checks for subfolders named "Output" that have a size greater than 1 byte. I'd now like Hazel to move the contents (including other subfolders) of the Output folder to the Trash, but I'm not exactly sure how to do that, without also moving "Output" to the Trash as well.

Also, is there a better way to determine if a folder is empty, than using size greater than 1 byte?
TallTrees
 
Posts: 8
Joined: Wed Oct 20, 2021 12:05 pm

You can set up a rule to go into the output folder (see manual about going into subfolders). You can then have a separate rule to check if it's parent is the output folder (see manual about nested conditions) and deal with them appropriately. Give that a try and report back if you run into any problems.
Mr_Noodle
Site Admin
 
Posts: 11174
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:You can set up a rule to go into the output folder (see manual about going into subfolders). You can then have a separate rule to check if it's parent is the output folder (see manual about nested conditions) and deal with them appropriately. Give that a try and report back if you run into any problems.


Worked like a charm! Thank you!
TallTrees
 
Posts: 8
Joined: Wed Oct 20, 2021 12:05 pm


Return to Support

cron