Macros 在自动热键中,并非所有发送选项卡都工作
我试图用一个.ahk来创建一个gif生成、上传和url处理的宏,但它经常忽略诸如send、{tab down}{tab up}之类的按键,这会完全破坏宏。当我在字符串中间发送时,^ l也不工作。Macros 在自动热键中,并非所有发送选项卡都工作,macros,autohotkey,Macros,Autohotkey,我试图用一个.ahk来创建一个gif生成、上传和url处理的宏,但它经常忽略诸如send、{tab down}{tab up}之类的按键,这会完全破坏宏。当我在字符串中间发送时,^ l也不工作。 ^q:: Run, firefox.exe "gifcreator.me" sleep 9000 Loop 9 { Send, {tab} sleep 100 } send, {enter down} sleep 500 send, {enter up}
^q::
Run, firefox.exe "gifcreator.me"
sleep 9000
Loop 9
{
Send, {tab}
sleep 100
}
send, {enter down}
sleep 500
send, {enter up}
sleep 200
Loop 4
{
send, {ctrl down}
send, ^L
send, {ctrl up}
}
sleep 200
send {ctrl down}
send, a
send, {ctrl up}
sleep 200
send, {delete down}
sleep 200
send {delete up}
sleep 5000
send, C:\Users\John Reuter\OneDrive\art
sleep 300
send, {enter down}
sleep 500
send, {enter up}
sleep 5000
click 1200, 50
sleep 3000
click 1200, 50
sleep 200
send, {ctrl down}
sleep 200
send, v
sleep 200
send, {Ctrl Up}
sleep 13000
click 50, 150
sleep 3000
send, {Ctrl Down}
sleep 200
send, a
sleep 200
send, {Ctrl Up}
sleep 200
send, {Ctrl Down}
sleep 200
send, a
sleep 200
send, {Ctrl Up}
sleep 7000
send, {enter}
sleep 5000
send, 5
sleep 200
send, 1
sleep 3000
send,^{ctrl down}-{ctrl up}
sleep 3000
send,^{ctrl down}-{ctrl up}
sleep 3000
send,^{ctrl down}-{ctrl up}
sleep 3000
send,^{ctrl down}-{ctrl up}
sleep 3000
send,^{ctrl down}-{ctrl up}
sleep 3000
send, {down}
sleep 300
send, {down}
sleep 300
send, {down}
sleep 300
send, {down}
sleep 300
send, {down}
sleep 300
send, {down}
sleep 300
send, {down}
sleep 300
send, {down}
sleep 300
send, {down}
sleep 300
send, {down}
sleep 300
send, {down}
sleep 300
send, {down}
sleep 300
send, {down}
sleep 300
send, {down}
sleep 300
send, {down}
sleep 300
send, {down}
sleep 300
send, {down}
sleep 3000
click 567, 227; miss
sleep 3000
send, {Ctrl Down}
send, f
send, {Ctrl Up}
sleep 3000
send, download gif
sleep 5000
send, {enter}
sleep 5000
send, {Ctrl Down}
send, l
send, {Ctrl Up}
sleep 5000
send, giphy.com/upload
sleep 3000
send, 2
sleep 3000
click 642, 325
sleep 8000
send, {down}
sleep 3000
send, {right}
sleep 3000
send, {down}
sleep 3000
send, {right}
sleep 3000
send, {down}
sleep 3000
send, {right}
sleep 3000
send, {down}
sleep 3000
send, {right}
sleep 3000
send, {enter}
sleep 7000
send, {Ctrl Down}
send, f
send, {Ctrl Up}
sleep 3000
send, upload gifs
sleep 3000
click right 661, 198
sleep 3000
click 713, 218
sleep 3000
send, {Ctrl Down}
send, l
send, {Ctrl Up}
sleep 3000
send, {Ctrl Down}
send, x
send, {Ctrl Up}
sleep 3000
send, <img src="
sleep 3000
send, {Ctrl Down}
send, v
send, {Ctrl Up}
sleep 3000
send, "alt=""style="width:12px;height:18px;">
;======================
Esc::ExitApp
^q::
运行firefox.exe“gifcreator.me”
睡眠9000
环路9
{
发送,{tab}
睡100
}
发送,{输入down}
睡500
发送,{向上输入}
睡200
环路4
{
发送,{ctrl-down}
发送,^L
发送,{ctrl-up}
}
睡200
发送{ctrl-down}
发送,一个
发送,{ctrl-up}
睡200
发送,{delete down}
睡200
发送{delete up}
睡5000
发送,C:\Users\John Reuter\OneDrive\art
睡300
发送,{输入down}
睡500
发送,{向上输入}
睡5000
点击1200、50
睡3000
点击1200、50
睡200
发送,{ctrl-down}
睡200
发送,v
睡200
发送,{Ctrl-Up}
睡眠13000
单击50、150
睡3000
发送,{Ctrl-Down}
睡200
发送,一个
睡200
发送,{Ctrl-Up}
睡200
发送,{Ctrl-Down}
睡200
发送,一个
睡200
发送,{Ctrl-Up}
睡眠7000
发送,{enter}
睡5000
发送,5
睡200
发送,1
睡3000
发送,^{ctrl-down}-{ctrl-up}
睡3000
发送,^{ctrl-down}-{ctrl-up}
睡3000
发送,^{ctrl-down}-{ctrl-up}
睡3000
发送,^{ctrl-down}-{ctrl-up}
睡3000
发送,^{ctrl-down}-{ctrl-up}
睡3000
发送,{down}
睡300
发送,{down}
睡300
发送,{down}
睡300
发送,{down}
睡300
发送,{down}
睡300
发送,{down}
睡300
发送,{down}
睡300
发送,{down}
睡300
发送,{down}
睡300
发送,{down}
睡300
发送,{down}
睡300
发送,{down}
睡300
发送,{down}
睡300
发送,{down}
睡300
发送,{down}
睡300
发送,{down}
睡300
发送,{down}
睡3000
点击567227;未击中
睡3000
发送,{Ctrl-Down}
发送,f
发送,{Ctrl-Up}
睡3000
发送、下载gif
睡5000
发送,{enter}
睡5000
发送,{Ctrl-Down}
发送,l
发送,{Ctrl-Up}
睡5000
发送,giphy.com/upload
睡3000
发送,2
睡3000
单击642325
睡眠8000
发送,{down}
睡3000
发送,{right}
睡3000
发送,{down}
睡3000
发送,{right}
睡3000
发送,{down}
睡3000
发送,{right}
睡3000
发送,{down}
睡3000
发送,{right}
睡3000
发送,{enter}
睡眠7000
发送,{Ctrl-Down}
发送,f
发送,{Ctrl-Up}
睡3000
发送、上传GIF
睡3000
右击661198
睡3000
点击713218
睡3000
发送,{Ctrl-Down}
发送,l
发送,{Ctrl-Up}
睡3000
发送,{Ctrl-Down}
发送,x
发送,{Ctrl-Up}
睡3000
邮寄
;======================
Esc::ExitApp
为什么在发送后加逗号?这不是正确的语法。AltHotKey网站上的这些示例将是命令的正确语法:
Send {b down}{b up}
Send {TAB down}{TAB up}
Send {Up down} ; Press down the up-arrow key.
Sleep 1000 ; Keep it down for one second.
Send {Up up} ; Release the up-arrow key.
查看他们的网页以了解有关发送命令的更多详细信息:请尝试使用WinWait等,而不是休眠。在AHK帮助文件中查看如何正确使用这些命令(Run、WinWait等)
SetTitleMatchMode, 2
Run, firefox.exe "gifcreator.me"
WinWait, Online Animated GIF Maker
IfWinNotActive, Online Animated GIF Maker, ,WinActivate, Online Animated GIF Maker
WinWaitActive, Online Animated GIF Maker
sleep 100
Loop 8
{
Send, {tab}
sleep 100
}
Send, {Enter}
; WinWait, ...
; IfWinNotActive, ...
; ...
; SendInput, C:\Users\John\OneDrive\art
; ...
编辑
如果在第一次“发送,{Enter}”之后没有出现下一个窗口,请尝试使用循环:
SetTitleMatchMode, 2
Run, firefox.exe "gifcreator.me"
Loop
{
WinWait, Online Animated GIF Maker
IfWinNotActive, Online Animated GIF Maker, ,WinActivate, Online Animated GIF Maker
WinWaitActive, Online Animated GIF Maker
sleep 100
Loop 8
{
Send, {tab}
sleep 100
}
Send, {Enter}
sleep 1000
IfWinExist, title of next window
break
}
; WinWait, title of next window
; IfWinNotActive, ...
; ...
; SendInput, C:\Users\John\OneDrive\art
请看我编辑的答案,看一看,或者。?他们的另一个程序可能可以更好地完成这项工作吗?你的编辑答案与循环工作,但我必须添加1整数从8到9,以得到我想要的结果,这是罚款循环8{发送,{tab}睡眠100}也发送,{ctrl-down}sleep 200 send,L sleep 200 send,{ctrl-up}未导航到主搜索栏。给出了什么?我无法理解您脚本的目的。请尝试编辑您的问题并解释每个步骤。