Page 1 of 1

Can't get match pattern to work

PostPosted: Tue Apr 21, 2020 9:28 am
by carlsson
I have some PDF invoices that I would like to rename based on their invoice numbers, that are visible in the PDF.
However, I cannot get this to work.

I have two problems:
1. I cannot find the invoice number in the PDF.
2. I cannot rename the file based on what I found in the PDF.

I have read the manual covering "Using Match Patterns in Conditions", but I still can't get this to work.

1. The finnish word for "invoice number" is "Laskun numero". If I do a "contain match" for that, I get a match and are able to process them with Hazel.
However, I am not able to also match the number following the words "Laskun numero". My *guess* is that the PDF is made with columns, instead of rows, but I am really not sure.

2. Even if I do get the action to work, I don't know how I would be able to use the mentioned invoice number to rename the file. I don't see any such possibilities in the rename action...?

Please help!

Here is an extract from the PDF which behave the same way:
Image

My Hazel action setup:
Image

Re: Can't get match pattern to work

PostPosted: Tue Apr 21, 2020 9:50 am
by Mr_Noodle
You'll need to use a custom attribute to capture the invoice number. You can then use that in the rename action.

Use the preview function as that will help you here. It will show a green or red badge for each condition showing whether it matches or not. If you click on it, it will show you the value for the attribute, which in this case, would be the file contents.

Re: Can't get match pattern to work

PostPosted: Wed Apr 22, 2020 12:34 am
by carlsson
Alright, thanks!