Exist - Location

Asked by Jeff_Vallis on 2018-08-10

1.1.3(2018-06-07_14:48)/Linux4.15.0-29-generic/Java8(64)1.8.0_181-b13

My Problem is either a bad Graphics Card or Low Memory

A screen display after some tiome will develop vertical lines

My Script does
if exists(Image):
    v_Location = find(Image)
so that I can obtain the x and y cords of v_Location

My Problem is that sometimes the exists finds the image while the find fails with an error including :Last seen at ( and the location of the exists (I think)

Can I obtain the coords of the location from the exists by somehow using getLastMatch()

I know its not a bug just an old laptop that I am running Linux on - smae code runs fine on my MAC

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2018-08-11
Last query:
2018-08-11
Last reply:
2018-08-10
Best RaiMan (raimund-hocke) said : #1

v_Location = null
if exists(Image):
    v_Location = getLastmatch()
if not v_Location:
    print "we have problems"
    exit(1)
print v_Location

... should do what you want.

in any case: use 1.1.2 or even better 1.1.3

Jeff_Vallis (vallis-pj) said : #2

Update
getLastmatch() needs to be
getLastMatch()

Thanks for the pointer to it
Syntax is
To access these attributes use region.getLastMatch() or region.getLastMatches() respectively.
but that was easy to find with google