Page 1 of 1

Pasting text within characters

Posted: Mar 8th, ’19, 20:51
by Oblomov
Hello,

I'm trying to paste some text into asterisks with

Code: Select all

clipboard := clipboard
Send,% "*" ClipBoard "*"
But instead of

Code: Select all

*text
text text text
text*
I get

Code: Select all

***text

text text text

text

***
Is there any way to fix my command perhaps?

Re: Pasting text within characters

Posted: Mar 8th, ’19, 23:09
by Tom
Some editors treat `r`n (CR FF) as one break, others as two. Try this:

Code: Select all

clip:=clipboard
StringReplace, clip, clip, `r`n, `n, All
Send, % clip 
return

Re: Pasting text within characters

Posted: Mar 10th, ’19, 13:38
by Oblomov
Tom wrote: Mar 8th, ’19, 23:09 Some editors treat `r`n (CR FF) as one break, others as two. Try this:

Code: Select all

clip:=clipboard
StringReplace, clip, clip, `r`n, `n, All
Send, % clip
return
I see.. although, where would I put in the asterisks?

Re: Pasting text within characters

Posted: Mar 10th, ’19, 19:48
by Tom

Code: Select all

Send, % "*" clip "*"

Re: Pasting text within characters

Posted: Mar 10th, ’19, 21:52
by Oblomov
Tom wrote: Mar 10th, ’19, 19:48

Code: Select all

Send, % "*" clip "*"
Awesome! Thanks! :)