如何以编程方式与应用程序交互 [英] How to interact with an application programmatically

查看:43
本文介绍了如何以编程方式与应用程序交互的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可能很快就会从事一些项目,我需要从文件中获取数据并以编程方式将该数据输入到另一个第三方(不是我自己的)应用程序中.一个问题:我不知道如何做到这一点.我需要输入数据(例如时间表上的时间)有人能指导我朝着正确的方向学习这项技能吗?

I am likely to be working on a few projects soon where I will need to take data from a file and input that data programmatically into another third-party (not my own) application. One problem: I have no idea how to do this.I will need to enter data (like times on a time sheet, for exampls) Can anyone steer me in the right direction to acquire this skill?

附加规格:我在深夜写了原始帖子,所以可能没有我应该写的那么详细.这是一个示例:我的客户有一个 ERP 应用程序,他们使用该应用程序从生产线工作人员那里收集时间戳,因为他们全天执行工作并将项目推出.此应用程序没有可用于向其中输入数据的 API.我听说有人能够将数据实际推送到该应用程序窗口中的屏幕上并以编程方式控制,这样数据就能够被收集到 Excel 工作表中,然后有效地上传到该应用程序中.有点像反向屏幕抓取.它不像 API 那样漂亮,但它确实有效.

ADDITIONAL SPECS: I wrote the original post late at night so may not have been as detailed as I should have. Here is an example: My client has an ERP app that they use to collect time stamps from the line workers as they perform their jobs and get projects out the door throughout the day. This app does NOT have an API I can use to feed data into. I have heard of a guy who was able to actually push data onto the screen in this app's windows and controls programmatically, such that the data was able to be collected into, say, an Excel worksheet, then effectively uploaded into this app. Sort of a reverse screen-scrape. It's not pretty like an API would be, but it works.

我见过应用以类似方式与其他应用交互.我能想到的一个很好的例子是 SnagIt,截图工具.您可以命令它对特定应用程序中的窗口进行屏幕捕获,并且当您在该窗口周围移动鼠标时,指针下的控件将以红色轮廓显示,以指示它将为您捕获哪个控件.我认为这很有趣,而且可能离真正能够将文本输入这样的控件仅一步之遥.

I've seen app's interact with other apps in a similar way. One good example I can think of is SnagIt, the screenshot utility. You can order it to screen capture a window in a particular app, and as you move your mouse around that window, the controls under the pointer will outline in red to indicate which control it will capture for you. I think that is interesting, and probably just a step away from actually being able to type text into such a control.

感谢到目前为止的评论和答案,我正在追求它们.

Thanks for the comments and answers so far, I'm pursuing them all.

推荐答案

您或许可以使用 将其自动化AutoIt 脚本.这是一种简单的脚本语言,隐藏了向窗口和控件发送消息的一些复杂性.

You might be able to automate it with an AutoIt script. This is a simple scripting language that hides some of the complexities of sending messages to windows and controls.

这篇关于如何以编程方式与应用程序交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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