AutoIt3 - 如果弹出窗口如何分支?

发布于 2024-08-06 22:40:33 字数 233 浏览 4 评论 0原文

我正在尝试编写一个 AutoIt3 脚本来通过向导来设置程序。在某一时刻,根据计算机上已安装的内容,它可能会也可能不会弹出另一个对话框,其中显示诸如“这已经存在......您想做什么?”之类的内容。然后我会让脚本处理该对话框,然后继续。

问题是,如果没有运行两个单独的 AutoIt 脚本,我无法弄清楚如何使其在某些内容上分支如果:一个用于执行主向导设置,另一个用于监视可能的弹出窗口。

有什么建议吗?

I am trying to write an AutoIt3 script to go through a wizard to setup a program. At one point, depending on what has already been installed on the machine, it may or may not pop up another dialog saying something like "This already exists.. what would you like to do?". Then I would make the script handle that dialog and then continue.

The problem is that I can't figure out how to make it branch on something if it pops up without having two separate AutoIt scripts running: one to do the main wizard setup, and one to watch for the possible popup.

Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

猫腻 2024-08-13 22:40:33

如果您知道在设置中的哪个位置弹出对话框,您可以尝试以下操作:通过向导移动到此位置后,WinWait 用于该对话框。如果 WinWait 返回没有成功,则该对话框可能没有弹出。

If you know where in the setup the dialog pops up, you can try this: after you move through the wizard to this point, WinWait for the dialog. If WinWait returns without success, the dialog probably did not pop up.

自由如风 2024-08-13 22:40:33

如果您不知道它何时会发生(随时可能弹出的内容),您可以尝试以下操作:

AdlibEnable("myadlib")

Func myadlib()
    If WinActive("Error") Then
        ;...
    EndIf
EndFunc

从帮助文件中:

Adlib启用

<小时>

启用 Adlib 功能。

AdlibEnable("函数"[,时间])

参数

  • function 要调用的 adlib 函数的名称。

  • 时间 [可选] 调用函数的频率(以毫秒为单位)。默认值为 250 毫秒。

If you don't know when it will happen (something that could pop up at any time) you could try this:

AdlibEnable("myadlib")

Func myadlib()
    If WinActive("Error") Then
        ;...
    EndIf
EndFunc

From the help file:

AdlibEnable


Enables Adlib functionality.

AdlibEnable ( "function" [, time] )

Parameters

  • function The name of the adlib function to call.

  • time [optional] how often in milliseconds to call the function. Default is 250 ms.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文