原来AutoHotkey自从1.1.28版开始已经提供了称为Function Hotstrings的功能了,简单理解就是能在热字串里写脚本程式码了。
另外,也可以使用Hotstring函数动态控制热字串。
1. 范例
#SingleInstance Force ; This example also demonstrates one way to implement case conformity in a script. :C:BTW:: ; Typed in all-caps. :C:Btw:: ; Typed with only the first letter upper-case. : :btw:: ; Typed in any other combination. btw() { hs := A_ThisHotkey ; For convenience and in case we're interrupted. if (hs == `":C:BTW") Send BY THE WAY else if (hs ==":C:Btw") Send By the way else Send by the way } ::tst:: SendInput #e return ::aa:: Hotstring(": :btw", "new BTW string") ::bb:: btw() ::cc:: btw() return ::dd:: try Hotstring("::btw", " bb tt ww") catch MsgBox The hotstring does not exist or it has no variant for the current IfWin criteria. return
相关链接
✅ Function Hotstrings: https://www.autohotkey.com/docs/Hotstrings.htm#Function
✅ Hotstring: https://www.autohotkey.com/docs/commands/Hotstring.htm
教学影片
##
想在手机阅读更多教学锦囊资讯?下载【香港硅谷】Android应用