how to send paste command Topic is solved

Get help with using AutoHotkey (v1.1 and older) 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?
User avatar
jeeswg
Posts: 6902
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).
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
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: 6902
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
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, Google [Bot] and 113 guests