Question #147764 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/147764
Status: Open => Answered RaiMan proposed the following answer: find() cannot be used in if/elif/while, since it does not return if not found, but stops the script with a FindFailed exception. The appropriate method is exists(), which is functionally equivalent, but returns None in this case. the most compact form for such cases: click(exists(<logout-image, 0)) # , 0) means only search once, no 3 seconds wait for image this would click the match found by exists() or does nothing in case not found. or in long form if you want to add more scripting: if exists(<logout-image>, 0): click(getLastMatch()) # avoids another find() operation wait(2) # some more code # after the if -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. _______________________________________________ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp