AutoHotKey: Instant text replace
Asked Answered
A

1

9

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

Armoury answered 3/10, 2012 at 10:32 Comment(0)
E
17

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

Erbes answered 3/10, 2012 at 16:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.