I'm trying to use AdlibRegister to do a WinWaitActive, and type some credentials for me.
I'm only doing it this way because I need to type the credentials into a popup that appears from a previous command that doesn't finish until the credentials are typed.
If GUICtrlRead($cAuto) = $GUI_CHECKED Then AdlibRegister("EnterCreds2", 5000) ExecuteCmd("Connect-MsolService") AdlibUnRegister("EnterCreds2") Else ExecuteCmd("Connect-MsolService") EndIf Func EnterCreds2() If WinWaitActive("Enter Credentials", "", 4) <> 0 Then Send(GUICtrlRead($iUsername) & "{TAB}" & GUICtrlRead($iPassword) & "{ENTER}") EndIf EndFunc ;==>EnterCreds2
Is this the wrong way to do it? Or is it not possible?
I suppose another way to do it is by running a separate script that I pass the credentials to, but that doesn't appeal to me if there is an alternative.