WaitWindowOpen and WIN_USEHANDLE

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

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

WaitWindowOpen and WIN_USEHANDLE

Post by JRL » Thu Apr 26, 2007 2:06 pm

According to WaitWindowOpen> help:
If the WIN_USEHANDLE variable is set to 1 window_title must be a window handle
I've been struggling for a hour trying to write a script that I can't debug in the editor because of the nature of the program that I'm running. I wrote this test script and what I believe I've found is that WaitWindowOpen and WIN_USEHANDLE are not playing together well.

If I set WIN_USEHANDLE to 0 the following script runs without error. However If I set WIN_USEHANDLE to 1 this is what I see happening.

1- GetActiveWindow sets the variable "title" to the notepad window handle
2- WaitWindowOpen>notepad* executes, but according to the way I understand the Help for WaitWindowOpen> it should timeout instead
3- WaitWindowOpen>%title% times out, but according to the way I understand the Help for WaitWindowOpen> it should execute.
4- Changing the value of WF_TYPE has no effect except for WF_TYPE=3 and Notepad has no child windows

Code: Select all

Run>notepad.exe
Let>WIN_USEHANDLE=1
Let>WF_TYPE=0
Let>WW_TIMEOUT=2
GetActiveWindow>title,x,y
WaitWindowOpen>notepad*
MDL>Use Handle=%WIN_USEHANDLE%%CRLF%Win Result=%WW_RESULT%%CRLF%Title=%title%
WaitWindowOpen>%title%
MDL>Use Handle=%WIN_USEHANDLE%%CRLF%Win Result=%WW_RESULT%%CRLF%Title=%title%
CloseWindow>%title%
What am I doing wrong?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Apr 26, 2007 3:07 pm

Looks like a bug. Will have that fixed.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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

Post by JRL » Thu Apr 26, 2007 3:21 pm

Thank you Marcus.

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Thu Apr 26, 2007 3:30 pm

Nice discovery JRL, thanks for spotting that.

:!: Long Live the Forums :!:
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

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