exists returns true even if the image doesnt exist

Asked by albertsag

I have written a script to handle an image, lets say named popup. these are the steps i followed:
1. open a window and see if this popup exists:
if popup: do this.
else: do this.
 the problem is, it works fine if i run it the first time but, if you are running it loops/recursively it starts finding the image popup even if popup doesn't exists. I tried highlighting it and it seems to be getting a ghost image. So, even if the image popup doesn't exist it is getting into the "if popup:" section always and getting errors even if I want the script to enter the else: part instead.

PS:
I have not defined any region, instead I have used the whole screen.
And yes, there is absolutely no image(popup) and I have used similar(0.9), and there is no room for it to find an accidental image similar to popup on the screen.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
albertsag
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

did you already use highlight() to see, what SikuliX thinks to be a match?

Are you sure that 0.9 is enough?

Revision history for this message
albertsag (albert-sagolsem) said :
#2

I used highlight and found out what it was. Neways, thanks.