Comment 1 for bug 518011

RaiMan (raimund-hocke) wrote :

# --------------------------------- a script to test it
img =( ) # its the apple logo ;-)

# standard find whole screen
tf = find(img)
print tf
print ">>> with find: x = "+str(tf.getX())

# standard find upper left corner only, match from find.region
ts = Subregion(0, 0, 200, 200).inside().find(img)
ts = find.region
print ts
print ">>> with find_inside_region using find.region: x = "+str(ts.getX())

# standard find upper left corner only, using mach directly
ts = Subregion(0, 0, 200, 200).inside().find(img)
print ts
print ">>> with find_inside_region using find.region: x = "+str(ts.getX())

# --------------------------------- the result
capture: java.awt.Rectangle[x=0,y=0,width=1920,height=1200]
1 matches found
Match[470,122-25x24 1,00]@/var/folders/C9/C9+A8gl7F9GRQtCP6jc+VU+++TI/-Tmp-/sikuli8773201938289071842.png
>>> with find: x = 470
[sikuli] SubregionJ: 0,0,200,200 edu.mit.csail.uid.SikuliScript@10b755d
capture: java.awt.Rectangle[x=0,y=0,width=200,height=200]
1 matches found
Match[470,122-25x24 1,00]@/var/folders/C9/C9+A8gl7F9GRQtCP6jc+VU+++TI/-Tmp-/sikuli8773201938289071842.png
>>> with find_inside_region using find.region: x = 470
[sikuli] SubregionJ: 0,0,200,200 edu.mit.csail.uid.SikuliScript@10b755d
capture: java.awt.Rectangle[x=0,y=0,width=200,height=200]
1 matches found
[Match[16,1-25x24 1,00]@/var/folders/C9/C9+A8gl7F9GRQtCP6jc+VU+++TI/-Tmp-/sikuli2547078643922503913.png]
[sikuli] [Error] source lineNo: 17
[sikuli] [Error] Traceback (innermost last):
  File "/var/folders/C9/C9+A8gl7F9GRQtCP6jc+VU+++TI/-Tmp-/sikuli-tmp3351939762081648958.py", line 17, in ?
AttributeError: getX