在ERP程序中使用AutoIt单击字段 [英] Clicking Field with AutoIt in an ERP program

查看:63
本文介绍了在ERP程序中使用AutoIt单击字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的情况:

我正在启动AutoIT记录器.我使用键盘进行录制是因为使用鼠标会导致脚本在大多数情况下停止运行,或者在启动后执行某些不准确的操作.

I am starting AutoIT recorder. I record using the keyboard since using the mouse causes the script to stop most of the time or does something inaccurate when started after that.

我要做的是打开我创建的Excel模板.然后,我进入ERP系统并复制几列,然后将其粘贴到Excel中.插入这些列后,将根据我之前插入的公式计算出更多的列.

What I do is I open up an Excel template I have created. I then go into an ERP system and copy a few columns which I paste into Excel. After these columns are inserted, a few more columns are calculated from the formulas I have previously inserted.

问题在于,当我进入ERP系统时,我选择了一个特定的时间段...让我们说11月1日至11月31日.然后,我保存excel,并使用Excel选项将带有excel报告的电子邮件发送给特定的人.

The problem is that when I am into the ERP system I have selected a specific time period...Let's say 1st November till 31st November. I then save the excel and use the Excel option to send an email to specific people with the excel report attached.

我将autoit脚本编译为一个exe,并且我有一个调度程序来启动exe.问题是我需要一种将日期更改为12月,然后将一月等的日期的方法....如何使用AutoIt来做到这一点?可以做到吗?

I compile the autoit script to an exe and I have a scheduler which starts the exe. The problem is that I need a way to change the date to December, then January and so on... How do I do that using AutoIt? Can it be done at all?

这是ERP计划中日期的样子:

This is how the date looks like in the ERP program:

推荐答案

您首先需要使用AutoIt窗口信息工具检查程序:将目标图标拖到要单击的文件上-使用

You need to first inspect the program using AutoIt Window Info tool: drag the target icon to the filed you wish to click on - use ControlClick. Let's take an example with Excel, it says the title is: "Book1 - Excel" and the ID of the button I chose is "1001", the script will be:

ControlClick("Book1 - Excel", "", 1001)

如果没有任何ID,则将变得更加困难,因为您需要

If there isn't any ID, it will be harder as you'll need to MouseClick by coordinates which is prone for errors...

更改时间::要根据当前月份更改日期选择,您将需要以下内容:

Changing the time: in order to change the date picking according to the current month you'll need something like:

Local $stringInCell = ControlGetText("ERP title", "text in ERP window (can be empty)", controlID)
If @MON = StringLeft($stringInCell, 2) Then
    ControlClick("ERP title", "text in ERP window (can be empty)", controlID)
EndIf

其中 @MON 是宏,而 StringLeft 类似于开头,假设前两个字符对您有好处(例如1月是01).

Where @MON is a macro, and StringLeft is like starts with, assuming the first 2 characters are good for you (e.g. January is 01).

这篇关于在ERP程序中使用AutoIt单击字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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