I've been using this excellent macro just fine for awhile, but noticed today it's not working. When executed, the script displays success, but the System Clipboard ends up with "no printable characters".
After some debugging, I discovered this strange behavior. If I add a Display System Clipboard before the OCR step and a Display System Clipboard the macro suddenly works:
The trouble with this "solution" is that I end up with two clipboard displays to dismiss, making the macro more confusing and less pleasant to use.
In case you're wondering, it consistently fails unless both displays are active, so this fails with an empty clipboard…
Yikes. My initial guess is that somewhere in your system you have a KM action that is triggering on "Clipboard changed." So the first thing you should do is check for that, and disable the clipboard change macro. There's a 50% chance that will fix your problem.
Other things you can try:
Try replacing the system clipboard by a named clipboard
Try replacing "Languages English" with "Apple Text Recognition". In my opinion, you should never choose "Language English" because it's 6 times slower and has 10 times more errors than "Apple Text Recognition."
Try saving the results of the OCR action into a variable rather than a clipboard. Then display the variable instead of the clipboard.
In Sequoia, the Tesseract library Keyboard Maestro uses for most of the OCR (everything except the Apple Text Recognition) crashes frequently with a memory corruption, which almost certainly means there are very subtle bugs in the library that are highly dependent of the system state.
I'd suggest you switch to Apple Text Recognition.
I don't know if I will be able to resolve this issue with Tesseract (debugging this kind of issue would be difficult in my own code - in someone else's code is going to be virtually impossible).
Yes, in English, I would highly recommend switching to it if it is available.
Unfortunately, Tesseract supports a lot of other languages, and currently there is no support for that within Keyboard Maestro (and I don't know how good the support will be once I do figure out implementing it).
Hello.
for a language other than English (in my case Turkish);
the following process worked for me and I hope it will work for you:
First I installed Macports.
then I used the command “sudo port install tesseract-tur” to install tesseract and the Turkish language pack (it installs it with the necessary plugins). then the problem was gone. now tesseract works properly with KM.