Page 1 of 1

Unformated paste

Posted: Feb 14th, ’19, 08:10
by BruceM
Hi

I found/setup a shortcut to run a command that does an unformated paste. It uses this code:

clipboard=%clipboard%
sleep 100
Send, ^{vk56} ;Ctrl V

There is one problem - if the text I'm trying to paste has space(s) at the beginning or end they get truncated before the paste is done. Does anybody know how I can avoid this truncation?

Thanks for you help

Re: Unformated paste

Posted: Feb 14th, ’19, 12:03
by BruceM
Duh

Found the answer - add this as the first line:
AutoTrim, Off

Re: Unformated paste

Posted: Feb 14th, ’19, 12:07
by Tom
This alternative also preserves the original clipboard content:

Code: Select all

temp:=ClipboardAll
Clipboard:=SubStr(Clipboard, 1, StrLen(Clipboard))
sleep 100
Send ^v
Clipboard:=temp

Re: Unformated paste

Posted: Feb 15th, ’19, 09:02
by BruceM
Thanks, Tom - most useful.