A workaround when click at found image does not work

Sometimes click at found image does not work for obscure reasons. For example, I wrote a macro in which I had to double click on the DevonThink "smart group" called _Inbox Search (what I am clicking on is irrelevant) but the action did not work.

I could not use move and click mouse because the coordinates vary.

I had the idea of adding a lightbulb emoji at the end of the title and using that emoji for the click at found image action, which worked.

I mention this in case it might help forum members facing similar issues.

4 Likes

Good idea. I, too, have used that approach to solve problems like this. And don't forget that you can use the numerical offsets to get the mouse to click on areas that are outside the bounds of the found image. In your example, you could use an X offset of -50, which would get the mouse to click on the word "Search."

I have also used a similar approach to solve problems with Apple's OCR. While Apple's OCR is stupendously accurate and powerful, it does have one small problem: it almost always refuses to read text if the text is only a single character. It needs more than one character before it is willing to return results. Most of the time that's fine, since I'm usually reading multiple characters, but sometimes it refuses to read a number if that number is from 0 to 9, because that is a single character. So what I've done in cases like this is get the original program to append extra digits, like formatting the number with an extra decimal of precision. So for example, instead of displaying 0 to 9, I get the program to display 0.0 to 9.0. Then Apple's OCR will not fail to read it.

4 Likes

very interesting comments. Thank you very much

  • numerical offsets outside the bound of the image: I did not think of it. It's very useful. I have a related question: it's always very tedious for me to calculate the offset. I do it with trial and error. Do you have a more efficient technique ?

  • I use the text sniper app for OCR and did not know about Apple's OCR. Where do you find apple's OCR and how do you use it ?

There are several ways to calculate offsets. One of the best ways is to use the KM Editor and click on the menu Window / Mouse Display. That will show you the location. If you do that, you may still have to mentally subtract one number from another to get the offset. As for myself, I usually press CMD-SHIFT-4 and then I see the coordinates where the mouse is, and I speak out loud to my HomePod "Hey Siri, how much is 725 minus 648" and Siri tells me the difference. I use Siri a lot to calculate offsets this way.

Apple's OCR is directly accessible in KM by setting the language to Apple Text Recognition. Just change the "Language" in this action...

Let me express my opinion that Apple's OCR makes far fewer mistakes than the OCR engine previously built into KM. And Apple's OCR is about 5 to 10 times faster too!

1 Like

Hi, @ronald. I often use PixelSnap 2 for this task. If you have Setapp, it's included in the subscription.

Another options is to use a macro I just shared: Get Mouse Coordinates

I use TextSniper too. It's great: fast, accurate and has some nice options. It's also included in Setapp.

1 Like

You've got KM. KM can detect the current mouse position, and KM can do subtraction -- all you have to do is work out a non-disruptive way of capturing the values you need when the pointer is where you want to start and where you want to end.

Have a go and see how you get on.

Edit to add:
I see @_jims has already posted something -- don't let that hold you back :wink:

thanks very much. You are full of ingenious ideas. I will try Siri with my iPhone.

I don't have setapp and will install your macro. Thank you very much.
Just curious: what Textsniper options are you referring to ?

1 Like

For completeness -- I was thinking of something like:

Get Offset.kmmacros (5.7 KB)

Image

No where near as featureful (or as pretty!) as @_jims's excellent macro. But with only seven simple actions it does show how quick and easy it is to scratch a particular itch with KM.

4 Likes

Hi, @Nige_S. Hands down, you win on functionality per action! I had forgotten about %CurrentMouse%; I'll refine mine to make it a little more efficient. Thanks for sharing.

2 Likes