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.
Dialog Box With Same Name As Form
Moderators: JRL, Dorian (MJT support)
-
- Macro Veteran
- Posts: 267
- Joined: Mon Sep 27, 2010 8:57 pm
- Location: Seattle, WA
Re: Dialog Box With Same Name As Form
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
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
Re: Dialog Box With Same Name As Form
Thanks for the suggestions. I will give those a try to see they will work.
Re: Dialog Box With Same Name As Form
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
Thanks for your suggestions.
Frank