我的工作需要重复输入数据,因此我会在窗口中打开多达 10 个选项卡并重复输入信息,所有 10 个选项卡都输入相同的信息...所以我使用 AHK 中的录音机来帮助我输入每个选项卡的数据.....所以我想知道我是否可以通过按键执行命令,该命令将自动一次将信息填充到所有 10 个选项卡中...因为信息都是一样的......下面是我为一个选项卡录制的基本脚本。
^!K::
鼠标单击,左,229,142
发送 ZRDP-07-30-WEP.10/15-005
鼠标单击,左,460,175
睡眠,100
鼠标单击,左,319,248
睡眠,100
鼠标单击,左,470,226
睡眠,100
鼠标单击,左,258,308
睡眠,100
鼠标单击,左,468,250
睡眠,100
鼠标单击,左,252,346
睡眠,100
鼠标单击,左,464,272
睡眠,100
鼠标单击,左,252,366
睡眠,100
鼠标单击,左,1363,211
睡眠,100
鼠标单击,左,1232,223
睡眠,100
鼠标单击,左,1194,275
睡眠,100
鼠标单击,左,1134,303
睡眠,100
鼠标单击,左,1126,152
睡眠,100
发送,DD 和 KC
返回
下面我尝试重复上面记录的所有脚本以在下一个选项卡上运行或执行,,。但没有成功:(
^!K::
Var1 = ZRDP-07-kew.1/15-764
参数 =
{
鼠标单击,左,229,142
发送 %var1%
鼠标单击,左,460,175
睡眠,100
鼠标单击,左,319,248
睡眠,100
鼠标单击,左,470,226
睡眠,100
鼠标单击,左,258,308
睡眠,100
鼠标单击,左,468,250
睡眠,100
鼠标单击,左,252,346
睡眠,100
鼠标单击,左,464,272
睡眠,100
鼠标单击,左,252,366
睡眠,100
鼠标单击,左,1363,211
睡眠,100
鼠标单击,左,1232,223
睡眠,100
鼠标单击,左,1194,275
睡眠,100
鼠标单击,左,1134,303
睡眠,100
鼠标单击,左,1126,152
睡眠,100
发送,DD 和 KC
}
发送,{CTRLDOWN}{TAB}{CTRLUP}
鼠标单击,左,229,142
动作 =
返回
请帮助我...非常感谢...
我想我可能已经找到了我自己的问题的部分解决方案。下面是我的脚本。
F9::
Var1 = ZRDP-07-kew.1/15-123
鼠标单击,左,229,142
发送 %var1%
鼠标单击,左,460,175
睡眠,100
鼠标单击,左,319,248
睡眠,100
鼠标单击,左,470,226
睡眠,100
鼠标单击,左,258,308
睡眠,100
鼠标单击,左,468,250
睡眠,100
鼠标单击,左,252,346
睡眠,100
鼠标单击,左,464,272
睡眠,100
鼠标单击,左,252,366
睡眠,100
鼠标单击,左,1363,211
睡眠,100
鼠标单击,左,1232,223
睡眠,100
鼠标单击,左,1194,275
睡眠,100
鼠标单击,左,1134,303
睡眠,100
鼠标单击,左,1126,152
睡眠,100
发送,DD 和 KC
发送,{CTRLDOWN}{TAB}{CTRLUP}
发送输入,{F9}
返回
但是这个命令会不停地执行。因为 sendinput {F9} 会一直执行下去。我该如何限制这个 sendinput 最多只能显示 10 个标签(windows 浏览器)?请给点建议。谢谢。
答案1
你应该不是在脚本中使用宏快捷键 (F9)。如果这样做,它总是会自行调用,并且脚本将无法完成。尝试以下方法:
; your macro shortcut key is pressed
F9::
step := 0
; a variable named 'step' is defined and initialized to 0
;here is the start of your action which should be repeated 10 times
start:
;;;;;;;; PUT YOUR CODES HERE
Var1 = ZRDP-07-kew.1/15-123
MouseClick, left, 229, 142
send %var1%
MouseClick, left, 460, 175
Sleep, 100
MouseClick, left, 319, 248
Sleep, 100
MouseClick, left, 470, 226
Sleep, 100
MouseClick, left, 258, 308
Sleep, 100
MouseClick, left, 468, 250
Sleep, 100
MouseClick, left, 252, 346
Sleep, 100
MouseClick, left, 464, 272
Sleep, 100
MouseClick, left, 252, 366
Sleep, 100
MouseClick, left, 1363, 211
Sleep, 100
MouseClick, left, 1232, 223
Sleep, 100
MouseClick, left, 1194, 275
Sleep, 100
MouseClick, left, 1134, 303
Sleep, 100
MouseClick, left, 1126, 152
Sleep, 100
Send, DD & KC
Send, {CTRLDOWN}{TAB}{CTRLUP}
;;;;;;;; END OF YOUR CODES [without 'RETURN']
; adding current step to number of total passed steps
step := step " + 1"
; simply check to see if current step is lower than 10 times or not
If step <= 10
{
; if so repeat your codes
Goto, start
}
return