Jump to content

Recommended Posts

Posted (edited)

I am having some trouble that I can't seem to find a solution to. I have a script where I need to pass some mouse movements, but the window I need it done on never gets past the WinWaitActive portion of the script below.

Run($Source & "\VIMSpc\VIMS\setup.exe /s")
WinWait("VIMS Import")
MsgBox(0,"Debug","Window Exists")
If Not WinActive("VIMS Import") Then WinActivate("VIMS Import")
MsgBox(0,"Debug","Window Exists")
               $Wait = WinWaitActive("VIMS Import",10)
    If $Wait > 0 Then
        BlockInput(1)
        MouseMove(131,45)
        MouseDown("left")
        MouseUp("left")
        BlockInput(0)
        Sleep(1000)
    EndIf
EndIf
_FileWriteLog($Source & "\Installation Logs\VIMSpc.log", @ComputerName)
Exit

I even threw in a line as follows below the WinWait command to see if it was flipping out after the Window was created:

$test = WinExists("VIMS Import")
MsgBox(0,"Debug",$Test)

Both MsgBox lines show up, but it just hangs on the WinWaitActive line and does nothing. The timeout doesn't even appear to be working. Am I missing something obvious?

Edited by Anaxibius
Posted (edited)

The text parameter is missing on the WinWaitActive

Run($Source & "\VIMSpc\VIMS\setup.exe /s")
WinWait("VIMS Import")
MsgBox(0,"Debug","Window Exists")
If Not WinActive("VIMS Import") Then WinActivate("VIMS Import")
MsgBox(0,"Debug","Window Exists")
$Wait = WinWaitActive("VIMS Import", "", 10)
If $Wait > 0 Then
    BlockInput(1)
    MouseMove(131,45)
    MouseDown("left")
    MouseUp("left")
    BlockInput(0)
    Sleep(1000)
EndIf
_FileWriteLog($Source & "\Installation Logs\VIMSpc.log", @ComputerName)
Exit

Edit:

Removed an extra Endif in the code as well.

Edited by MHz

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...