How Do I Use the New "Prompt for Screen Rectangle" With OCR?

In the announcement thread, Peter said that

Version 10 has a new action that allows you to select an area on the screen, and combining that with the OCR facilities allows you to OCR any area on the screen.

I'm sure it's a silly question, but how do I use the new prompt in conjunction with OCR? The OCR action doesn't seem to allow variables as an input.

There is a macro example in the Macro Library, just import that.

But to answer your question, you use the Area variant of the OCR action, and use the variable in that.

image

4 Likes

Thanks, Peter! Also, congrats on the major update :smiley:

1 Like

I just imported that Library and I'm not getting back the selected area but this instead:

Any ideas? I'm still on Big Sur with KeyboardMaestro 10.0.1.

Thanks!

That just means Tesseract did not produce any text.

Tesseract seems to frequently give that warning, and Keyboard Maestro silences the warning if (and only if) if gets any useful output from Tesseract.

If it gets no result, then it lets the warning through, just in case the warning actually has some real meaning (which it probably does not).

Basically, Tesseract is failing to return any result, so check the image are you are capturing, check that you can actually capture the area, and maybe Tesseract simply cannot process the text in that image.

I think I misunderstood the Macro. I assumed that it'd capture the screen area of the frontmost application, but it seems like that this action is capturing the screen without anything in the front, so just my wallpaper.

I added another action to do a screen capture from the imported Library Macro and I can only see my Wallpaper there whilst I had Safari with this forum post open to OCR it.

That is a sign that Keyboard Maestro and Keyboard Maestro Engine do not have Screen Recording permission.

See: Screen Recording Permission assistance.

You are free to use the OCR in KM, it works for many purposes, but I've been advocating people switching to the OCR in Monterey, so you can learn about how (and why) to do that here:

Allowed Screen Recording, thank you! Works perfectly now.

2 Likes