Wait for window not working

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
GOLDENARMOR
Newbie
Posts: 2
Joined: Fri May 21, 2021 2:16 am

Wait for window not working

Post by GOLDENARMOR » Fri May 21, 2021 2:24 am

Wondering if some one knows how to get a script to wait for google chrome browser window to close
before it continues on with the script ,

ex

CapsOff
MouseMove>1628,745
Wait>0.2
LClick
Wait>7
MouseMove>2510,97
Wait>0.2
LClick
WaitWindowClosed>New Tab - Google Chrome
Wait>0.2
MouseMove>2510,97
Wait>80
LClick
Wait>0.2



so it wont wait until chrome is closed , i think i have to get the chrome sesion id, but not sure how to do that

also tried this

WaitWindowClosed>Untitled - Google Chrome

hope some one can help ,
Thanks

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1390
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Wait for window not working

Post by Dorian (MJT support) » Fri May 21, 2021 10:08 am

My guess is that tab isn't selected. Macro Scheduler Window functions only see the title of the active tab. So if another tab is selected it won't be able to see the one you're wanting/waiting to close. If you ensured that tab was selected, this should work every time. So select it first, then close it, and see if that makes a difference.

Also, are you 100% sure the window title is correct?

the code below demonstrates that WaitWindowClosed will work on a Chrome tab, if it's the active tab. I just tried it and it waited as expected.

I used GetActiveWindow first to make sure I had the window title correct.

Code: Select all

//Get the window name
//wait while you manually select the Chrome tab
wait>3
GetActiveWindow>name,xx,yy,ww,hh
//Put the name in the clipboard
put>name
mdl>name
"name" returned "Bing - Google Chrome", and seeing as it's now in the clipboard we can just paste it into our WaitWindowClosed line. So :

Code: Select all

MouseMove>1769,42
Wait>0.2
LClick
WaitWindowClosed>Bing - Google Chrome
mdl>closed!
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Grovkillen
Automation Wizard
Posts: 1131
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Wait for window not working

Post by Grovkillen » Fri May 21, 2021 2:58 pm

Yeah the tab interface isn't windows standard and you only see it as tabs. Windows see it as one window and the active tab is giving that window its title. That's a hack (a good one in my opinion) "invented" by Google.
Let>ME=%Script%

Running: 15.0.27
version history

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