← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #186489]: Getting multiline text

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
do the matches returned by findAll("1328085716304.png") have the
position and height, so that the region m.right() contains the text
lines as you expect?

You might visualize it using:

x=list(findAll("1328085716304.png"))
for z in x:
    sleep(0.2) # not necessary
    m = z.right()
    m.highlight(2); wait(1)
    print m.text()

the wait(1) is needed to wait for the red frame to vanish (otherwise
disturbs the text() feature)

another optimization:
limit the right(), so that it only extends to the end of the text (+some margin):
e.g.
m = z.right(200)

your m = z.right().text() might contain something on the far right side,
that irritates the OCR feature.

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