Select text on a page

Asked by Maxo K.

Hello,

I am trying to select a text on a page to copy it afterwards, but I am trying to accomplish it in a bit different way. I want to select the text starting from a specific Region upto end of the page, which is around 5 pages. I have defined the starting point for select as:

Region.click(Image)

Now I want to use wheel(WHEEL_DOWN,10) while I have the Mouse Left Button Pressed, so it can really copy the text.

How can I accomplish this?

Best Regards,

Maxo

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Maxo K.
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

try mouseDown(Button.LEFT) before your wheel action and mouseUp() afterwards.

http://sikuli.org/docx/region.html#Region.mouseDown

Revision history for this message
Maxo K. (malkhaz) said :
#2

I have tried that already, but could not make it work. Is there any way I can chain those two together? Like wheel(Wheel_DOWN,10) while mouseDown(Button.LEFT) ?

Revision history for this message
RaiMan (raimund-hocke) said :
#3

the sequence has to be:

click(Image)
wait(1) # always a good idea with mouse actions (0.3 - 0.5 might be sufficient)
mouseDown(Button.LEFT)
for i in range(100): # insert your needed value
   wheel(WHEEL_DOWN,10)
mouseUp()

If this does not work, you could try to use combination
keyDown(Key.SHIFT)
click(<some-intelligent-location-at-end-of-doc>)
keyUp()
after having wheeled down to end of doc.

even a ctrl/cmd-a (select all might be worth a try.

Revision history for this message
Maxo K. (malkhaz) said :
#4

I see. Thanks a lot RaiMan. The second alternative will work for sure, but I will try both. Thanks a lot.