Page 1 of 1

Tips on Debugging CONTENTS CONTAIN MATCH on PDF Files

PostPosted: Tue Oct 11, 2022 10:02 pm
by nlucchesi
I’m trying to run Hazel rules against PDF statements from a financial institution using CONTENTS CONTAIN MATCH.

How can I “see” what Hazel sees as it goes through the contents of a PDF file looking for a match?

Yes, I already tried the terminal command mdls which just returns file attributes. I’m looking for the file’s content, not its attributes.

I’ve tried running my cursor from left to right, top to bottom (while the PDF is open in Preview) in an attempt to identify the sequence of the content but the results are difficult to track since selected contents sometimes jumps block to block in different unintelligible columns.

There simply must be a better way to debug CONTENTS CONTAIN MATCH conditions on PDF files.

Thank you for your help.

Re: Tips on Debugging CONTENTS CONTAIN MATCH on PDF Files

PostPosted: Wed Oct 12, 2022 9:17 am
by Mr_Noodle
Use Hazel's preview function. Check the manual for more details but you can preview the values for any attributes there.

Re: Tips on Debugging CONTENTS CONTAIN MATCH on PDF Files

PostPosted: Wed Oct 12, 2022 10:34 am
by nlucchesi
Mr_Noodle wrote:Use Hazel's preview function.


Yes, thank you. After reading the manual’s preview entry carefully, I now see that I can click on the and to reveal the full text of the PDF:

Code: Select all
You can click either of these items to see a popover with the current value of the attribute in question as well as any  custom attributes  you’ve defined.


Thank you.

Re: Tips on Debugging CONTENTS CONTAIN MATCH on PDF Files

PostPosted: Sat Oct 15, 2022 3:42 pm
by nlucchesi
Mr_Noodle wrote:Use Hazel's preview function.


Yes, preview does show the PDF’s text very clearly.

But it is very tedious to use:
  1. I have to resize the small viewport every time that I open it.
  2. Preview window closes every time I edit the Rule, so I have to re-size again.

It would be nice to see the the Elements that do match even though the Rule as a whole does not match. As it is now, if a Rule doesn’t match, then I have to re-type it from the beginning and watch to see when it stops matching.

Re: Tips on Debugging CONTENTS CONTAIN MATCH on PDF Files

PostPosted: Mon Oct 17, 2022 9:14 am
by Mr_Noodle
You can "tear off" that popover so that it stays on screen.