Send contents of clipboard as keystrokes in AutoHotkey - automation

I'm looking for a way to send the contents of the clípboard as key output. E.g. if the clipboard says "123456789" I want the keys 1-2-3-4-5-6-7-8-9 sent to the keyboard input.
I've tried:
SetWinDelay 100
SetKeyDelay 0
^f::
Send %clipboard%
return
To map the 'clipboard paste' to ctrl+f, but it is just literally pasting '%clipboard%'

SendRaw %clipboard%
Did the trick

Related

How to get <input>'s value after pasting?

I need to get the value of an html input after some text has been pasted. Seems obvious to handle the input's onpaste event, but that appears to fire before the text is actually pasted.
For example...
When one pastes some text into that input the alert shows an empty string. Clicking ok then shows the pasted text appearing in the text box.
I've tried using setTimer("someFunction()", 1), then looking at the input inside someFunction(), but that seems like a kludge.
What's the best way to get to the input's text after something's been pasted?
Thanks!
Curt

How to send a new line without using `n `r? without an enter

i know that n means "ENTER", but when i'm using n, i dont want to press enter. I just want to put the text in a new line, but what "n" does, it puts in a new line but it also press enter.. i don't want to press enter...
For example
::pergunta::Hello, n How are you? n what are you doing? n bye...
How can i fix that issue?
First, you need to determine what keystrokes your application uses for this purpose, and then you can implement that in Autohotkey.
For example, in Excel, multiple lines of text can be typed into a single cell by pressing ALT-ENTER at the end of each line (instead of ENTER).
So, the following AutoHotkey script would work for Excel:
:X:pergunta::Send, Hello,!{Enter}How are you?!{Enter}what are you doing?!{Enter}bye...
The ":X:" at the beginning means "run a script", which in this case is the "Send" command. The !{Enter} part means ALT-ENTER.
You might also want to use SetKeyDelay to speed up the typing of text:
SetKeyDelay, 0
:X:pergunta::Send, Hello,!{Enter}How are you?!{Enter}what are you doing?!{Enter}bye...

Running single Query in SSMS2017 using AutoHotKey

I've been trying to get my AHK-Script running in SSMS2017 to execute a single (multi-line) SQL Statement (similar to Ctrl+Enter in SQL Developer).
The idea is that I search for the last (with respect to the last caret position) ";" in my code and highlight the text until the next one and then execute it with F5.
So far my script looks like that:
^ENTER::
CoordMode, Caret, Screen
CoordMode, Mouse, Screen
send ^f
sendraw `;
send {Enter}
send {Esc}
send +{F3}
send {Right}
X1 = A_CaretX
Y1 = A_CaretY
send {F3}
send {Right}
X2 = A_CaretX
Y2 = A_CaretY
MouseClickDrag, Left, X1,Y1,X2,Y2, 100
send {F5}
return
which in my opinion at least syntactically should work. But it doesn't. Apparently because A_CaretX and A_CaretY seem to be empty (I've let AHK output them to me and they are blank). Does anyone know a solution to this problem?
A_CaretX and A_CaretY doesn't work in SQL Server Management Studio because the Query window is not a normal Textbox control, and so you will never be able to get the information using the Carets.
A different way to do it is to copy all the text from the query window, parse it, and loop through the parsed info, pasting and running each parsed text.
^ENTER::
Send ^a
Send ^c
ClipWait 1 ; Wait for clipboard to be filled
Queries := ClipBoard
Loop, parse, Queries, ";"
{
Send ^a
Clipboard := A_LoopField
Send ^v
Sleep 100
Send {F5}
Sleep 1000 ; wait 1 second for query to finish
}
;Replace the text with the original text
Clipboard := Queries
Send ^a
Send ^v
Return

How to set hotkey to auto type copied text from clipboard by AutoHotkey?

I'm using AHK. But I don't know any script help me type text from clipboard (I chosen text and ctrl+C).
Can you help me?!
Thank you!
You should check help for "Clipboard" and find that this works:
Send %Clipboard%
Here are some details:
Clipboard and ClipboardAll
Clipboard is a built-in variable that reflects the current contents of the Windows clipboard if those contents can be expressed as text. By contrast, ClipboardAll contains everything on the clipboard, such as pictures and formatting.
I dont know why you dislike my question. But i know AHK is created to provide automatic solution to boost performence icluded illegal. Ok?
This is my search in forum AHK. If you tested, let me know your experience!
"
; win + v
#v::
SendRaw %clipboard%
"

Selenium VBA code to paste data in browser

I am trying to stimulate the control+v option in a text box in chrome using selenium vba wrapper. I tried using the context click but that function seems to click at a random position based on the cursor position. I tried using the send key function but i am not getting the desired result.
selenium.SendKeys (key.Control & "v")
Please any advise or leads would be much appreciated.
You want to target the text box before using sendkeys. Let's say, hypothetically, that there is an ID called textbox1 for identifying the element then:
driver.FindElementById("textbox1").SendKeys("yourString")
Or
driver.FindElementById("textbox1").SendKeys Keys.Control, "v"
The latter assuming info is already in the clipboard with, for example, driver.SetClipBoard "yourString"
I think you'll be better off using a variable to hold your data rather than the clipboard. Then you can use sendkeys to type it in:
myData= "your data here"
selenium.sendkeys myData
hth