← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #162592]: How to Copy text from a regions?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
OK, this is some rendering difference between our 2 browsers (mine:
Safari on Mac).

you might easily adjust this by adding a correction for the x coordinate
of m:

m=find(sik).below(42).left(1).right(600)
m.x = m.x - 10
m.highlight(3)

or you might insert another left():
m=find(sik).below(42).left(10).left(1).right(600)

--- I tried changing the value of Left() to 0.5 and even -100, but it won't move it.
Sorry, the left(1) is a hack. same goes for the use of above(1) ;-)

the goal is to get a region of hight 42 and a width of 600 below the
match of the sikuli logo.

you might do it this way:

s = find(sik)
m = Region(m.x-10, m.y+m.h, 600, 42)

I prefer the above notation, since it is more readable.

m=find(sik).below(42).left(10).left(1).right(600)

in words: find the sikuli logo and then make a region below the sikuli
logo with height 42 and then make a region left of this with the same
height and width 10 (this adjusts the left border) and then make a
region left of this with the same height and width 1 (I take a 1 as
width to "show" it is the hack, this finally positions the left border
reference) and then make a region right of this with the same height and
a width of 600.

--- Also how did you get those values of below() left() right()?
Try and error or a screen shot tool, that shows coordinates.
see faq 1686

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