
When this script runs, it creates an error log at ~/HazelAutomation/log.txt that you can look to see how it is working. Any file that it cannot auto-file is moved to the DevonTHINK global Inbox. Step 4 - autofile to DevonThinik This is the magic step! Setup Hazel to watch "3.HazelProcessed" This script will look at the name of the file (created in Step 3) and auto-file it into the correct group in DevonTHINK. Again, you need to setup one rule per PDF.
DEVONTHINK PRO WRITE ON PDF HOW TO
I always rename the files to "YYYY-MM-DD-billname.pdf" Here is a sample rule: You can find many instructions in this forum on how to do the above. The key for each rule is to move a matched file to "3.HazelProcesssed".
DEVONTHINK PRO WRITE ON PDF PDF
This is the hardest step, because you have to analyze each PDF to determine how to find the date and name of the bill. Here is where the hard work occurs! Step 3 - auto rename and auto file the PDF Setup Hazel to watch the "2.HazelSort" folder. I use PDFPenPro to do this: Code: Select all tell application "PDFpenPro" open theFile as alias tell document 1 ocr repeat while performing ocr delay 1 end repeat delay 1 close with saving end tell end tell The second rule moves all remaining PDFs to "2.HazelSort": Now all your files are in the "2.HazelSort" folder. Rule 1: OCR Files, if needed - move to 2.HazeSort Here is the code in each embedded script: The first checks to see if the file needs to be OCRd: Code: Select all if ! grep Font "$1" then exit 0 else exit 1 fi This second will OCR the file. We have two rules, one OCR PDFs that need it and the other to just move PDFs to the next step. For any PDF file, it OCRs it (if needed) and then sends the file to the next step ("2.HazelSort"). Step 2 Setup Hazel to monitor the directory "1.HazelOCR". You should see only the four directories listed above in this folder. HazelAutomation 1.HazelOCR 2.HazelSort 3.HazelProcessed 4.HazelBakup To test, open a terminal session and type "cd ~/HazelAutomation" and it should go to the top-level directory that is needed. Step 1 To use, you need to create the following directories in your home filesystem: First create a directory called HazelAutomation, and add these subfolders under it. To use, you need to have a copy of Hazel, PDFPenPro and DevonTHINKPro. But I could not find one that automatically took a file and put the PDF in the correct Group in DevonTHINK. There are other postings that tell you how to rename a PDF to make it easier to import into DevonTHINK. I've looked around and couldn't find a comprehensive way of taking a PDF, OCRing it, renaming it, and then auto-filing it into DevonTHINKPro.
