Rename PDF based on invoice number
I am trying to find out how I can rename hundreds of invoice pdfs based on the invoice number.
The format of the number is the two digit year, then a hyphen, then a series of numbers 1-5 digits long
These are scanned files so OCR will be necessary. I have seen that Automator and/or Shortcuts can extract the copy. I've tried copying some code from other threads online but can't seem to get it to work for my needs. There is text before the invoice number "Invoice #:", but I only need the number itself, not the text.
Examples
Invoice #: 19-2456
Invoice #: 22-18635
Invoice #: 23-123
Invoice #: 23-0
Can anyone help? Thanks!