[AHK#52] 1.1.28新功能:Function Hotstring


原来AutoHotkey自从1.1.28版开始已经提供了称为Function Hotstrings的功能了,简单理解就是能在热字串里写脚本程式码了。

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



技术平台: Nasthon Systems