Dialog Box With Same Name As Form

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
BettAdmin
Newbie
Posts: 3
Joined: Thu Dec 03, 2015 9:53 pm

Dialog Box With Same Name As Form

Post by BettAdmin » Fri Dec 04, 2015 1:55 pm

Trying to automate a process on my ERP Software. I need to have the macro wait until the Dialog/Popup Box opens and cannot figure out the best way to "Catch" it. The Dialog Box has the same name as the master form. I have tried this code but the Dialog Box doesn't seem to be a child. Anyone have any ideas?

Let>WF_TYPE=3
IfNotWindowOpen>ERP System - Update,,
Wait>5.0
Goto>BETREP
ELSE
SetFocus>ERP System - Update
Wait>2.0
Press ENTER
EndIf

Thanks in advance.

Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Re: Dialog Box With Same Name As Form

Post by Jerry Thomas » Fri Dec 04, 2015 4:31 pm

There are a couple of options, but it will take playing around and seeing what will work best

If the dialog will always have some specific text, there is WaitScreenText

You could put GetWindowList in a loop and then wait for 2 iterations of that name in the list
Find 1 instance of that name on screen. Check the size to see if dialog or form
If form, minimize then find dialog name on screen again and do the dialog stuff

If the dialog will take focus, you can set the focus somewhere else (away from the form) and wait for the dialog to take the focus with WaitWindowFocused

WaitWindowChanged (if the dialog is only screen change that will be happening)

WaitScreenImage for some portion of the dialog
Thanks,
Jerry

[email protected]

BettAdmin
Newbie
Posts: 3
Joined: Thu Dec 03, 2015 9:53 pm

Re: Dialog Box With Same Name As Form

Post by BettAdmin » Fri Dec 04, 2015 7:17 pm

Thanks for the suggestions. I will give those a try to see they will work.

BettAdmin
Newbie
Posts: 3
Joined: Thu Dec 03, 2015 9:53 pm

Re: Dialog Box With Same Name As Form

Post by BettAdmin » Mon Dec 07, 2015 1:38 pm

After some experimentation, I was able to get the functionality I needed by getting the Window Size and using an IF statement.

Thanks for your suggestions.

Frank

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