Simple explanation of how to copy text include code please

Asked by na

Please can someone just provide me with the code to copy text from notepad into another notepad .

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

The approach is, to simulate a copy & paste:

#focus on source window
App("some-identifying-text-from-source-notepad-window").focus()
wait(1)
type('a', KEY_CTRL)
type('c', KEY_CTRL)
# now we have it on the clipboard
# switch to other notepad window
App("some-identifying-text-from-target-notepad-window").focus()
wait(1)
type('v', KEY_CTRL)
wait(1)
# inserts clipboard content at cursor

with these actions, that are not fully under control of Sikuli, you have to insert sufficient waiting times (therefor the wait()'s). It might run without them - just find out.

Can you help with this problem?

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

To post a message you must log in.