KM9 Can't Find the Image

I have 1 cpu still running versions 8
It runs the macros fine, all 'click at found image's' work correctly.
My cpu running version 9 with all 'click at found image's' set to unique - do not work.
When I change them to 'best' they work.
I have over 60 macros with click at found image actions
within my 1600 macros.
I'll need to go thru them and change them manually.
It can be done.

One thing to check is the fuzz level. Although I don't think it should have, it is possible the fuzz levels have changed slightly in v9. If so, an image that was unique in v8 might not be unique in v9. With Display on, this would show up as multiple orange images with similar fuzz levels.

If you can create an appropriate macro that I can specifically test with existing images on the screen, then I am happy to take a further look.

I appreciate your offer Peter,
At this point I've changed all of my image actions to 'best' and they work fine.
Great software, great forum, thank you.

Count me in with this issue. Apple Menu every time. All of these same macros worked perfectly before KM9 upgrade.

The relevant entries from engine.log reads:

2019-08-19 17:10:04 Execute macro “Spark - Add Signature” from trigger The Hot Key ⌥Space is tapped twice
2019-08-19 17:10:06 Move or Click Mouse no unique image found.
2019-08-19 17:10:06 Move or Click Mouse no unique image found. Macro “Spark - Add Signature” cancelled (while executing Move and Click at (0,0) from the Center of the Found Image).
2019-08-19 17:10:06 Execute macro “Spark - Add Signature” from trigger The Hot Key ⌥Space is tapped twice
2019-08-19 17:10:08 Execute macro “Spark - Add Signature” from trigger The Hot Key ⌥Space is tapped twice
2019-08-19 17:10:08 Move or Click Mouse no unique image found.
2019-08-19 17:10:08 Move or Click Mouse no unique image found. Macro “Spark - Add Signature” cancelled (while executing Move and Click at (0,0) from the Center of the Found Image).
2019-08-19 17:12:37 Execute macro “Spark - Add Signature” from trigger The Hot Key ⌥Space is tapped twice
2019-08-19 17:12:38 Move or Click Mouse no unique image found.
2019-08-19 17:12:38 Move or Click Mouse no unique image found. Macro “Spark - Add Signature” cancelled (while executing Move and Click at (0,0) from the Center of the Found Image).

I've increased fuzziness: no luck. If I had to I could redo all of the screen grabs, but wow, what a PITA that would be. :flushed:

@dashard , I found that changing the pop up from unique to best fixed all of my errant macros.

Months ago (KM v8) I had some mouse macros and I saw my mouse moving, unexpectedly, near to the Apple menu. Similar to what I'm reading in some posts here. My issue may have been unrelated to this week's problem, but it may provide a clue as to what's causing it now.

It turns out what caused it was that my action had the wrong setting regarding the "relative to" part of the Move Mouse action. When you switch that part of the action, the action sometimes ends up sending the mouse to a very different location, but because the mouse MUST stay on the screen the action keeps the mouse along the edge of the screen which is the closest location to the user's new mouse placement numbers.

In fact, you don't even have to switch the "relative to" part of the action for this effect to occur. All you have to do is change which window is active. Eg, if a different window is active, then the statement "Move Mouse to +100, -100 points relative to the top left of the front window" would send you to a different location. And sometimes that could end up being off screen, which could push the mouse to the Apple menu corner.

Perhaps this problem could be detected if the KM action actually caused an error when the numeric value of the mouse location would take the mouse off screen. The action does have an error test, but the test does NOT cause the action to fail if you try to send the mouse off screen. Perhaps that should be making it fail, at which point the location of the bug would be more apparent. Making this change could make a lot of people's macros fail so I doubt Peter would make that change, but he could make it a change that only takes effect if you click on an option in the Preferences window.

Looking at the code, I cannot see how it both reports that error and also simulates a click.

Send me (support@stairways.com) the “Spark - Add Signature” macro, ideally together with your “Keyboard Maestro Macros Saved Version 7.plist” (which despite its name should have a recent modification date) so I can see if there is any issue in the upgrade process.

Peter,

See attached the macro. Using the current working fix of changing the 'unique' setting to 'best' has fixed this for me as well. Just note that the macro settings are now 'best,' but the logged failures were using 'unique.'

Also, there are two images sequentially which was a kind of debugging test to see if KM wanted a new/updated image. Didn't seem to matter.

Best —AD

Spark - Add Signature.kmmacros (38 KB)

(Attachment Keyboard Maestro Macros Saved Version 7.plist is missing)

OK, looking at this:

image

The first action has Notify/Abort turned off and the second one exhibited the behaviour described (clicking in the Apple menu).

So in this case, if the first one was failing, and the second one was resulting in a non-unique match, then that would explain getting the error messages in the log (from the first one), and then the second one fails because it was non-unique, but still clicks (but on the Apple menu because it failed).

I have fixed this, so it now properly fails if the click is not unique. But I still do not understand the behaviour change. That said, the fuzz on this action is very high, so it is not surprising that it matches several images. What I don't understand is why it would have worked in v8, although it is possible the fuzz levels have changed somewhat.

Turning on Display with the actions showing, the second action shows 0% fuzz for its own image, and 20% fuzz for the image in the first action, both of which match, hence it fails to be unique.

Changing this to "Best" should not be necessary, just dropping the fuzz levels down below 20% should be appropriate. Unless this really is trying to match something that requires that level of fuzz, but in that case you are likely to get false matches because that really is set to a very high fuzz level.

I presume the Find Image code was something you did not write yourself, but comes from some GPL licensed software on the web. Maybe you upgraded the GPL code for your v9 release.

The fuzz is always on the default (20%?). The only reason the fuzz was increased here was for troubleshooting, though point noted.

As noted in the forums, changing nothing but "Unique" to "Best" fixed it. FWIW.

I have a macro based on Click at Found Image. Worked fine until upgrading to KM9.

Switching from "Unique" to "Best" solved the problem.

I tried several things before that. Added some pausing. Refreshed the image. Nothing worked. Then I searched the forums, found this thread, and switched to "Best" match. Problem solved.

This fixed this bug for me as well.
However finding/making all those changes 1 by 1 is a big deal.

AFAIK all my "Unique" settings should now be "Best" to make my KM v9 macros work like they did in KM v8

No, this is incorrect - this will not behave like Keyboard Maestro version 8, since it will lose the safety of requiring uniqueness or a single match that is much better than all others.

Generally, the only cases that should have worked in version 8 and not in version 9 are cases where:

  1. A single match was much better than all the others.
  2. Nonetheless, the fuzz was not set at an appropriate amount to ensure uniqueness.

Thus in such cases, those macros were always going to be fragile, since version 8 had no alternative but unique matches.

So in cases that worked in version 8, adjusting the fuzz should always resolve the issue.

Peter, I think maybe you, or maybe all of us, are missing something here. :wink:

I have a number of Found Image macros where there is ONLY ONE image on the screen that could possibly match the image in the macro, and the fuzz level was set fairly low. But even those macros failed after upgrading to KM9. Simply changing from "unique" to "best" solved the problem and I've never had an issue with them since.

OK, so configure it to unique, turn on Display and report what you see.

Since they are all working fine now, I'm gonna leave well enough alone. :wink:

But the next time I build a new macro with Found Image, I will do that.

After following all of the suggestions here, I am unable to get the Click at Found Image action to work at all. I tried on this page as an example because the images are so unique:

https://playworksheet.com/file/shapes-colors.jpg

I used this action:

and got this "no unique image found" error:

image

I played around with many of the settings including fuzzy image and I made sure to trigger the action while that web page was open and even tried multiple web browsers, but no joy. Any help greatly appreciated!

Thanks to Frans for the fix found here that worked for me:

Find Image - Not Finding Anything Useful (Big Sur)

2 Likes

Hey @bcassidy,

You're using Google Chrome right?

There's a bug that prevents Keyboard Maestro from properly seeing its front window.

Here's the work around:

Google Chrome ⇢ Click at Found Image in Front Window v1.00.kmmacros (37 KB)

-Chris

1 Like