Unformated paste

Discussion, questions and support.
Post Reply
BruceM
Posts: 3
Joined: Feb 14th, ’19, 08:07

Post by BruceM » Feb 14th, ’19, 08:10

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
BruceM
Posts: 3
Joined: Feb 14th, ’19, 08:07

Post by BruceM » Feb 14th, ’19, 12:03

Duh

Found the answer - add this as the first line:
AutoTrim, Off
User avatar
Tom
Posts: 791
Joined: Nov 24th, ’15, 23:39

Post by Tom » Feb 14th, ’19, 12:07

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
BruceM
Posts: 3
Joined: Feb 14th, ’19, 08:07

Post by BruceM » Feb 15th, ’19, 09:02

Thanks, Tom - most useful.
Post Reply