Code: Select all
ClipSend(Text, PS := "") {
ClipSave := ClipboardAll
Clipboard := Text
Send ^v
while DllCall("GetOpenClipboardWindow")
sleep -1
Clipboard := ClipSave
if PS
Send % PS
}
Example usage:
Code: Select all
!l::ClipSend("a very loooooooooooooooooooooooooooooooong text")
Code: Select all
; You can also specify words or keys to press right after the content is pasted as the second argument for convenience.
:X:dqs::ClipSend("document.querySelector("""")", "{Left 2}")
:X:cslg::ClipSend("console.log()", "{Left 1}")
Code: Select all
html_boilerplate =
(
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
</body>
</html>
)
:X:htmlbp::ClipSend(html_boilerplate, "{Up 2}")