0
votes

Trying to set Autohotkey command but it's not working, I've used this same script before but it's not working with version 1.1.24.05 of AutoHotKey.

local = http://lcl.
dev   = http://dev.
stage = http://stg.
prod  = https://www.
mywebsite1 = sitename1.com
mywebsite2 = sitename2.com

:*:lclmywebsite1::%local%%mywebsite1%{enter}
:*:devmywebsite1::%dev%%mywebsite1%{enter}
:*:stgmywebsite1::%stage%%mywebsite1%{enter}
:*:lclmywebsite2::%local%%mywebsite2%{enter}
:*:devmywebsite2::%dev%%mywebsite2%{enter}
:*:stgmywebsite2::%stage%%mywebsite2%{enter}

When I type stgmywebsite2 AutoHotKey returns %stage%%mywebsite2%

It's no different to what I have below but the above example doesn't seem to evaluate the variables. Any ideas?

:*:mye@::[email protected]
1

1 Answers

0
votes

This sample demonstrates using variable expansion within a hotstring:

local = http://lcl.
mywebsite1 = sitename1.com

:*:lclmywebsite1::
  SendInput %local%%mywebsite1%{enter}
  return

From the documentation for Hotstrings:

Variable references such as %MyVar% are not currently supported within the replacement text. To work around this, don't make such hotstrings auto-replace. Instead, use the SendInput command beneath the abbreviation, followed by a line containing only the word Return.