Noob trying to rename PDFs based on contents in the PDF

Hi. I've been beating my head against the screen, trying to figure this out. I've even used ChatGPT Hazel helper to try and accomplish it. Specifically, I want Hazel to:
Extract the Merchant, Date, and Amount from the text inside the PDF.
Rename the files using this pattern: [Merchant] - [Date] - [Amount].pdf.
Here’s what I’ve done so far.
The PDFs are from my Chase bank. They all have a line for Merchant, Date, Amount.
I jsut can't figure out how to do the custom tokens. I'm sorry if this has been answered elsewhere (I'm sure it has). I've looked at other questions / use cases and frankly, I just don't understand it enough. I'm hoping if I can do it here with this specific case, I'll be able to figure it out.
This is what the ChatGPT Hazel Helper suggested I do:
Set Up Rules:
In the conditions, I’m using Contents contain match with the following regular expressions:
For Merchant: Merchant (?P<Merchant>.+)
For Date: Date (?P<Date>\w+ \d{1,2}, \d{4})
For Amount: Amount \$(\d{1,3}(?:,\d{3})*(?:\.\d{2})?).
The tokens (blue bubbles) are not being created, even though I’ve typed the regex patterns in the "Contents contain match" field.
Without these tokens, I can’t use them in the rename action, and my files end up named literally as [Merchant] - [Date] - [Amount].pdf.
I know it shouldn't this hard, I just don't know how to do it. lol. thx in advance.
This is what I get from PDF when I copy and paste it from the PDF.
Chase Logo
You made an online, phone, or
mail transaction
Account Ink Business Preferred (...5795)
Date Dec 5, 2024 at 12:08 AM ET
Merchant PP*APPLE.COM/BILL
Amount $0.39
Extract the Merchant, Date, and Amount from the text inside the PDF.
Rename the files using this pattern: [Merchant] - [Date] - [Amount].pdf.
Here’s what I’ve done so far.
The PDFs are from my Chase bank. They all have a line for Merchant, Date, Amount.
I jsut can't figure out how to do the custom tokens. I'm sorry if this has been answered elsewhere (I'm sure it has). I've looked at other questions / use cases and frankly, I just don't understand it enough. I'm hoping if I can do it here with this specific case, I'll be able to figure it out.
This is what the ChatGPT Hazel Helper suggested I do:
Set Up Rules:
In the conditions, I’m using Contents contain match with the following regular expressions:
For Merchant: Merchant (?P<Merchant>.+)
For Date: Date (?P<Date>\w+ \d{1,2}, \d{4})
For Amount: Amount \$(\d{1,3}(?:,\d{3})*(?:\.\d{2})?).
The tokens (blue bubbles) are not being created, even though I’ve typed the regex patterns in the "Contents contain match" field.
Without these tokens, I can’t use them in the rename action, and my files end up named literally as [Merchant] - [Date] - [Amount].pdf.
I know it shouldn't this hard, I just don't know how to do it. lol. thx in advance.
This is what I get from PDF when I copy and paste it from the PDF.
Chase Logo
You made an online, phone, or
mail transaction
Account Ink Business Preferred (...5795)
Date Dec 5, 2024 at 12:08 AM ET
Merchant PP*APPLE.COM/BILL
Amount $0.39