Use of a Mask

Asked by Mark McGuinn

Hi,

  I am trying to use the Pattern mask feature to search for an image. Below is the code I have written, but this code causes an exception, is there something wrong with the code?

new_img = Pattern("1577396415423.png").mask
if exists ( new_img ):
    print("found it")

The exceptions is:

[error] script [ tepm ] stopped with error in line 6
[error] java.lang.RuntimeException ( sikulix.RuntimeException: find, wait, exists: invalid parameter: <bound method Pattern.mask of P(1577396415423.png) S: 0.7> )

This is on 2.0.1 on Windows 10.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Mark McGuinn
Solved:
Last query:
Last reply:
Revision history for this message
masuo (masuo-ohara) said :
#1

Add parenthesis?
new_img = Pattern("1577396415423.png").mask
==> new_img = Pattern("1577396415423.png").mask()

Revision history for this message
Mark McGuinn (mmcguinn) said :
#2

Many, many thanks for the quick response which appears to have sorted out the problem.