user2984887
user2984887

Reputation:

In AutoIt, WinWait still waits after the window has opened

I used AU3info to make sure I am using the right windows title.

RunWait ("\\sv44\vol1\Install\LibreOffice\install /exenoui")
WinWait("Installation of LibreOffice")
Send("{ENTER}")

What I am trying to achieve: When I the confirmation box appears ("Installation of LibreOffice"), press OK.

WinWait loops forever. I tried WinWaitActive...same result.

How do I make it work?

Upvotes: 1

Views: 951

Answers (1)

Milos
Milos

Reputation: 2946

When manipulating external application windows, always use #RequireAdmin in order to get a permission elevation. Also use Opt("WinSearchChildren", 1) in order to search child windows too. Play with "WinTitleMatchMode".

#RequireAdmin ; Will give your script a permission elevation (sometimes its needed)
Opt("WinTitleMatchMode", 2) ; 1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase
Opt("WinSearchChildren", 1) ; 0=no, 1=search children also

RunWait("\\sv44\vol1\Install\LibreOffice\install /exenoui")
WinWait("Installation of LibreOffic")
Send("{ENTER}")

Notice that I use "Installation of LibreOffic" (missing "e") because Opt is set to use substring and not the whole title (just in case).

Upvotes: 2

Related Questions