Page 1 of 1

Remove Files From Any Folder Named Trash...

PostPosted: 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?

Re: Remove Files From Any Folder Named Trash...

PostPosted: Fri Mar 25, 2022 8:20 am
by Mr_Noodle
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.

Re: Remove Files From Any Folder Named Trash...

PostPosted: Fri Mar 25, 2022 11:17 am
by 1957Goldtop
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.

Re: Remove Files From Any Folder Named Trash...

PostPosted: Mon Mar 28, 2022 9:47 am
by Mr_Noodle
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.

Re: Remove Files From Any Folder Named Trash...

PostPosted: Tue Apr 05, 2022 11:47 am
by 1957Goldtop
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!

Re: Remove Files From Any Folder Named Trash...

PostPosted: Tue Apr 05, 2022 12:22 pm
by 1957Goldtop
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

Re: Remove Files From Any Folder Named Trash...

PostPosted: Wed Apr 06, 2022 9:14 am
by Mr_Noodle
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.