← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #186195]: Using text() to get text in dragDrog area

 

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

    Status: Answered => Open

Yiping Wang is still having a problem:
Yes, I read through the docs. and I also completed my codes to reach the
target. The way I am extracting text from dragDrog area is
"type("c",KEY_CTRL) + Env.getClipboard()". The code works fine usually
(I am aware of the bug with past() for Env.getClipboard and skipped the
error). But it sometimes encounters I/O error for Env.getClipboard and
works fine again after I re-excute it.

The issue is, Env.getClipboard() is frequentlly used in my code, and it
takes long time to run this program. I don't want to wait for a long
time and re-excute it again after the error happens, so I am thinking
that Region.text() should be a good solution to replace
"type("c",KEY_CTRL) + Env.getClipboard()". However, when I tried
Region.text(), I found that dragDrop is an 'int' object and can't be set
as a region.

I know that if I could get area by dragDrop(pic1,pic2), then I could get
location for all realtive positions to set the area as a Region.
However, it makes code very long and difficult to be read. May I know is
there any way to make dragDrog be set as a Region directly?

I am sorry to use wrong way in asking question. And thanks a lot for
your time and attention. ^^

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