Hi
Aaron,
Aaron wrote:This is the message I got when I added,
Code: Select all
MDL>1) waiting for window "Editor - Script_05" to open
WaitWindowOpen>Editor - Script_05
MDL>2) window "Editor - Script_05" has opened - now waiting for it to close
WaitWindowClosed>Editor - Script_05
MDL>3) window "Editor - Script_05" has closed - processing...
2) window "Editor - Script_05" has opened - now waiting for it to close
But the window was not yet opened. For some reason it thinks the window is already open
I created two test macros and am now wondering what is going on as well... perhaps Marcus or one of the others can fill us in.
Please create and save this test script (I called it "Window Watcher"):
Code: Select all
//"Window Watcher" test script for Aaron by jpuziano
//set which window title we want to monitor (comment out the other)
Let>window_title_to_watch=Untitled - Notepad
//Let>window_title_to_watch=Editor - Script_05
MDL>"Window Watcher" Macro Running%CRLF%%CRLF%Now monitoring window title: %window_title_to_watch%%CRLF%%CRLF%(press SHIFT-ESC to abort at any time)
Label>KEEP_WATCHING
MDL>1) waiting for window "%window_title_to_watch%" to open%CRLF%%CRLF%(press SHIFT-ESC to abort at any time)
WaitWindowOpen>%window_title_to_watch%
MDL>2) window "%window_title_to_watch%" has opened - now waiting for it to close%CRLF%%CRLF%(press SHIFT-ESC to abort at any time)
WaitWindowClosed>%window_title_to_watch%
MDL>3) window "%window_title_to_watch%" has closed - let's keep watching%CRLF%%CRLF%(press SHIFT-ESC to abort at any time)
Goto>KEEP_WATCHING
Now create and save this test script, be sure to name it "Script_05":
Code: Select all
//test script for Aaron - this is just a script that will be
//opened and closed in the Macro Scheduler Advanced Editor.
//Another script called "Window Watcher" should be running in the
//backgroup and it should notice when this script "Script_05"
//is opened and closed in the MS Advanced editor and put out dialogs
//announcing what it has seen.
Notepad Window Test:
1) create and save the two macros above
2) make sure you don't have any Notepad windows open
3) run "Window Watcher" and let it keep running in the background
4) open a Notepad window; observe that Window Watcher sees this
5) close the Notepad window, again Window Watcher sees this and resets
6) open a Notepad window again... close... repeat as often as you want, Window Watcher keeps working correctly
7) press SHIFT-ESC to abort the running macro (Window Watcher)
Macro Scheduler Advanced Editor Window Test:
1) edit the "Window Watcher" macro so we will now be watching for a particular script to open in the Macro Scheduler Advanced Editor... the two lines should now look like this:
//Let>window_title_to_watch=Untitled - Notepad
Let>window_title_to_watch=Editor - Script_05
2) save the above change and make sure you don't have any other macros open in the Macro Scheduler Advanced Editor.
3) run "Window Watcher" and let it keep running in the background
4) open script "Script_05" in the Macro Scheduler Advanced Editor; observe that Window Watcher is blind to this (for the moment)
5) close script "Script_05" in the Macro Scheduler Advanced Editor; observe that only now, Window Watcher sees and reports on the open event and starts waiting for the close event... but the close event has already happened... Window Watcher has now been tricked and will wait forever for a window to close that no longer exists.
6) open "Script_05" in the Advanced Editor, close it, open it, close it... nothing can bring Window Watcher back to life.
No doubt, this is the problem that Aaron is talking about.
Can Marcus or anyone explain why Window Watcher works so well watching a Notepad window open and close... but fails when it tries to watch a Macro Scheduler Advanced Editor window open and close?
For double points... can anyone fix Window Watcher so that it works correctly in all cases?
Thanks for being persistant Aaron.