【发布时间】:2014-12-10 10:05:03
【问题描述】:
我是 AutoHotKey 的新手,到目前为止,我认为自己很幸运能够创建一个脚本来自动化窗口中大约 90% 的数据输入。我现在正试图将它提升一个档次,并在我的数据输入脚本中添加一个警告/警告 GUI。我想暂停正在运行的脚本并打开一个 GUI,它会提醒我查看已经输入的内容,如果某个特定条目看起来不错,一个按钮可以让事情继续进行,另一个按钮可以从 GUI 和如果输入不正确,则脚本的其余部分。
这是我想出的一些代码,混合了一些伪代码来帮助显示我想要做什么。
(Previous data entry script executes to this point)
Stop the script
Gui, New
Gui, Add, Text, 'n Check Authorization Number to be sure it is A1234 (FY 15). ; Wraps text
Gui, Add, Button, Default, Continue
Gui, Add, Button, Quit
Gui, Show, IMPORTANT!
If Continue button is clicked
----Continue with script
If Abort button is clicked
----Close the GUI
----Exit the entire script
(Resume where I left off with rest of the data entry script)
我已经阅读了 AHK 帮助文件,对如何使这些按钮起作用,以及如果我点击继续,如何正确地从 GUI 返回脚本,或者如果我发现问题。我可以调整诸如 GUI 的大小和按钮位置之类的东西;最重要的是让 GUI 代码正确。有人可以帮忙写代码吗? (我最后一次上编程课是在 2003 年,所以我已经忘记了很多!)
【问题讨论】:
标签: user-interface button autohotkey