mythofechelon
mythofechelon

Reputation: 3782

AutoHotKey: Instant text replace

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

::@@::
SendInput, [email protected]
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, @@, [email protected], All

but it just clears the @@.

Upvotes: 9

Views: 11925

Answers (1)

Elliot DeNolf
Elliot DeNolf

Reputation: 2999

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

:*:@@::[email protected]

will achieve what you are looking for.

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

Upvotes: 17

Related Questions