0
使用AutoIt 3.3.14.2啓動Entrust etunprot.exe應用程序。委託申請開始,但沒有重點。應用程序啓動後,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}")
試過這個想法,但行爲是一樣的。謝謝。 –