I have a Windows program that I like to paste to quite often. However it doesn't allow pasting, so I use AHK as follows...
Code: Select all
F4::
gosub SendClipboardTextCharacters
return
SendClipboardTextCharacters:
SetKeyDelay,10
SendEvent % StrReplace(Clipboard,"`r")
return
It removes the 'r because Windows likes to use 'r'n which results in double line returns. Everything was great, but now the program has updated. All the lines become indented (a built in "Feature" in the software). One way I can get around this awful "feature", which can't be disabled, is to hit the HOME key after every line return.
I tried replacing 'r'n with 'n{home}.
Code: Select all
SendClipboardTextCharacters:
SetKeyDelay,10
SendEvent % StrReplace(Clipboard,"`r{home}")
return
This does return the cursor to the front of the line, however it writes {home} at the front of every line.
First Line
{home}Line 2
{home}line 3
{home}line 4
How can I sent a HOME key press after every line return without actually writing {home} at the front of every line?