Sendinput does not send variable contents if the strings begin with ";"

Report problems with documented functionality
LC99
Posts: 14
Joined: 23 Nov 2016, 20:33

Sendinput does not send variable contents if the strings begin with ";"

29 Dec 2018, 06:18

Code: Select all

; Tested with AutoHotKey L Version 1.1.29.1
; I've noticed others have experienced this problem as well
; but I think I stumbled on a work-around for the problem
; Line below is used to prefix every line of text on the clipboard with "; "
clipboard := RegExReplace(clipboard, "([^\n]+)", "; $1")  ; This works as shown by msgbox

; The Problem:
SendInput, ^v ; Doesn't paste anything
Sendinput, {Ctrl Down}v{Ctrl Up}  ; This pastes the prefixed text on the clipboard as expected
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Sendinput does not send variable contents if the strings begin with ";"

29 Dec 2018, 06:58

cant reproduce on 1.1.30.1, though i doubt i would have been able to on 1.1.29.1 either
gregster
Posts: 9001
Joined: 30 Sep 2013, 06:48

Re: Sendinput does not send variable contents if the strings begin with ";"

29 Dec 2018, 09:38

can't reproduce on 1.1.29.1 either

Well, if you run the script like this, there is probably no text field active at the moment the line SendInput ^v gets executed (and then it cannot paste anything, obviously) . But that would be true for the next line, too.
Try it as a hotkey procedure and activate some editor window (like Notepad) before you execute the code via the hotkey.
paste.jpg
paste.jpg (33.46 KiB) Viewed 1435 times
Works...
joefiesta
Posts: 497
Joined: 24 Jan 2016, 13:54
Location: Pa., USA

Re: Sendinput does not send variable contents if the strings begin with ";"

29 Dec 2018, 11:47

and, everything works fine on 1.1.28.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 51 guests