edass
edass

Reputation: 45

How to add a newline to a variable?

I'm trying to append a trailing newline to a variable like:

data := "text"
Clipboard := data "\n"

But that leads to a data with literal \n. All other tries without quotation marks leads to errors.

Upvotes: 0

Views: 1023

Answers (1)

0x464e
0x464e

Reputation: 6489

Instead of using a backslash \ AHK uses a backtick `.
So you'd do a line feed character with `n, or a carriage return with `r, or a horizontal tab with `t, and so on.

data := "text"
Clipboard := data "`n"

Upvotes: 2

Related Questions