Pasting text within characters

Discussion, questions and support.
Post Reply
User avatar
Oblomov
Posts: 25
Joined: Mar 4th, ’19, 19:44

Post by Oblomov » Mar 8th, ’19, 20:51

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?
User avatar
Tom
Posts: 293
Joined: Nov 24th, ’15, 23:39

Post by Tom » 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
User avatar
Oblomov
Posts: 25
Joined: Mar 4th, ’19, 19:44

Post by Oblomov » Mar 10th, ’19, 13:38

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?
User avatar
Tom
Posts: 293
Joined: Nov 24th, ’15, 23:39

Post by Tom » Mar 10th, ’19, 19:48

Code: Select all

Send, % "*" clip "*"
User avatar
Oblomov
Posts: 25
Joined: Mar 4th, ’19, 19:44

Post by Oblomov » Mar 10th, ’19, 21:52

Tom wrote:
Mar 10th, ’19, 19:48

Code: Select all

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