Reputation:
I am trying to write an AutoIt3 script to go through a wizard to setup a program. At one point, depending on what has already been installed on the machine, it may or may not pop up another dialog saying something like "This already exists.. what would you like to do?". Then I would make the script handle that dialog and then continue.
The problem is that I can't figure out how to make it branch on something if it pops up without having two separate AutoIt scripts running: one to do the main wizard setup, and one to watch for the possible popup.
Any suggestions?
Upvotes: 0
Views: 3208
Reputation: 5952
If you don't know when it will happen (something that could pop up at any time) you could try this:
AdlibEnable("myadlib")
Func myadlib()
If WinActive("Error") Then
;...
EndIf
EndFunc
From the help file:
AdlibEnable
Enables Adlib functionality.
AdlibEnable ( "function" [, time] )
Parameters
function
The name of the adlib function to call.
time
[optional] how often in milliseconds to call the function. Default is 250 ms.
Upvotes: 2
Reputation: 92762
If you know where in the setup the dialog pops up, you can try this: after you move through the wizard to this point, WinWait for the dialog. If WinWait returns without success, the dialog probably did not pop up.
Upvotes: 2