pythonexeautoitpyinstallercompiled

autoit doesnt detect windows in compiled python script


I am using AutoItX3.Control via win32com.client to detect and close Windows security dialog ("do you trust..."). I use WinExist with window title\text and It works fine when running the python script (Autoit version is 3.3.8.1).

Problem is with the compiled Python script (compiled with PyInstaller). The window is not detected and I can't close it. When I run the Autoit application (SciTE4AutoIt3) it does detect the window.

Any advice?

///// adding some more info: using the following autoit options:

Opt('WinWaitDelay', 500)
Opt('SendKeyDelay', 8)
Opt('WinTitleMatchMode', 4)
Opt('WinSearchChildren', 1)
Opt('SendKeyDownDelay', 10)
Opt('WinDetectHiddenText', 1)

also, Im running the autoit on another process as an instance of the Process class (Process(target=handle_window_func))


Solution

  • Solved by running both the autoit functionality and the process triggering the pop up window in the same script and monitoring for the pop up while the process runs: popup_p = Popen(*cmd_args, no_wait=True, *cmd_kwargs) while popup_p.is_running(): handle_window_func() time.sleep(1) Note that Popen is run with no_wait - returns the process without waiting for it to finish.