AutoHotKey:即时文本替换

myt*_*lon 6 text replace autohotkey instant

我的AutoHotKey脚本的一部分取代@@了我的电子邮件地址.目前,我这样做:

::@@::
SendInput, example@domain.com
return
Run Code Online (Sandbox Code Playgroud)

足够简单,它工作得相当好,但你需要在更换之前推送空格/逗号/句号/等.有没有办法在没有任何进一步交互的情况下立即更换它 - 一旦匹配标准,它就会被取代?

AutoHotKey文档之后,我尝试过:

StringReplace, var_Email, var_Email, @@, example@domain.com, All
Run Code Online (Sandbox Code Playgroud)

但它只是清除了@@.

Ell*_*olf 14

您正在寻找hotstring中的*选项.一旦检测到该字符串而没有额外的密钥,该选项就会替换该字符串.

:*:@@::example@domain.com
Run Code Online (Sandbox Code Playgroud)

将实现您的目标.

选项的文档位于:http://www.autohotkey.com/docs/Hotstrings.htm