Delete oldest if more than 5 files in folder

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

Moderator: Mr_Noodle

I'm getting exactly the same error in some imported rules after a MacBook rebuild. Was this ever resolved? Do i need to send my stack dump? If so how do I find this stack dump? A search of the forum provides a few clues to the stack dump location which don't work.

Cheers
stodge
 
Posts: 6
Joined: Fri Feb 10, 2012 3:08 am

If you are getting that same error in the logs, then the problem is that using the "is among the" conditions with enclosing folder won't work at the top level. The reason for this is because you are going out of bounds. The "is among" condition requires data for the siblings of the monitored folder which is outside the area that Hazel is monitoring. If you really need to do this, then I suggest having Hazel monitor one folder up and use the subfolder level condition to ensure it only gets applied one level down.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Sorry, if I understood that correctly then that cannot be the case as I detects some of the files but puts the error next to others. If I then recreate the rule and run the preview on that it will show different results but still an error.

I'm not sure where the log is that I should be reviewing and I am only actually seeing these issues with the preview that I always interrogate before going live with a rule.

I am getting similar problems using the rule for omnifocus backups provided in the following thread:

viewtopic.php?f=4&t=1435&p=5747&hilit=omnifocus#p5747

Could it be anything to do with me having upgraded to an SSD with the old HDD in the MacBook Pro Optibay. The backups live in the documents folder which is symlinked to the HDD.

Thanks
stodge
 
Posts: 6
Joined: Fri Feb 10, 2012 3:08 am

Re: Delete oldest if more than 5 files in folder Thu May 02, 2013 10:22 am • by sjk
stodge wrote:I'm not sure where the log is that I should be reviewing

Select View Log from Hazel's menu under its main menubar icon or under the Info tab of System Preferences > Hazel.
sjk
 
Posts: 332
Joined: Thu Aug 02, 2007 5:43 pm
Location: Eugene

This one confused me for some time as you can see from my prior posts. Should be one of the easiest rules..

I finally wound up doing this

If all of the following conditions are met for the file or folder being matched
If all of the following conditions are met for the current file or folder
Number of items is greater than X
Date last modified is not among the X most recent
Move to trash.

I arrived here through trial and error and that is why I had to use the Date last modified instead of Date added as I kept deleting all the files in the folder and had to move them back to test.
Gasport
 
Posts: 14
Joined: Sun Mar 30, 2008 1:42 pm

I'm really struggling with this and have narrowed the issue down to the 'is not among the' rule. I am monitoring a folder and using the following rule:

If 'all' of the following conditions are met for 'the file or folder being matched'
'Date Added' 'is not among the' 5 'most recent'

Move to 'Trash'

This gives an error next to each item. I have tried selecting just the files based on date added is in the last 5 days, etc. And this works fine. The minute i use the 'is not among the' rule it falls over and gives me an error during preview. When I run the rule it moves everything in the folder to the trash!

Is there any guidance on how to use this rule?

I have had it working in the past but since rebuilding my mac it no longer works! :(
stodge
 
Posts: 6
Joined: Fri Feb 10, 2012 3:08 am

Hover over the file with the error. It will tell you what went wrong. Post whatever message you see there.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Previous

Return to Support