how to copy

Asked by milin agrawal

hi
i am having a query.
i want to copy 1 content and paste it on the screen which will b coming after 3 pages,so how can i do it in sikuli ?
plz help me out.

also plz let me no how to highlight the content for selecting it
eg-
i want so select " word " so for that 1st i have to highlight it.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1
Revision history for this message
milin agrawal (milin) said :
#2

i want to copy "US_16760"
and then paste it after 4-5 steps
and still i am unable to copy,
US_16760 it is a request id n if i'll click on this i will get in,that i dont want.i just want to copy it.

Revision history for this message
milin agrawal (milin) said :
#3

i want to copy "US_16760"
and then paste it after 4-5 steps
and still i am unable to copy,
US_16760 it is a request id n if i'll click on this i will get in,that i dont want.i just want to copy it

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

no need to click, just move the mouse to an adequate position before the text.

an example with this page:

gets the second word "Code" from the top menu

m = find(<image-of-sikuli-logo-top-left-corner>)
start = m.getCenter().below(17).right(116) # should be adjusted accordingly
hover(start)
mouseDown(Button.LEFT)
keyDown(Key.SHIFT)
wait(0.5)
mouseMove(start.right(45))
mouseUp()
keyUp()
type("c", KEY_CTRL)
print Env.getClipboard()

Revision history for this message
milin agrawal (milin) said :
#5

see when i hv written the code like this

m = find( )
hover(img)
wait(0.5)
type("c", KEY_CTRL)
find(image)
type("v", KEY_CTRL)

"c", KEY_CTRL this line is copying in the bar
and then i replace that line with the expected line,then it is giving error

Revision history for this message
milin agrawal (milin) said :
#6

m = find( )
hover(img)
wait(0.5)
type("c", KEY_CTRL)
find(image)
type("v", KEY_CTRL)

just suggest me how to copy content in the bar

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

did my given example run?

It is not fun, to try to answer your questions, since you do not give any feedback.

your code:
m = find( )
hover(img)
wait(0.5)
type("c", KEY_CTRL)
# the copy should not work, since nothing is selected

find(image)
type("v", KEY_CTRL)

if you want to type something, a target must be selected (at least as clickpoint)
so this should be something like:
type(img, "v", KEY_CTRL)

Can you help with this problem?

Provide an answer of your own, or ask milin agrawal for more information if necessary.

To post a message you must log in.