Knowing more about why expressions fail

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

Moderator: Mr_Noodle

Knowing more about why expressions fail Wed Oct 15, 2014 7:09 am • by johncclayton
Hi

I've just spent about 10 hours setting up Hazel rules to go paperless. One thing I'm having a lot of problems with is date capture in scanned documents.

A typical rule I've been creating looks like this:

https://www.evernote.com/shard/s7/sh/6f ... 3776d73d7a

My problem is: how do I debug such a rule when it fails? What condition actually failed?

I understand I can preview my rules to see when/if they match the files I'm expecting them too. I also understand (but have not tried) the logs to see some more matching in detail.

But this still leaves me wanting in terms of trying to work out why complex rules don't match. Here's an example - this is what I see in the logs:

2014-10-15 12:52:38.136 hazelworker[20756] DEBUG: 2014-03-28 - bank linth gehalt.pdf: Did not match any rules.
2014-10-15 12:52:38.220 hazelworker[20756] DEBUG: 2014-08-28 - bank linth gehalt.pdf: Did not match any rules.

OK. Fine, the rule to find my bank statements fails for two documents (but succeeds for 4 others). Why? I already know which rule I expect to match it - so I don't need a run down in detail of ALL rules, but what would absolutely rock my world/boat etc would be to know which conditions succeeded or failed for a rule - even if that's a special mode I have to put the rule into.

Now, I *suspect* all the conditions are implemented as a single composite spotlight query... so I couch my request here in the knowledge that this is not a perfect solution, but I'm coming from the point of view where I'd like to have some kind of help rather than gold plated perfectness (if that's even a word)

My Request:

- provide a way to run a specific rule in 'debug' mode
- when this mode is enabled, I must be prompted to tie debug mode to a specific set of files that I'm trying to match, in this case I'd choose the two documents that failed to match already
- when the rule fails to match next time, Hazel will split up each condition and run it against the files in question - printing in the logs something like "<file 1> - matched condition 1: <text of condition>" or if there's no match "<file 1> - didn't match condition 1: <text ...>".

The idea is not to provide me with an all singing dancing UI that provides match/no-match overview for all files that the rule was run against, but to enable me to target a specific case of rules not matching to make it easier to debug my capture criteria.

More than happy to discuss this in detail - cool product!

Thanks!
johncclayton
 
Posts: 2
Joined: Wed Oct 15, 2014 6:47 am

Re: Knowing more about why expressions fail Wed Oct 15, 2014 11:33 am • by Mr_Noodle
In 3.3 (currently in beta), you'll be able to see which field caused the failure in the preview. Not the same as which condition but it's something. I will be looking into deeper debugging options in the future though.
Mr_Noodle
Site Admin
 
Posts: 11866
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support