Page 1 of 1

Extracting Text as variables for renaming files?

PostPosted: Mon Dec 07, 2015 4:43 pm
by trowe
Hello,

I'm working on a solution to automate sorting of faxes coming into a physicians office. I've made a fair bit of progress using PDFpen to OCR the files received and sorting them into sub-folders based upon keywords, which works very nicely.

The next step is renaming the files. Ideally, I'd like to search the documents for fields such as "Patient Name:" and then take the next couple words and attempt to rename the file..

ie -- "CONSULT-20151206-154122.pdf" becomes "CONSULT-Doe, John 1.pdf".

Is this possible with Hazel? Anybody have any suggestions or tips to help me out?! :)

Thanks in advance,
- Tim

Re: Extracting Text as variables for renaming files?

PostPosted: Tue Dec 08, 2015 11:58 am
by Mr_Noodle
Use "Contents contain match" to search the contents of the files. Search the help for "match patterns" to get up to speed on specifying patterns. You'll want to search for "Patient Name:" and then use a custom attribute to capture the text after it. If you run into any specific issues, report back here.