MasterMastic
MasterMastic

Reputation: 21286

Are backticks possible in AHK hotstring?

I need to have a hotstring with backticks in it (`) surrounding it. Simplifying what I've tried:

::`hw`::Hello, World!

Running it gives an error: "Invalid hotkey".

I'm not sure why this restriction exists but more to the point: is there any workaround?

Upvotes: 8

Views: 2974

Answers (1)

MCL
MCL

Reputation: 4065

A backtick (`) is the default escape character in AHK.
In order to specifiy a literal backtick, you can either escape it (with itself):

::``hw``::Hello, World!

Or change the escape character:

#EscapeChar \
::`hw`::Hello, World!

I wouldn't recommend the latter, since many libraries expect the escape char to be a backtick.

Upvotes: 19

Related Questions