HowTo search and click a fading image

Asked by Full Name on 2018-09-18

Sorry if this question is stupid I am not programming savvy in any way and I just try to write simple scripts. I browsed around and didn't find an answer.

I want to click on a fading image that could be anywhere on the screen. The simple solution is to use

if exists(image)

However, since the image is fading sometimes the image passes the similarity threshold between the "if exists(image)" and "click(image)", resulting in a Find Failed error. Since I don't know where the icon is I can't use

if Region.exists(image)

Is there an easy way to click exactly where an image was found when you don't know where the image will be?

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Last query:
Last reply:
RaiMan (raimund-hocke) said : #1

--- solution:
if exists(image)

--- background
exists() searches the screen.
click() without specifying a region (like: simply clicks the last match of the given region, which is the screen in this case.

RaiMan (raimund-hocke) said : #2

... and another option:

    pass #do nothing if not found

Can you help with this problem?

Provide an answer of your own, or ask Full Name for more information if necessary.

To post a message you must log in.