But it adds all of the options available to tune accuracy in Apple's Vision framework. Mouse over the input fields for descriptions of their effects.
And if you're using Text Toolbox II, you can easily add this macro to that menu bar palette. We added a new macro named 77)OCR Image and used Execute a Macro to link this macro.
The File option seems to work fine but I'm stumped why the Clipboard option just returns PNG for a PNG screenshot. The original code run from Script Debugger exhibits the same behavior so it's probably how I've been testing.
If it works for you, I'd appreciate knowing the trick.
The language options allow selection of a main language and multiple secondary languages. To select more than one secondary language, hold down the Command key.
Thanks but the macro you've uploaded is incomplete without the Run OCR Shortcut.
But even running Shortcut's OCR macros (and I've tried several), I've never gotten it to work on my system. Hence my AppleScript embed on the Vision framework. Which does work and gives you finer control of the results by opening up Vision's options.
The Shortcut OCR Clipboard isn't included in your macro, @noisneil, but I do have one such two-action Shortcut in my collection. It does nothing but report the file name of the image on the System Clipboard on my unsupported hardware (much like the Clipboard option of my macro).
I've tried various ways to copy an image to the Clipboard (and the Clipboard History Switcher shows them as images) but none of these approaches reads the image data on my clipboard.
A problem, I emphasize, that's probably unique to me running Monterey on unsupported hardware. Although, if there's another way to get an image on the clipboard, I'm all ears.
Thanks, @noisneil and @jackk. I have that Shortcut (which I just downloaded again) but it doesn't work on my unsupported system for some reason. And it isn't just the Shortcut but the AppleScript in my macro that reads the Clipboard.
Does that Clipboard option in my macro work on your system? That would confirm the problem is mine alone.