Have been digging through the forums and experimenting for hours to come up with a solution to create the following smart rule with no luck so far.
- Parse PDF text to extract the invoice date
- Set the document creation date to the parsed date
- Rename the document to “YYYY-MM-DD - Vendor”
the specific date to extract is buried in the text amongst 1/2 dozen dates which makes it non-trivial to extract as it is surrounded by “false positive” matches - I also have numerous other complex matching use cases that will rely on a full featured regex implementation
the following regex seems to do a reasonable job at matching for this specific use case
However, AppleScript seems to be lacking regular expression support. Within AppleScript I’ve also tried shelling to
egrep which at first looked hopeful only to discover their BSD regex support is dated and lacking functionality.