Categories
Technology Tools

Automatic OCR with Hazel: The Easy Way

I have previously written about how to run OCR (Optical Character Recognition) on a PDF using Hazel and… a complicated pile of Python scripts and other software. Since I wrote that post, several of those pieces of software have been updated, and the core component has been, apparently, entirely abandoned.
Recently, while I was waiting for yet another keyboard replacement on my MacBook, I took another look at the OCR thing and found that there’s a much easier way available: OCRmyPDF.
It’s easy to install, assuming you’ve already got brew: brew install ocrmypdf
From there, it’s just a single action in Hazel. “Run embedded shell script: ocrmypdf $1
Admittedly, you can use some of their many settings to get something a bit nicer than just OCR; personally, I’m using --rotate-pages --deskew --mask-barcodes – the first two to help with variations in the input because I sometimes use a bed scanner, and the latter to help Tesseract, which can have issues with barcodes..
I’ve also paired it with a couple additional actions, just to keep everything organized:

I also took the time to stop using Dropbox as the go-between for my scanner and the Mac running Hazel; I’d forgotten that the scanner has a USB port. Plug in a cheap flash drive, and it’s available as a (very slow) file server. Mount the drive, add it as a Login Item so it’ll auto-mount on boot, and you can set Hazel automations to run right there. I’m not OCRing them there, though — like I said, it’s a very slow server, so it tags them ‘for OCR’ and moves them to my desktop.1


  1. With iCloud Drive handling my desktop, I’ve found it to be a pretty great ‘intake’ folder for all of my Hazel automations. It’s quite nice to be able to save a PDF from my phone, add a tag, and watch it disappear again as it’s auto-sorted, or throw a PDF on my desktop with a tag and see it pop in and out as the OCR runs. 
Categories
Articles Education Tools

Productivity and Organization

Over time I’ve acquired a reputation for being an organized (and, presumably, productive) person; occasionally, people ask me for tips.

Be as efficient as you can.

In the interest of following my own tips, I’m writing this up as a blog post so I have something I can quickly send to folks when they ask. Automate things where you can; if you’ve got the time to learn it, Workflow is a wonderful tool.1 I’ve got a good chunk of my morning routine compressed into pressing a single button on my phone and, depending on how complex my calendar is for the day, answering a question or two.

Don’t trust your brain to remember things

The human brain is a wonderful machine! Unfortunately, it’s terrible at remembering things, but also convinced that isn’t the case. The good news is, we invented writing, and then computers, both of which make it much easier to remember things. So don’t just put stuff in your head and assume it’ll stay there; it doesn’t matter what you use, but have somewhere permanent that you can put stuff. Depending on what you prefer, you can use a planner or notebook, or go all digital like I have. Personally, I use a combination of the system-default Calendar app, syncing through Google Calendar, with Drafts 42 as my “writing thoughts down in the middle of the night” app, Day One as a journal, and Ulysses for any longer-form writing or note-taking.3

Have a to-do list

Technically speaking, this is an extension of the above, but don’t trust yourself to remember things you have to do in a day. If they’re at a specific time or meeting with someone, they go in your calendar; otherwise, they go on the to-do list. Again, this can be on paper if that’s your style, but if you’re a big ol’ tech nerd, you’ve got a bounty of options. The built-in Reminders app is… there, and it’s not great, but it’s free and meets the bare minimum of functionality. Personally, I’m a big fan of Things 3,4 but Omnifocus is also a big name in the field, if (in my opinion) over-complicated. That said, task management apps like that are a huge market on the iOS and macOS app stores, as well as just online, so you should be able to find something you like.
Once you’ve started using it, I recommend the “vaguely Getting Things Done” style, which consists of “write stuff down as soon as you think of it, and file it away in the proper place when you’ve got time.” The important thing is to not go “oh, I’ll remember that later,” because there’s a really good chance you won’t.

Figure out what you’re spending your time on

You know that feeling like you’ve wasted a whole day? That’s stupid, but it’s also hard to convince your brain you’ve been productive if you don’t actually know what you’ve been spending your time on. Having a to-do list helps with this; you can look at your list for the day and see all the things you’ve checked off.5 Beyond that, you may want to try time tracking; I’m a fan of toggl and use it all the time. I keep the website pinned in a tab on my laptop, and rather than use their app, I’ve got some Workflows built that interact with their web API.6 It works pretty well for me; I know what I’m spending time on, and I can also use it for some very accurate billing, should I need to.

Clean up

Finally, staying organized is not only helpful for quickly finding things, it also just tends to make you feel better about everything. Take time when you can to organize your work and living spaces. If you’re currently in college, you’ve probably got ten thousand pages of various papers drifting around; next time it’s time to buy textbooks, I recommend going digital (it’s slightly cheaper, and then you only have to carry around your laptop/tablet, which you were probably gonna be carrying anyways, and you can search in your books, which is quite helpful). For the zillions of pages of handouts you get, invest in a scanner that can do duplex scanning and a recycle bin; it’s amazing how much space you can save by getting rid of all the papers.7 Once you’ve got things digitized (or, preferably, as you get them digitized), come up with a neat organizational system and stick to it. For school stuff, semester/term lines are a nice dividing line; if you’re doing the whole ‘adult life’ thing, the tax year is a good one.8

I’m going to call it done there. If you skipped to the end, the single most important thing I’d like you to get from this is brains are bad at remembering things; write stuff down. That’s my number one tip, so if you only take one thing from this, that’d be it.
If you’ve got any questions, I’ve recently brought back the ability for people to leave comments, so go ahead and do that.9 And hey, maybe I’ll do more posts like this, I enjoy doing the writing, and it’s fun to be able to support the various apps I use.10


  1. In September 2018, or thereabouts, it’s going to disappear and be replaced by Shortcuts, but from what we’ve seen in public betas, Shortcuts has the same functionality, some new features, and a new coat of paint, so if that link doesn’t work, just search the App Store for ‘Shortcuts.’ 
  2. Drafts 5 has been out and received very good reviews for its automation capabilities, but all I really want from the app is a dark color scheme and the ability to open directly into a new document, so the old version works for me. 
  3. That link is to Ulysses’ iOS app, but thanks to their subscription system, you pay for it on one platform and get it on iPad and Mac as well; mostly I use it on the Mac, but it’s nice to have it available wherever. 
  4. That’s their macOS app; they’ve also got separate iPhone and iPad apps. 
  5. This is why I’ve got Things set up not to sweep things away as soon as I check them off, but to leave them there until the end of the day. If I look at my list and it’s empty, nothing to do and looking like I’ve done nothing, the “oh god I wasted the whole day” feeling gets so much worse
  6. If you’d like to know more about those, leave something in the comments that I’ve just remembered I opened back up. 
  7. You don’t necessarily need to do what I did, which was a roughly five-year-long process of clearing out every paper I own, but then, you’re hopefully less of a pack-rat than I was, too. 
  8. Oh, and don’t leave those files in a single place; the nice thing about being digital is that it’s easy to make copies, and when you’ve got copies, you don’t have to worry that you’ll lose the original. These days, I throw all the current stuff into iCloud Drive, but I used to use Dropbox; older things get moved from whichever cloud to an external hard drive that’s backed up with Backblaze
  9. It’s one of the only ways to get in touch with me. Bonus productivity tip, for those of you reading the footnotes: social media sucks, stop using it. 
  10. Shameless self promotion: as an app developer, I know how danged hard it can be to actually make a living from the App Store. Support the people making the stuff you use.