Remove Files From Any Folder Named Trash...

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

Moderator: Mr_Noodle

Remove Files From Any Folder Named Trash... Thu Mar 24, 2022 10:54 pm • by 1957Goldtop
I have an app that creates a sub-folder “Trash” every time a new “session” is created. I have thousands of sessions on my computer in various places which means I have thousands of "Trash" folders with files in them I don't need.

I would like to set up a rule that automatically moves any files in any folder named “Trash” anywhere on my computer to the trash.

Is this possible?
1957Goldtop
 
Posts: 4
Joined: Thu Mar 24, 2022 10:52 pm

Since they are spread out all over the place, the best solution is to create a Smart Folder to match those files and have Hazel monitor that. You'll need to play around with the Smart Folder conditions to see if you can get that part to work.
Mr_Noodle
Site Admin
 
Posts: 11867
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Since they are spread out all over the place, the best solution is to create a Smart Folder to match those files and have Hazel monitor that. You'll need to play around with the Smart Folder conditions to see if you can get that part to work.


I was able to create a smart folder to find all the "Trash" folders... but not sure how to now match the contents of those folders for Hazel to act on them.

It wouldn't be ideal but I guess I could just set Hazel to delete the trash folders, but when I try to select the smart folder in Hazel it won't let me and I have to select one of the "trash" folders IN the smart folder.
1957Goldtop
 
Posts: 4
Joined: Thu Mar 24, 2022 10:52 pm

Can you send me a screenshot of that? You should be able to select the Smart Folder when adding a folder or you can drag it into the folder list.
Mr_Noodle
Site Admin
 
Posts: 11867
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Can you send me a screenshot of that? You should be able to select the Smart Folder when adding a folder or you can drag it into the folder list.


Ahh, I see what was happening... the smart folder was on the Finder sidebar so it wouldn't let me add that... I had to go directly to the folder and then I could add it...

So, it looks like I can create a rule that will just delete all the "Trash" folders, but ideally I would like Hazel to delete the contents of each of those folders rather than the entire folder... is that possible?

Thanks!
1957Goldtop
 
Posts: 4
Joined: Thu Mar 24, 2022 10:52 pm

Actually, it's not working as expected... I've created the rule but it's not running as I would expect... as you can see from the screenshot, the folders from January should be deleted but they aren't getting deleted.Image
1957Goldtop
 
Posts: 4
Joined: Thu Mar 24, 2022 10:52 pm

Did you email in about this? If so, I replied to you there. Please only post or email, not both, otherwise it creates extra confusion and work.

If you were not the one who emailed, please post back here.
Mr_Noodle
Site Admin
 
Posts: 11867
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support