WaitWindowOpen> HANGS application

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
ED
Newbie
Posts: 9
Joined: Fri Mar 14, 2008 12:49 pm

WaitWindowOpen> HANGS application

Post by ED » Fri Mar 14, 2008 1:12 pm

WaitWindowOpen> HANGS application

WaitWindowOpen>Setup
setfocus>Setup
WaitWindowOpen>Confirm

The script will halt at this stage and I have to close Confirm window manually else it HANGS together with msched

please help

Code: Select all

/////////////////////////////////////////////////////////////////////////////////////
// Prinstall_WinACE
Let>Title=Prinstall_WinACE

/////////////////////////////////////////////////////////////////////////////////////
VBSTART

Const OverWriteFiles = True

Set objFSO = CreateObject("Scripting.FileSystemObject")

Sub BoxMsg (msg)
   MsgBox msg
End Sub

Sub DeleteDir (Input)
  Set onstart = CreateObject("Scripting.FileSystemObject")
  Onstart.DeleteFolder(Input)
  Set OnStart = nothing
End Sub

Sub CopyDir (SourceDir,TargetDir)
  objFSO.CopyFolder SourceDir , TargetDir , OverWriteFiles
End Sub

VBEND

/////////////////////////////////////////////////////////////////////////////////////
// GLOBAL INIT
CapsOff
Let>CF_OVERWRITE=1
Let>RP_WAIT=2
Let>SK_DELAY=10

// GLOBAL
Let>SourceDir=Z:\RE\PH\Install\Winace
Let>InstallDir=C:\Program Files\WinAce
Let>Installer=wace261i.exe

// UNIQUE
Let>Application=winace.exe
Let>Serial=??????????????????????

/////////////////////////////////////////////////////////////////////////////////////
// START APPLICATION

Gosub>Temporize
Gosub>Run,"%TEMP_DIR%%Title%\%Installer%"

Label>1
  Gosub>WaitWinOpen,Information
  Press Enter
  Gosub>WaitFailWinClose,Information,1

Gosub>WaitWinOpen,Choose Destination Location
Send Character/Text>InstallDir

Gosub>Focus,Choose Destination Location
Press Enter

Gosub>WaitWinOpen,Sfx-Factory!
Send>j

WaitWindowOpen>Setup
setfocus>Setup
WaitWindowOpen>Confirm
 
Goto>Finished

/////////////////////////////////////////////////////////////////////////////////////
// SUBROUTINES

  SRT>CloseApp
    Press ALT
    Press F4
    Release ALT
	Wait>2
  End>CloseApp

  SRT>Focus
	SetFocus>Focus_Var_1
    WaitReady>0
	Wait>1
	SetFocus>Focus_Var_1
  End>Focus

  SRT>WaitWinOpen
    WaitWindowOpen>WaitWinOpen_Var_1
    Gosub>Focus,WaitWinOpen_Var_1
  End>WaitWinOpen

   SRT>WaitFailWinOpen
    ifWindowOpen>WaitFailWinOpen_Var_1
	  Gosub>Focus,WaitFailWinOpen_Var_1
	else
      wait>1
      Assigned>WaitFailWinOpen_Var_2,strNameExists
      If>strNameExists=TRUE
	    goto>WaitFailWinOpen_Var_2
	  endif
    endif
  End>WaitFailWinOpen

  SRT>WaitFailWinClose
    ifWindowOpen>WaitFailWinClose_Var_1
	  Gosub>Focus,WaitFailWinOpen_Var_1
	  Assigned>WaitFailWinClose_Var_2,strNameExists
      If>strNameExists=TRUE
	    goto>WaitFailWinClose_Var_2
	  endif
	endif
  End>WaitFailWinClose

  SRT>Temporize
    VBRun>CopyDir,%SourceDir%,%TEMP_DIR%%Title%
  End>Temporize

  SRT>Run
    Run Program>Run_Var_1
    WaitReady>0
    Wait>2
  End>Run

// SUBROUTINES END

/////////////////////////////////////////////////////////////////////////////////////
Label>Finished
:shock:

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Fri Mar 14, 2008 1:35 pm

I notice you are sending the window name to a subroutine as a variable. Unless that is the EXACT window name, you might want to add an * at the end of the variable name so that it will find any window name beginning with the variable value.

Also, be sure to set a WW_TIMEOUT to some value that is realistic for you situation. For instance, let>WW_TIMEOUT=10 so that after 10 seconds you consider that a failure and have your code respond accordingly.

ED
Newbie
Posts: 9
Joined: Fri Mar 14, 2008 12:49 pm

Post by ED » Fri Mar 14, 2008 1:56 pm

I notice you are sending the window name to a subroutine as a variable. Unless that is the EXACT window name, you might want to add an * at the end of the variable name so that it will find any window name beginning with the variable value.

it also happens with ifwindowopen, waitwindowopen ..
and only at the Confirm dialog

Also, be sure to set a WW_TIMEOUT to some value that is realistic for you situation. For instance, let>WW_TIMEOUT=10 so that after 10 seconds you consider that a failure and have your code respond accordingly.

wait>120
this was just just me testing when I already discovered a poblem
msched will never get to this command
wait>120

I used trace, F8
it happens at ifwindowopen, waitwindowopen ..
and only at the Confirm dialog

I always get the window handles from recorded and past them in
then i rewrote it, to make it shorter & ..
:roll:

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Mar 14, 2008 2:03 pm

Just curious ... does the Confirm window open, but Macro Scheduler does not recognize it? Of are you still waiting for the Confirm to open? Or has it already opened and closed?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Fri Mar 14, 2008 2:03 pm

Go to the macro properties and turn on logging. Then run the macro, let it hang and then look at the log file.

ED
Newbie
Posts: 9
Joined: Fri Mar 14, 2008 12:49 pm

Post by ED » Fri Mar 14, 2008 2:47 pm

When i try running it I get a popup box ..

Macro Scheduler - Warning

Specified Window "WaitFailWinOpen_Var_1" Not Present.
Any Subsequent Key sends In Script May Cause Exeptions.

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Fri Mar 14, 2008 3:04 pm

so, then you are not passing any variable to your subroutine, but it is written to expect a variable.

put % signs around the variable so that a value shows in the log file. and be sure you call the subroutine with a variable.

User avatar
JRL
Automation Wizard
Posts: 3525
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Mar 14, 2008 3:48 pm

Ed,
If you have posted your entire script, I don't see where you have run the line GoSub>WaitFailWinOpen,parameter. Without running the Gosub>, variable WaitFailWinOpen_Var_1 will not exist. Therefore your line: Gosub>Focus,WaitFailWinOpen_Var_1 will pass the text "WaitFailWinOpen_Var_1" rather than a value for that variable. Then a setfocus to a nonexistant window window named "WaitFailWinOpen_Var_1" will cause the Specified Window "WaitFailWinOpen_Var_1" Not Present error.

Hope this makes sense.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts