-Extreme Beginner -
我创建了一个按钮,只要按下它就会发送μ,但是我可以听到Windows错误,因为脚本正在向没有输入文本字段的GUI发送μ。如何单击GUI并将其发送到上一个活动窗口。
#SingleInstance Force
Gui, Add, Button, w100 gKey, Micro
Gui, Show
return
Key:
send, µ
return
答案 0 :(得分:1)
您需要通过以下方式切换回上一个窗口:
Key:
IfWinActive, YourAppWindowName ; IfWinActive is not absolutely required, but if you use this test, then you need "SetTitleMatchMode, 2" at the top of your script.
Send, !{Esc} ; Switch back to previous window
Sleep, 100 ; Wait 0.1 sec for windows to switch back
send, µ
return