我想要完成以下工作。
我想写2450 ddu1,其中2450 =数字,ddu1 =触发器。
编写上面的代码会使它看起来像这样:
送货上门2450瑞典克朗,根据您指定的重量测量。
问题是,数字是不同的,所以我需要能够写出正确的数字,然后是“文本扩展短语”来触发文本。
我可以扩展文本,但我不能这样做,因为我的数字留在扩展文本的中间。
非常感谢您的帮助和努力。
发布于 2014-11-04 01:32:40
在AHK中没有对动态热串的原生支持。但是有一个很棒的库可以满足你的需求。
下载该库并尝试运行以下代码:
#include Hotstring.ahk
; Listens for 1 or more digits, followed by "ddu1"
Hotstring("(\d+)\s+ddu1", "printPrice", 3)
return
; Prints a string with the digit in it
printPrice(param){
str_s := "Door delivery SEK "
str_e := ", based on your specified weight measurements."
out_s := str_s . param.value(1) . str_e
SendInput, %out_s%
}
Esc::ExitApp它是通过输入一个或多个数字,然后是一个空格,然后是ddu1来触发的。
例如:1 ddu1、512 ddu1、23123516161612 ddu1。
https://stackoverflow.com/questions/26719207
复制相似问题