Screenshot to OCR to Clipboard Macro (v9.0.6)

Screenshot to OCR to Clipboard Macro (v9.0.6)

I've never really used the OCR feature in Keyboard Maestro because it never seemed all that convenient to use.

When TextSniper came along and I realized that I could do the same thing in Keyboard Maestro with a little bit of effort.

How It Works

  1. Press a keyboard shortcut
  2. You will be presented with the usual macOS 'crosshairs' to select either: a) a portion of the screen or b) press spacebar to select an entire window.
  3. The image is saved to /tmp/
  4. OCR is done on the image
  5. The results of the OCR are saved to the clipboard
  6. A notification is sent to tell the user they can 'paste' the results.

It also tries to be smart enough to recognize if you cancel taking a screenshot (by hitting ESC) then it will not try to OCR anything).

NOTE: Requires (just a little) Configuration

  1. I use ⌥ 4 for a keyboard shortcut. You might want a different one.

  2. Also, be sure to check the OCR step to make sure that you have the language(s) that you want selected and downloaded.

Screenshot to OCR to Clipboard.kmmacros (40 KB)

1 Like

Does this do anything different to OCR – User-Selected Area Macro (v9.0.1) ?

Ah! I wish I had seen that months ago. Not sure how I missed it or forgot about it.

On the one hand, yes … they do effectively the same thing: “select an area, screenshot it, OCR it, save OCR to clipboard.”

On the other hand…my variation also saves the screenshot to a temporary file in case you decide that you want it for some reason, and it also tries to be smart about what to do if you hit esc which cancels the screencapture command.

So they do the same thing but mine has a few extra auxiliary features around.

Jeez… I could have been using that other one for the past year, though. Bummer.

1 Like

No worries - I’m not criticising! I only discovered it a month ago which was why yours jumped out at me. At least we’ve all got a choice now :grinning:

Hey tjluoma, really appreciate you sharing this, I've found this super useful. Apologies if this is a newbie question, but I'm wondering if there is a way to capture a pre-selected boundary for the screenshot (I want to grab a specific area of the screen, convert the image to text, and then copy to clipboard). My gut says I would need to change the /usr/sbin/screencapture -i -c in the shell script, but I'm not 100% sure. Any suggestions?

if you are using KM10, you might want to check this out
KM10 has simplified the ocr process just by using 3 actions.

Wow this is perfect. Thank you!


Search was so helpful in finding these 3 options, love the last one on my MacBook Pro M1 since TextSniper does not work on Monterey...

No need to wait for them to upgrade, saved some $$$.

1 Like

FWIW - TextSniper version 1.7.0 works fine on Monterey. I just used it myself.

1 Like

Thanks for that will have to download on the M1 today!