How to open a child window?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue May 24, 2005 1:42 pm

I may not be understanding properly, but I will try to explain.

Run Program>xxx.exe will attempt to open the program just as if the user clicked on the icon.

If login prompts come up, then macro needs to include the keystrokes for name and/or password. That can be done with Send Character>

Now the windows for drill down should be visible? Now you need to run another Run Program>zzz.exe because you cannot do with manual
keys/mouse move commands?

==================================
Remember that Macro Scheduler simulates a user at a keyboard. List the keystrokes, mouse movements, icons/menu selctions that are used. (Or record macro to collect strokes). Then use the Editor to create/edit the script and fine tune the results.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

sunkara7
Junior Coder
Posts: 25
Joined: Mon May 23, 2005 1:04 pm

Post by sunkara7 » Tue May 24, 2005 2:29 pm

Bob Hansen wrote:I may not be understanding properly, but I will try to explain.

Run Program>xxx.exe will attempt to open the program just as if the user clicked on the icon.

If login prompts come up, then macro needs to include the keystrokes for name and/or password. That can be done with Send Character>

Now the windows for drill down should be visible? Now you need to run another Run Program>zzz.exe because you cannot do with manual
keys/mouse move commands?

==================================
Remember that Macro Scheduler simulates a user at a keyboard. List the keystrokes, mouse movements, icons/menu selctions that are used. (Or record macro to collect strokes). Then use the Editor to create/edit the script and fine tune the results.
Thanks for responding.

I solved the problem. Now i am getting another problem that is....

After opening the drill down window (xxx), if the user wants to open the drill down windows of that xxx window (let us assume he opened 3 drill downs). How can i close the child windows of xxx with out closing the xxx window. I couldn't use WindowAction because there are some 30 drill downs in that xxx window and they may not be in order.

I am able to close all the windows including xxx window using WindowAction>3,xxx. But when i am doing while the child windows of the xxx window are open, its giving me some Program Error(its related to the application not macro shceduler related).

Now my question is how can i close the child windows(3) with out closing the xxx windows.

Hope you understand my question.

Thanks

sunkara7
Junior Coder
Posts: 25
Joined: Mon May 23, 2005 1:04 pm

Post by sunkara7 » Tue May 24, 2005 2:43 pm

s

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue May 24, 2005 3:42 pm

Have you tried searching the forum for an answer. Closing a specific window from multiple windows with the same name is not a simple task.

When you close the xxx window and get error messages, are you doing any damage to your data or are they just simple warnings that you have performed illegal operations or such? If closing all the windows is only a problem because of the message windows popping up. You can detect using IfWindowOpen or WaitWindowOpen with a short timeout and then close the error windows automatically.

Hope this helps,
Dick

sunkara7
Junior Coder
Posts: 25
Joined: Mon May 23, 2005 1:04 pm

Post by sunkara7 » Tue May 24, 2005 4:06 pm

JRL wrote:Have you tried searching the forum for an answer. Closing a specific window from multiple windows with the same name is not a simple task.

When you close the xxx window and get error messages, are you doing any damage to your data or are they just simple warnings that you have performed illegal operations or such? If closing all the windows is only a problem because of the message windows popping up. You can detect using IfWindowOpen or WaitWindowOpen with a short timeout and then close the error windows automatically.

Hope this helps,
Dick
That error is not a simple warning because that will make DDLs to run and may also make system to crash in future. I've tried IfWindowOpen and WaitWindowOpen but they are not working. Because the drill downs are not in oder. I am discribing it below

Main Window ------- Drill Down Window

1 ----------------------> 2 3 4 5 6 7 8 9 10
2 ----------------------> 11 12 13 14
3 ----------------------> 15 16 17 18
.
.
.
and so on

Some windows may close by pressing ALT C but some needs to close by clicking on the x.

I am explaining my problem clearly again

When i run the application it will open the xxx window. If xxx already open then it will use that window. If xxx is open with its drill down windows open then i need to close the drill down windows of xxx window in order to use that window.

