← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #288544]: Does Settings MinSimilarity apply to exists() when using Java API?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
--- Settings MinSimilarity
applies to ALL explicit (find, exists, wait) and implicit (click(image), ...) find operations.

--- exists() ...
... indead returns null at the Java level if not found and the match object otherwise. Null from the Java level automatically gets to None on the Python level, which is equivalent to False, if used in logical expressions.

... hence this is correct:
Match m=r.exists("picture");
if(m==null)
{
  System.out.println("image not found");
}
else
{
  //Image found
}

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.