Search for screen image in specified radius of cursor. Possible?

I'd like to limit a screen search relative to the cursor location. Is that possible?

Reason: There are two columns with identical icons. I want to limit the search to the right column. If I could limit the search to half the active Chrome window that might work too if that's possible.

The macro would find the "Topmost" icon in the right column and move to it or click it.

would this work for the mouse location?

and possibly this for half the current window?

2 Likes

Yes. Choose "Relative to Area" and enter offsets relative to the current mouse location. For more info, see Found Image .

Thanks. Was just experimenting with that:
image

I'll have to set it up for each user since their configuration vary, but it works. I'll experment with offset based on mouse location as well. Thanks.

Instead of relative to the frontmost window, you can use MOUSEX and MOUSEY functions.

1 Like

That's a great help. Thank you, Troy. I'll try it tomorrow.

No, it won't work. :wink:

@troy, I know it is confusing concerning when to use KM Functions vs KM Text Tokens , but the general rule is:

  • Functions can be used only in Numeric Calculation Fields
  • Text tokens (as indicated by any text between the % delimiters) can be used only in Text fields

So, since %CurrentMouse% is a text token, it can not be used in the area numeric fields.

Even if it could, it does not return the proper data. It returns two values separated by a comma:
<x position>,<y position>
as in
5064,1022

That is why, in this case, you need to use the MOUSEX and MOUSEY functions.

The clue is that the text turns red when you enter an illegal term.

image

1 Like

@JMichaelTX thank you for the description.
I thought that since it didn't turn red it was ok, but I didn't 'run' the macro, and also IF I had thought about it, I would have realized that the current mouse is an XY as you kindly reminded me =) . as always, thank you....