AutoIt:完成上一个命令后运行下一个命令
我目前正在编写一个执行一系列控制发送和控制单击的宏。 它们必须按照准确的顺序完成。
起初我没有任何睡眠语句,所以脚本只会遍历每个命令,无论前一个命令是否已完成(即:在完成发送输入字符串之前单击“提交”)
所以我想也许我会放一些sleep 语句,但随后我必须弄清楚如何最好地优化它,并且我必须考虑其他计算机的速度,因为慢速计算机需要在命令之间有更长的延迟。这不可能针对每个人进行优化。
我希望有一种方法可以强制每行仅在前一行完成后运行?
编辑:更具体地说,我希望在单击按钮之前controlsend 命令完成执行。
I'm currently writing a macro that performs a series of control sends and control clicks.
They must be done in the exact order.
At first I didn't have any sleep statements, so the script would just go through each command regardless whether the previous has finished or not (ie: click SUBMIT before finish sending the input string)
So I thought maybe I'll just put some sleep statements, but then I have to figure out how best to optimize it, AND I have to consider whether others' computers' speeds because a slow computer would need to have longer delays between commands. That would be impossible to optimize for everyone.
I was hoping there was a way to force each line to be run only after the previous has finished?
EDIT: To be more specific, I want the controlsend command to finish executing before I click the buttons.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 ControlSetText 代替 ControlSend。这是立即的(就像 GuiEdit 一样)。
Instead of ControlSend, use ControlSetText. This is immediate (like GuiEdit).
我的解决方案:使用用户定义库“GuiEdit”中的函数直接设置文本框的值。它看起来是立即的,因此使我不必等待发送击键。
My solution: use functions from the user-defined library "GuiEdit" to directly set the value of the textbox. It appears to be immediate, thus allowing me to avoid having to wait for the keystrokes to be sent.