while not or if not

Asked by Henry

setAutoWaitTimeout(45)
MSNIMAGE= Picture #Picture can not show here.
if not find(MSNIMAGE):
   openApp("C:\\Program Files\\Windows Live\\Messenger\\msnmsgr.exe")
else:
   doubleClick(MSNIMAGE)
--------------------------------------------------------------------------------------------------------

But this program use if not find(MSNIMAGE) or while not find(MSNIMAGE)
Always stop. Can't run to else.
What can I to do fix this program.

Question information

Language:
Chinese (Traditional) Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

find() cannot be used in decisions, since in case not found it raises FindFailed exception and ends script.

use exists() instead. returns match if found and None otherwise.

Can you help with this problem?

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

To post a message you must log in.