KM can't see portion of screen I just pasted into it

Hi guys, I'm having trouble with KM not able to see a screenshot I've just pasted into it.

I'm using ⌘⌃⇧4 and to get a part of the screen and then pasting that directly into the macro. But it says it can't find the image.

This macro was working fine a while ago.

If the macro editor is open at the same time then sometimes KM sees the image on screen and the one in the image well.
Try hiding the editor of collapse the action.

I have seen cases where the screenshot just has black areas on the screen. You can turn on a debug mode with:

defaults write com.stairways.keyboardmaestro.engine FindImageWriteImages -bool YES

And restart the Keyboard Maestro Engine and then and after the failed macro you can look in the /tmp folder for the /tmp/target.tiff and /tmp/screen.tiff files and we can see if something weird is happening with them.

2 Likes

Hi

The debug trick has helped me identify a matching problem I am having. Trying to match the File Format drop-down in MS Word on El Capitan public beta (could this be my problem?) Any tips to work around this are appreciated.

The debug shows why.

It sees this:

When this is what I actually see when I manually perform the actions.

Just a shot in the dark, and you’ve probably already thought of this, but could it be a timing issue? Perhaps it just hasn’t been displayed yet, at the time you checked for it?

I had that thought and set a brief pause.

I’ll try again with a longer pause.

Ok, I got it working by setting the blur to high.

The debug images are still showing as above, but it works.

Thanks for your help anyway.

EDIT: I do need a pause, otherwise it doesn’t find.

There is a bug in 7.1’s image matching which could be part of the problem - but that bug could not generate the image about. I’ve got no idea how you would generate an image like that other than a system bug. Unless you are limiting the match to a window, in which case it’s possible the extra stuff is not in the same window (which would be very weird but it is Microsoft).

Thanks, @peternlewis! I will look in to this.

@JimmyHartington, that is not the culprit this time, but thanks for the suggestion.

@DanThomas anThomas, nope, but thanks for the suggestion.