Running Rules Only if Number of Documents Reached?

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

Moderator: Mr_Noodle

I want to run a rule only when the folder contains more than 10 files like this:

Code: Select all
If the folder contains more of 10 files
   delete files older than 1 month
end if
Can I do this with Hazel?
Uhlhorn
 
Posts: 5
Joined: Fri Aug 18, 2017 11:56 am

If you want to do that exactly, you'd need to do the following:

- Monitor the folder containing the folder in question.
- Have a rule to go into that subfolder (see chapter in the manual on this topic)
- Have a rule to delete files older than 1 month at that particular level in the folder hierarchy.

An easier way to do something similar is something like:

Date added is not among the 10 most recent, move to trash.

That will match the files that are not among the 10 most recent. Note that the files can be younger than a month but it will still only keep the 10 most recent files.
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support