WaitWindowOpen and IfWindowOpen Failures

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
shadowesq
Newbie
Posts: 10
Joined: Sat Feb 08, 2020 12:51 am

WaitWindowOpen and IfWindowOpen Failures

Post by shadowesq » Thu Jul 02, 2020 5:12 pm

I've been building a new macro using the Chrome Driver, which is incredibly cool.
However, I have bumped into a new problem.
It seems that the WaitWindowOpen and IfWindowOpen commands are failing to detect the presence of the open window. My theory would be that somehow the Chrome Driver window has a different name. But when I run the macro with the Chrome Driver, the WaitWindowOpen and IfWindowOpen commands fail. IfWindowOpen returns a false condition, even if the window is open, and WaitWindowOpen waits forever, and locks up the process, even though the window is actually open.

To get around this today, I'm probably going to have to code something inelegant, like "wait>5" instead of waiting for the window. Any help on this would be appreciated.

Chris

P.S. I forgot to mention that SetFocus is also failing under the same conditions. The window cannot be found.

User avatar
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Re: WaitWindowOpen and IfWindowOpen Failures

Post by PepsiHog » Sun Jul 05, 2020 4:03 pm

Hey shadowesq,

I fall back on IfWindowOpen>. I'd put it in a loop, like "While>some flag is not set". When the window is there then set the flag to end the While loop.

Code: Select all

let>NoWindow=0

While>NoWindow=0

ifWindowOpen>CupCake
    let>NoWindow=1
endif

EndWhile
I just wrote the above at this moment. I'm sure it is correct, but I could have made an error or two. But you get the idea.

Good Luck,
PepsiHog

Oops. Sorry, I don't pay attention very well. But you might wanna try it, just to be sure.
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2021) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

User avatar
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Re: WaitWindowOpen and IfWindowOpen Failures

Post by PepsiHog » Sun Jul 05, 2020 4:18 pm

Okay, attempt two.

How about getting a list of all windows and checking for the "window name".

Code: Select all

// "LowerRightCon" is the window name.
GetWindowList>wl
RegEx>(?is)LowerRightCon.*,wl,0,match,nom,0

mdl>%nom%

In case you don't have experience with RegEx, nom is a result for the search. If not found it will be zero.

PepsiHog
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2021) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

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