Mit AutoIt 3.3.14.2 starten Sie die Anwendung Entrust etunprot.exe. Die Anwendung "Entrust" wird gestartet, hat jedoch keinen Fokus. Nach dem Start der Anwendung soll das AutoIt-Skript das Passwort eingeben, dies jedoch nicht, weil kein Fokus vorhanden ist. Wenn ich auf die Anwendung klicke, um den Fokus festzulegen, wird das Kennwort eingegeben und das Skript wird fortgesetzt und erfolgreich beendet. Ich habe ursprünglich WinWaitActive verwendet und es durch WinWait und WinActivate ersetzt, um das Problem zu beheben. Hier ist der Code:Autoit startet App ohne Fokus
; 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}")
Ich habe diese Idee versucht, aber das Verhalten ist das gleiche. Vielen Dank. –