An ahk script that can insert Template content on wikitext
在维基编辑过程中,需要输入模板的场景很常见,这个 ahk 脚本可以很方便地使用模板。
; 适用于 ahk 1.1.37.02
; 小狼毫对竖线有特殊处理,ahk 不太认识它,所以先用一个变量存储竖线,再用 SendInput 发送
::case::
su := "|"
SendInput, {Raw}{{CaseBox
Send, {Enter}{Enter}
SendInput, {Raw}%su%
Send, {Enter}{Space}
Send, question {Space}={Enter}
SendInput, {Raw}%su%
Send, {Enter}{Space}
Send, misconception {Space}={Enter}
SendInput, {Raw}%su%
Send, {Enter}{Space}
Send, crime {Space}={Enter}
SendInput, {Raw}%su%
Send, {Enter}{Space}
Send, explanation {Space}={Enter}
SendInput, {Raw}}}
return
运行以上脚本后,当用户在中文状态下输入 case,再按空格或回车键,会得到这样一长串:
{{CaseBox | question = | misconception = | crime = | explanation = }}