Page 1 of 1

Stop processing after matching first file

PostPosted: Sun Aug 11, 2013 4:19 pm
by scottfwalter
I want to have Hazel via Applescript add a reminder to clean out my download folder if there's a file that is more than 1 week old. How do I get Hazel to only process the first matching file? If I have 10 files in my download folder that are older than 1 week I only want my Applescript to run one.

Thanks, Scott.

Re: Stop processing after matching first file

PostPosted: Sun Aug 11, 2013 4:50 pm
by scottfwalter
I thought I would have my rule set the label color to "red" and then have a second rule ignore all the files that have a red label. During the first pass my rule that runs the applescript to create a reminder execute multiple times.

I guess Hazel must get the list of files to process before any rules are run for the folder. It would be nice if you could force a re-evaulation of rules.

Re: Stop processing after matching first file

PostPosted: Mon Aug 12, 2013 3:48 pm
by Mr_Noodle
Why don't you have Hazel monitor one level up and then match the folder if it contains a file that meets your criteria. That way you only have the action run on the folder as a whole and not on each file?

Re: Stop processing after matching first file

PostPosted: Mon Aug 12, 2013 8:25 pm
by scottfwalter
Thanks for the tip I was able to get it to work. In case anyone else wants something like this here is a screenshot of my rule https://www.dropbox.com/s/xgi5invks5q80rs/hazel%20rule.png