how to send paste command

Get help with using AutoHotkey and its commands and hotkeys
help2342

how to send paste command

23 May 2017, 16:32

I want to make a script that when I hit a key it sends what i have copied like 10 times. All I need is how to paste command.
help2342

Re: how to send paste command

23 May 2017, 20:06

evilC wrote:Send ^v

Code: Select all

+SC04D::
Loop, 10
{
	Send, {Enter} ^v {Enter}
}
return
Here is what I got, it isn't doing anything?
donovv
Posts: 108
Joined: 15 Apr 2017, 21:06

Re: how to send paste command

23 May 2017, 20:33

Send, %clipboard%
User avatar
jeeswg
Posts: 5155
Joined: 19 Dec 2016, 01:58
Location: UK

Re: how to send paste command

23 May 2017, 21:47

This might do it:

Code: Select all

q:: ;put text onto clipboard and invoke paste
vOutput := ""
Loop, 10
	vOutput .= "MyText`r`n"
Clipboard := vOutput
SendInput ^v
return
[EDIT:] Nice and colourful again (like one other post I did).
Kerry

Re: how to send paste command

19 Jul 2018, 08:21

Send ^v does not work in environments like the command prompt. I particularly appreciated the "Send %clipboard%" idea. Even though that types it out and is slower, it works on all legitimate targets.

If there was a way to emulate "Right-Click Select Paste Click" that would be aweseom.
User avatar
jeeswg
Posts: 5155
Joined: 19 Dec 2016, 01:58
Location: UK

Re: how to send paste command

19 Jul 2018, 14:22

Here's what I'm currently using to copy and paste on the command prompt:

Code: Select all

#IfWinActive, ahk_class ConsoleWindowClass
^v:: ;command prompt - send the clipboard
if InStr(vText, "`r")
	vText := SubStr(vText, 1, InStr(vText, "`r")-1)
if InStr(vText, "`n")
	vText := SubStr(vText, 1, InStr(vText, "`n")-1)
SendInput, % "{Text}" vText ;note: {Text} requires AHK v1.1.27+
return

^a:: ;command prompt - select all
PostMessage, 0x111, 65525,,, A ;WM_COMMAND := 0x111
return

^c:: ;command prompt - copy
PostMessage, 0x111, 65520,,, A ;WM_COMMAND := 0x111
return
#IfWinActive

Return to “Ask For Help”

Who is online

Users browsing this forum: beentold, Google [Bot], paik1002, Scr1pter and 24 guests