SendInput on it's own is not the answer - takes too long.
This is what I do:
Code: Select all
lotsOfText =
(
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Ut faucibus convallis dui, nec laoreet est posuere ut.
Fusce consequat mi et lacinia efficitur.
Proin ultrices non nibh in luctus.
Sed sagittis justo diam, a dignissim eros aliquet eget.
)
tempVariable := Clipboard ; I want to save whatever I have in the clipboard and put back after I have finished.
Sleep 200 ;I find it really annoying having to sleep - is there a better way? If I don't sleep, on some (NOT all) computers, the code doesn't execute as it should do.
Clipboard := lotsOfText
Sleep 200
SendInput ^v ; Send CTRL V to past
Sleep 200 ; sleep yet AGAIN! How annoying!
Clipboard := tempVariable ; Clipboard put back
ALSO... let's say I output many lines of text.
Now after the output I want to position my cursor somewhere in the middle - where I would start typing.
How can I best do this? Simulate arrow keys? The only thing I'm afraid of is that on different machines, the behaviour will be slightly different - so want something that is consistent.
Thanks.