I am currently evaluating ways to automate OCR for PDFs and I'm running into some quirks that I could use some help with. Currently I'm basing my workflow off the following link: http://katiefloyd.com/blog/automaticall ... and-pdfpen
My rules are quite simple:
Extension is PDF
Size is greater than 10KB (to skip over corrupt PDFs)
Tags does not contain "ocr"
If all match, we do the following:
Run Apple Script (which is in above link)
Add tags "ocr"
Currently the workflow is working great, immediately going to work when I drop about 20 files in. The problem I'm running into is it will skip certain PDFs that it shouldn't, giving me an Hazel error saying it cannot execute the Applescript. What's strange is when it finishes going through the 20 files or so I'm testing with, I can rerun rules and Hazel will pick up the remaining items it skipped over. My last run I had to run Hazel manually 2 more times for it to finish the folder. At no time did it start back up again and start running rules on skipped files. I went and grabbed the log from Hazel and below is what it is saying:
2016-11-11 11:53:26.905 hazelworker[82849] OSAScript error: {
NSLocalizedDescription = "PDFpen got an error: Connection is invalid.";
NSLocalizedFailureReason = "Connection is invalid.";
OSAScriptErrorAppAddressKey = "<NSAppleEventDescriptor: [0x0,105c05b \"PDFpen\"]>";
OSAScriptErrorAppNameKey = PDFpen;
OSAScriptErrorBriefMessageKey = "Connection is invalid.";
OSAScriptErrorMessageKey = "PDFpen got an error: Connection is invalid.";
OSAScriptErrorNumberKey = "-609";
OSAScriptErrorRangeKey = "NSRange: {0, 0}";
I'm not really sure what to make of it, and it's likely not a Hazel problem but an issue with PDFPen or the AppleScript. The only thing that comes to mind is PDFPen is working too fast or data is coming into fast. Anyone have any ideas of where I should look?