0
我写了这样AutoHotkey的脚本来自动登录我的程序:AutoHotkey的:有时按钮没有点击
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Run info.exe
WinWait, User identification,
Sleep 300
ControlSend, Edit1, user, User identification
ControlSend, Edit2, password, User identification
ControlClick, Button1, User identification
的问题是 - 有时Button1
不点击。 当我在大多数情况下执行脚本Button1
被点击,但有时它不。 当锁定工作站上的脚本自动执行(这是我实际需要的场景)时,永远不会点击Button1
。
我试图在脚本中的每行之后插入Sleep, 1000
但它没有帮助。
问题是为什么,以及如何修复/解决方法问题
我今天尝试更换
ControlSend, Edit2, password, User identification
ControlClick, Button1, User identification
与
ControlSend, Edit2, password{Enter}, User identification
也许这将工作...
啊!我希望我早点看到你的帖子。 'ControlSend'是区分大小写的 - 你无意中发现的。 – bgmCoder