← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #147764]: if not found image skip to --- use exists() instead of find()

 

Question #147764 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/147764

eduardobedoya posted a new comment:
Hi RaiMan
I was looking at this question
cuz I needed to script something like... if image not found then...
so, Im jut wondering,
Is there a way to do something like this???


print A
print B
if exists(<logout-image>, 3)) #wait 3 seconds
    click(getLastMatch()) #if exists click on it
print C
print D

where: print ABCD mean the workflow
so if <logout-image> doesn't exist
then do not continue with print C, print D, but instead...
App.setClipboard("image not found")
    exit()

This can only be achieve with
try
except
right??

Im just curious about this particular syntax
Thanks Advanced.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.