OCR now works better in conditions

KM v11.0.4 has changed which "brand" of OCR the KM Engine uses for its conditional tests. I've tried it out, and it is now a little over 100% faster, due to the fact that Apple OCR is faster than Tesseract. I can now change all my existing code to conduct the test in an IF statement instead of creating an extra OCR action and testing the result of that action using a text condition.

Thanks, Peter.

4 Likes

Thanks for posing this. Is there anything you would change with the following?

Using Apple Text Recognition (Pre Keyboard Maestro 11.0.4)

image

Or is it just stuff like this that would end up being better?

Screen Capture

You are already using Apple's OCR in that action, so there is nothing to speed up. However when I do that sort of thing, I just use KM's built-in clipboard change trigger to capture screenshots, rather than capture the screenshots using a KM action.

Your second piece of code isn't even using OCR, so it would be unaffected.

I'm not sure if you understand what has been improved by this change. Here is an example of code that will now run over twice as fast:

image

I am not sure I follow what you would change to get the same results but it sounds nice and native which is usually a plus.

Oh, gotcha, thank you for explaining and with a visual example as well. Very helpful!

I am talking about doing this:

If you do it this way, then there's no need for putting screen captures into a KM macro.

2 Likes

That is great. I just replaced that with my screen capture for text, and with the clipboard manager, I can get both every time. That is handy; thanks for sharing.

I hadn't gone through all those If statements for the clipboard before. There are so many great things to go through and try to remember. I am glad there are solutions to most things we can dream up.

1 Like