how to use "if exists"

Asked by peter hasselby

in want sikuli to run following

click(Location(57,1048))
if exists (Image)
      click(Location(343,49))
if not exists:
   click(Location(1891,10))

im new to this. I think it can be solved rather easily, I just dont have the knowlegde to solve it. plz help.

Question information

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

Sikuli "talks" Python.

if exists (Image):
    click(Location(343,49))
else:
    click(Location(1891,10))

There are some faqs about basic Python "you-should-know-how..."
https://answers.launchpad.net/sikuli/+faqs

Revision history for this message
peter hasselby (peterhasseldk2003) said :
#2

Thanks RaiMan, that solved my question.