Autohotkey 热字串使用变量

Autohotkey Hotstrings Using variables

现在我有

:R:#bn:: \binom{}{}

#bn 是我创建 binom 的快捷方式

我想要的是我可以打字 #bn_a_b(或其他)
每次输入 a,b 时都会得到 \binom{a}{b} 可能是不同的数字或字母。

这可能吗?

(也可用于: #for x 创建 对于 x = 至

下一个 x )

例如,您可以使 #bn 成为您的热字串,然后使该热字串触发 Input(docs) 命令,如下所示:

:*B0:#bn::
    Input, outp, L2 V
    characters := StrSplit(outp)
    SendInput, % "{BS 5}{Text}\binom{" characters[1] "}{" characters[2] "}"
return

*B0 options used for the hotstring to make it not require an ending character 并且不会自动退格,因此您可以先看到自己键入的内容。

L2V options 用于输入命令以将其长度限制为两个字符并使输入在键入时可见。

{BS 5}(docs1, docs2) 用于发送五个退格键(擦除热字串触发器)。

{Text}(docs) 用于使文本发送模式按字面解释后面的大括号。


或者,您可以查看此库以创建动态热字串
https://autohotkey.com/board/topic/98728-dynamic-hotstrings/
我不能说它是(或不是)好,还没有真正使用过它。