Ctrl+V to paste is not working

Discussion, questions and support.
Post Reply
orsonk
Posts: 4
Joined: Jul 24th, ’15, 23:13

Post by orsonk » Jul 24th, ’15, 23:15

I'm brand-new but liking what I see so far.

In a very simple macro, I include Ctrl+V as the last command. It usually does not work. I put a 200 ms pause before it, but that did not make a difference.

Anyone have a tip on how to include pasting in a macro?
User avatar
Marko
Posts: 1719
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Jul 24th, ’15, 23:33

Send, ^v

should work. If not, please post the script.
orsonk
Posts: 4
Joined: Jul 24th, ’15, 23:13

Post by orsonk » Jul 24th, ’15, 23:44

As of now, it's working. It appears that *sometimes* it stalls out right before the paste command (^v indeed). But other times it works. I guess there are other factors that could affect this outside the realm of FastKeys.

Thanks.
User avatar
Marko
Posts: 1719
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Jul 25th, ’15, 00:11

The clipboard is managed by Windows and sometimes need some time to be written. You can try adding

ClipWait command after changing the clipboard content to ensure the script would wait for clipboard to contain the data, something like this:

Code: Select all

Clipboard:=""
Clipboard:="this is a clipboard data"
ClipWait 0.5
Send ^v
orsonk
Posts: 4
Joined: Jul 24th, ’15, 23:13

Post by orsonk » Jul 25th, ’15, 00:48

This may be a dumb question...

Do I put each of those lines of text following the part where I copy to the clipboard? Or are you giving me an example of copying text and then adding the ClipWait before pasting?
User avatar
Marko
Posts: 1719
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Jul 25th, ’15, 12:45

This was just an example. ClipWait command waits until clipboard contains data. So it is important to empty the clipboard first, then copy the content to clipboard, wait for clipboard to contain data and finally paste.

http://ahkscript.org/docs/commands/ClipWait.htm
Post Reply