Problem with WaitWindowOpen

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

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

Problem with WaitWindowOpen

Post by shadowesq » Sat Feb 08, 2020 1:05 am

I am having a problem getting the WaitWindowOpen feature to behave. I use Google Chrome. When Chrome starts on my computer, my Google Calendar is my default page, so it will load first when Chrome is started.

My problem is that when the code executes, it starts Chrome, but instead of waiting for the window to be properly opened, the SetFocus command gets executed and the macro terminates with an error dialog box telling me that the macro could not find the window.

Any thoughts on what I am doing wrong would be greatly appreciated. Thank you.

Here is the code in question.

Label>StartChrome
RunProgram>C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
WaitWindowOpen>Google Calendar*
Wait>2
SetFocus>Google Calendar*

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

Re: Problem with WaitWindowOpen

Post by Dorian (MJT support) » Sat Feb 08, 2020 7:37 pm

Is this the entire script or do you have a WW_TIMEOUT set at some point before this?
Yes, we have a Custom Scripting Service. Message me or go here

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

Re: Problem with WaitWindowOpen

Post by shadowesq » Sat Feb 08, 2020 10:18 pm

That code is in the beginning of my script, and I did not set WW_TIMEOUT at all. My reading of the documentation is that the default value of WW_TIMEOUT is zero, meaning that the script will wait forever for the window to open before processing continues.

Thanks for replying! I'm new here!

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

Re: Problem with WaitWindowOpen

Post by Marcus Tettmar » Mon Feb 10, 2020 7:30 am

If your code is shooting straight past the WaitWindowOpen line then that there must already be a window open on your system that matches the text given. It could be hidden. Try setting WF_TYPE to 2:

Let>WF_TYPE=2
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

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