How to use extracted date attributes in Hazel scripts

Most of my PDFs (like bank statements or invoices) only contain a statement date. To file them correctly, I need Hazel to calculate the financial year (April–March in India). For example:
• 30-Mar-2025 → FY 2024–2025
• 14-Apr-2025 → FY 2025–2026
I can already extract the invoice/statement date from the file using Hazel’s “Contents” match and save it as a custom attribute (e.g. invoiceDate). The problem is: when Hazel runs a script or Shell Script, it only passes $1 (the file path). I don’t see any way to pass invoiceDate (or any other attribute) into the script.
Basically, I want Hazel to pick up the invoice date, figure out the financial year, and then move the file into the correct folder automatically. I can handle the script logic for FY calculation, but I’m stuck on how to get Hazel’s extracted attribute into that script. Is there any alternative solution?
• 30-Mar-2025 → FY 2024–2025
• 14-Apr-2025 → FY 2025–2026
I can already extract the invoice/statement date from the file using Hazel’s “Contents” match and save it as a custom attribute (e.g. invoiceDate). The problem is: when Hazel runs a script or Shell Script, it only passes $1 (the file path). I don’t see any way to pass invoiceDate (or any other attribute) into the script.
Basically, I want Hazel to pick up the invoice date, figure out the financial year, and then move the file into the correct folder automatically. I can handle the script logic for FY calculation, but I’m stuck on how to get Hazel’s extracted attribute into that script. Is there any alternative solution?