【发布时间】:2017-04-04 15:46:44
【问题描述】:
使用 AutoIt 3.3.14.2 启动 Entrust etunprot.exe 应用程序。 Entrust 应用程序启动,但没有焦点。应用程序启动后 AutoIt 脚本应该输入密码,但没有因为没有焦点。当我单击应用程序使其获得焦点时,输入密码并且脚本继续并成功完成。我最初使用 WinWaitActive 并将其替换为 WinWait 和 WinActivate 以尝试解决问题。代码如下:
; Terminate script if no command-line arguments
If $CmdLine[0] = 0 Then Exit (1)
Run("C:\Program Files\Entrust\Password Unprotect\etunprot.exe " & $CmdLine[1])
WinWait("Entrust Password Unprotect", "OK")
WinActivate("Entrust Password Unprotect", "OK")
; Enter the password text
Send("password")
; Submit the password
Send("{ENTER}")
WinWait("Entrust Password Unprotect", "Enter name of output folder")
WinActivate("Entrust Password Unprotect", "Enter name of output folder")
; Enter the name of the output folder
Send($CmdLine[2])
; Unprotect the enp file
Send("{ENTER}")
【问题讨论】:
标签: autoit