Maximize Child Window

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Maximize Child Window

Post by kpassaur » Tue Mar 13, 2007 10:00 am

My end goal is to capture the file name of the document that is open in Acrobat. I know that I can get it from the Window Title and parse out the line (I have been doing that) However, if the Child window is not maximized the file name does not dispaly in the window title bar. Therefore my though was to maximize the child window first.

Since it dosn't work I am missing something.


I though that if I set the focus to Acrobat, then the child window then maximize it would work.

Let>WF_TYPE=0
SetFocus>Adobe Acrobat Professional*
Let>WF_TYPE=3
SetFocus>.pdf*
GetActiveWindow>window_title,x,y
WindowAction>1,%window_title%*


Anyone know what I am missing?

User avatar
Captive
Macro Veteran
Posts: 213
Joined: Sun Oct 20, 2002 8:37 pm
Location: Colorado, USA

Post by Captive » Wed Mar 14, 2007 6:45 am

Ahh this took a little testing but I see the problem;
... -> WindowAction>1,%window_title%*
In this case, your %window_title% is the parent window (ie, it says "Adobe Acrobat Professional").

Normally this would cause your main acrobat window to maximize... but because you have WF_TYPE=3 (child windows only), this doesn't happen.
(It doesn't maximize the child window, because you're asking to maximize the window that says "Adobe Acrobat Professional", and not one that says "something.pdf".)

What you probably want, is something more like this;

IfWindowOpen>.pdf*
Let>WF_TYPE=3
WindowAction>1,.pdf*
Endif

Which will maximize the first found child window in any application that has the text ".pdf" somewhere in the window title.

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Maximize child pdf

Post by kpassaur » Wed Mar 14, 2007 7:55 am

Thank you, this appears to do the trick

Let>WF_TYPE=0
SetFocus>Adobe Acrobat Professional*
Wait>.2
Let>WF_TYPE=3
IfWindowOpen>.pdf*
SetFocus>.pdf*
WindowAction>1,.pdf*
Wait>.2
Endif
GetActiveWindow>window_title,x,y
MDL>%window_title%

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