8

One part of my AutoHotKey script replaces @@ with my email address. Currently, I'm doing this like so:

::@@::
SendInput, example@domain.com
return

Simple enough and it works fairly well but you need to push space / comma / period / etc before it is replaced. Is there a way instantly replace it without any further interaction - it's replace as soon as the criteria is matched?

Following the AutoHotKey documentation, I've tried:

StringReplace, var_Email, var_Email, @@, example@domain.com, All

but it just clears the @@.

mythofechelon
  • 3,692
  • 11
  • 37
  • 48

1 Answers1

16

You are looking for the * option in your hotstring. This option replaces the string as soon as it is detected without an extra key.

:*:@@::example@domain.com

will achieve what you are looking for.

The documentation for the Options are located here: http://www.autohotkey.com/docs/Hotstrings.htm

Elliot DeNolf
  • 2,920
  • 1
  • 15
  • 12