Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 @@.

like image 607
mythofechelon Avatar asked Oct 03 '12 10:10

mythofechelon


1 Answers

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

like image 162
Elliot DeNolf Avatar answered Sep 22 '22 12:09

Elliot DeNolf