单个替换能够基本实现:
Code: Select all
::pt9::
::sk10::
thishotkey:=SubStr(A_ThisHotkey,3) ;保存热键到变量
RegExMatch(thishotkey, "i)([a-zA-Z]+)", char) ;正则提取热键中的字母
RegExMatch(thishotkey, "i)([0-9]+)", num) ;正则提取热键中的数字
if (num) ;如果num为空,则赋值为001,否则将其用0补齐为3位字符长度
num:=Format("{:003}",num)
else
num:=001
编号 := char A_YYYY A_MM A_DD num ; 字符+日期+流水号,编制姓名编码
StringUpper, 编号, 编号 ;大写字母
SendInput %编号% ;由于有变量,所以使用SendInput方式。
return