从脚本驱动的Windows GUI程序 [英] Driving a Windows GUI program from a script

查看:221
本文介绍了从脚本驱动的Windows GUI程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要使用Windows仿真包略有不同的选项执行重复性的任务各一次。

I have to use a Windows simulation package to perform a repetitive task with slightly different options each time.

因为我讨厌重复的点击操作,在两个懒惰和人的介绍,我想自动驱动这个程序错误量的理由。有问题的程序不支持脚本,没有API,没有COM,虚无缥缈,NYET,nravin。据我所知,自动驱动这一计划的唯一方法是模仿人(即键盘和鼠标宏)

Since I hate repetitive clicking, on grounds of both laziness and the amount of errors that a human introduces, I would like to drive this program automatically. The program in question doesn't support scripting, there is no API, no COM, nada, nyet, nravin. As far as I can tell, the only way to drive this program automatically is to imitate a human (i.e. keyboard and mouse macros.)

我知道AutoHotkey的,但我不认为这不会是我想要的。 (否则可能会做我想做的,但它的脚本语言是可怕的。)

I am aware of AutoHotKey but I don't think it does what I want. (Or it might do what I want, but its scripting language is horrible.)

的要求是:


  • 必须允许行为或事件检测之间的时间延迟来触发动作。

  • Must allow time delays between actions, or event detection to trigger actions.

该模拟可能需要长达十分钟运行,因此GUI司机将不得不等待,直到模拟开始一个新的人之前完成。

The simulations can take up to ten minutes to run, so the GUI driver would have to wait until the simulation finishes before starting a new one.

要做到这一点是只等待十分钟,并希望模拟已完成的一种方式。另一种办法是让事件驱动的,即观看了模拟运行...对话框消失,由一个模拟完成对话框中进行更换。

One way to do this would be to just wait ten minutes and hope that the simulation has finished. An alternative way is to make it event-driven, i.e. watch for the "Simulation running..." dialog to disappear and be replaced by a "Simulation complete" dialog.

必须允许复杂的键盘输入组成。

Must allow composition of complex keyboard input.

一些需要键盘输入的是每个模拟运行不同的。例如模拟说明可能采取的格式 [项目名称] [方案名称] [选项1] [选项2] ... ,这会为每个被输入模拟。

Some of the keyboard input required is different for each simulation run. For example the simulation description might take the format [Project name][Scenario name][Option 1][Option 2]... and this would have to be entered for each simulation.

我知道AutoHotkey的允许输入自定义的基本水平,但我的文档的阅读休闲使得脚本语言看起来像某种怪异恐怖。

I am aware that AutoHotKey allows a basic level of input customisation, but my casual reading of the documentation makes the scripting language look like some kind of eldritch horror.

这是工作,所以任何解决方案都必须是自由的用于商业用途。

This is for work, so any solution must be free for commercial use.

我将接受符合上述标准的解决方案,但我有一个强烈 preference的东西,我可以从Python的车程。不过,我也愿意接受自动化GUI测试工具,我可以定制以做我想做的 - 可能是一个Win32 GUI相当于的浏览器? - 宏观键盘记录器,将产生自定义输出,或其他任何作品

I will accept any solution that fits the criteria above, but I have a strong preference for something I can drive from Python. However I would also accept automated GUI-testing tools that I could customise to do what I want - possibly a Win32 GUI equivalent of Selenium for browsers? - keyboard macro recorders that will generate custom output, or anything else that works.

推荐答案

使AutoHotkey的另一个样子,从你的要求似乎适合这个工作。

Give Autohotkey another look, from you requirements it seems fit for the job.

另外检查从微软UI自动化: http://msdn.microsoft.com /en-us/library/ms747327.aspx 也白: HTTP://white.codeplex.com /

Alternatively check UI Automation from Microsoft: http://msdn.microsoft.com/en-us/library/ms747327.aspx and also white: http://white.codeplex.com/

这篇关于从脚本驱动的Windows GUI程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