When assigning Clipboard I get the error "varible name contains an illegal character"

103 Views Asked by At

I'm trying to set the clipboard to a string but the string has characters causing the "varible name contains an illegal character" error. I'm not sure how I'm suppose to go about this error and I can't find any solutions.

My code:

var := "/text ~10 ~2 ~3 text:text"
Clipboard := %var%
Send, ^v

I expect it to paste "/text ~10 ~2 ~3 text:text" into a text editor, instead I get the error.

1

There are 1 best solutions below

0
Relax On BEST ANSWER

Variable names in an expression are not enclosed in percent signs.

var := "/text ~10 ~2 ~3 text:text"
Clipboard := var
Send, ^v

or

Clipboard := "/text ~10 ~2 ~3 text:text"
Send, ^v