Easy way to validate rules?

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

Moderators: Mr_Noodle, Moderators

Easy way to validate rules? Tue Mar 29, 2016 4:20 am • by tillus
Hi,

maybe I am missing something obvious, but I often find myself creating new rules and then spending half an hour to try to find out, why the rule does not work.

Most often it's only a small typo or an additonal space in the file name that causes the rule not to work.

I know about the little "eye" icon that shows me "matched" rules to any file in the target folder. But that's of no use to me since I mostly use rules to move files away.

Does anyone have a good workflow for validating newly created rules? I never know which part of my rule is the one with the error in it!

Thanks for any help!
tillus
 
Posts: 3
Joined: Mon Feb 17, 2014 11:22 am

Re: Easy way to validate rules? Tue Mar 29, 2016 8:45 am • by Mr_Noodle
I'm not sure how the preview isn't useful to you; can you elaborate more on that? Also, check the beta forums as there are developments there that may be of interest.
Mr_Noodle
Site Admin
 
Posts: 11247
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Easy way to validate rules? Tue Mar 29, 2016 2:39 pm • by tillus
My use case is actually quite common. Say, I want to rename and move a PDF that contains the word "invoice" and has a date inside it that I would like to be detected automatically. I would set up the following rule:

1. Match a file (kind is PDF, name contains "invoice", contents contain match of a date token)
2. Rename the file with date at the beginning
3. Move the file to a certain folder
4. Sort it into a subfolder according to the date

If the rule validates, the file will be moved and everything is okay.

If the rule does not execute, it doesn't help me to look a the preview window because there will be no matching rule on the file... The only information I get is that I do not have a matching rule to the selected file - So I have no idea why the rule does not work.

It would be helpful to know at which step the rule breaks. (Is it because the date could not be detected and I should try to tweak the date format to match or is it because I have accidently moved the target folder? Or is it another reason, e. g. I misspelled the file name in the first place an the rule stopped right after not being able to find a PDF with the word "invoice" in it?)

I hope it's clearer now.
tillus
 
Posts: 3
Joined: Mon Feb 17, 2014 11:22 am

Re: Easy way to validate rules? Tue Mar 29, 2016 4:19 pm • by Mr_Noodle
In the preview, if you select the file, you can click on the "i" button. That shows you all the attributes for the file. There's also a pop-up where you can select each rule in turn. That will show you which fields matched or which fields failed, depending on whether the rule as a whole matched or not. Also, again, version 4 has a newer more direct feature that you may be interested in.
Mr_Noodle
Site Admin
 
Posts: 11247
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Open Discussion