Feature request: allow rule on Trash

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

Feature request: allow rule on Trash Tue Jun 09, 2009 3:16 am • by alastor933
I'm developing a script that uses Pashua to present an interface.
Each run produces a temp file that is trashed immediately - right now there's about 270-300 of them in my Trash.

It would be nice to allow a single rule on the Trash; it would let you specify files to be deleted immediately, using a pattern matching rule on their name.

No other options would be available for this rule.
alastor933
 
Posts: 53
Joined: Wed Mar 05, 2008 3:52 pm
Location: Utrecht, Netherlands

Re: Feature request: allow rule on Trash Tue Jun 09, 2009 3:35 am • by Mr_Noodle
This is in the feature database. At the moment, I forget the issues which made this more difficult to implement. You could experiment with having Hazel monitor the ~/.Trash folder as any other folder. There may be some odd contention issues (since Hazel is watching the folder from two different angles) but since this is stuff that is going to be deleted anyways, it may not be a big deal.

Are the files particularly large?
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Feature request: allow rule on Trash Tue Jun 09, 2009 7:59 am • by alastor933
Not large, it's just that there are so many of them. It makes finding something a chore (I hate long lists).

In the mean time I discovered that the trashing is done by a simple "tell Finder" statement. Will replace that with a "do shell...rm..".
You could experiment with having Hazel monitor the ~/.Trash folder as any other folder.
Interesting option, will surely try.
alastor933
 
Posts: 53
Joined: Wed Mar 05, 2008 3:52 pm
Location: Utrecht, Netherlands

Re: Feature request: allow rule on Trash Wed Jun 10, 2009 2:08 pm • by alastor933
Well, that was easy.

Unhid hidden files.
Dragged .Trash to Hazel.
Created rule with embedded shell script, to remove files with name starting with "Pashua_".
Clicked 'Run rules now'.
Took all of <15 secs to remove almost 300 files.
:P
alastor933
 
Posts: 53
Joined: Wed Mar 05, 2008 3:52 pm
Location: Utrecht, Netherlands


Return to Open Discussion