My question is ....is there any way that i can close the child windows of xxx with out closing the xxx window.

Thanks

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue May 24, 2005 4:26 pm

Am I misunderstanding or is there an application window that has a number of windows open within it? Something like having multiple document files open in Word.

Is there a "Window" menu item that might contain a list of open windows within the xxx application window?

Will Alt + F4 close those windows that need to have the "X" picked to close.

Dick

sunkara7
Junior Coder
Posts: 25
Joined: Mon May 23, 2005 1:04 pm

Post by sunkara7 » Tue May 24, 2005 5:03 pm

JRL wrote:Am I misunderstanding or is there an application window that has a number of windows open within it? Something like having multiple document files open in Word.

Is there a "Window" menu item that might contain a list of open windows within the xxx application window?

Will Alt + F4 close those windows that need to have the "X" picked to close.

Dick
1. Yes. But those child windows are like dialog boxes with only 'X' for closing of those windows. We can not minimize those windows.

2. Yes. the xxx window menu contains the list of open windows. But after opening the child windows we couldn't go back to the xxx window. After closing the child windows only we can go back to the xxx window.

3. ALT + F4 is working for screens that they are not working for ALT + C

But my question is how can we put this in code. Currently i am doing like this (which is giving the 'Program Error')

IfWindowOpen>xxx,xclose,xopen

Label>xclose
WindowAction>3,xxx

I am getting the error here if there are child windows open.

My concern is instead of closing the xxx window can we close the child windows.

Thanks

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue May 24, 2005 5:25 pm

Have you tried using the WF_TYPE variable? Setting WF_TYPE to 3 should only close child windows.

IfWindowOpen>xxx,xclose,xopen

Label>xclose
Let>WF_TYPE=3
WindowAction>3,xxx

sunkara7
Junior Coder
Posts: 25
Joined: Mon May 23, 2005 1:04 pm

Post by sunkara7 » Tue May 24, 2005 5:48 pm

JRL wrote:Have you tried using the WF_TYPE variable? Setting WF_TYPE to 3 should only close child windows.

IfWindowOpen>xxx,xclose,xopen

Label>xclose
Let>WF_TYPE=3
WindowAction>3,xxx
When i tried the above code i am getting the following Macro Scheduler warning

'Specified Window "Parent Window of XXX" Not Present.
Ant Subsequent Key Sends In Script May Cause Exceptions.'

Why it is looking for the parent window of xxx. We are trying to close the child windows of xxx.

Can we consider drill down windows of xxx as windows or dialog boxes.
Because Let>WF_TYPE=3 is for child windows.

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue May 24, 2005 6:18 pm

Try changing the WF_TYPE to 2 and see if that helps. From the Macro Scheduler help for WindowAction:

Let>WF_TYPE=0 - No Child Windows
Let>WF_TYPE=1 - ALL Windows (Default)
Let>WF_TYPE=2 - Visible Windows Only
Let>WF_TYPE=3 - Child Windows Only


Dick

sunkara7
Junior Coder
Posts: 25
Joined: Mon May 23, 2005 1:04 pm

Post by sunkara7 » Tue May 24, 2005 6:28 pm

JRL wrote:Try changing the WF_TYPE to 2 and see if that helps. From the Macro Scheduler help for WindowAction:

Let>WF_TYPE=0 - No Child Windows
Let>WF_TYPE=1 - ALL Windows (Default)
Let>WF_TYPE=2 - Visible Windows Only
Let>WF_TYPE=3 - Child Windows Only


Dick
I've tried that one too. But its closing the xxx window along with its child windows and giving the 'program error'.

I've also tried the following code. But its doing nothing

IfWindowOpen>xxx,xclose,xopen

Label>xlose
Press ALT
Send>c
Wait>0.1
Release ALT
Wait>0.1
CloseWindow>xxx

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue May 24, 2005 6:29 pm

Can you post screenshot(s) and a brief description of what you are trying to achieve?
MJT Net Support
[email protected]

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