SetFocus Issue

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

SetFocus Issue

Post by gchichester » Mon Feb 02, 2009 9:11 pm

I need to know if the "SetFocus" function is supposed to bring the window being
called to the front of any/all open windows? I have a application that uses a print
preview app (DocWiz) to print all reports and forms.
I can't get it to be the front most window when I request a print job via a script.
I have tried using the following optons in the script.

WaitWindowOpen>"Windows Name"
SetFocus>"Windows Name"
I used the View System Windows tool to make sure I getting the correct window name.
and I also tried used the WIN_USEHANDLE variable

Part of the script that's using setfocus
Press Enter
Wait>1
SetFocus>CargoPoint Document Viewer
Wait>1
Press Tab * 6
Wait>1
Press Enter
Wait>5
Press Alt
Press F4
Release Alt
Wait>2
Press Alt
Send c
Release Alt

Thanks you help
Gilc

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

Post by JRL » Mon Feb 02, 2009 9:59 pm

What happens if you add an asterisk (*) at the end of the SetFocus line?

SetFocus>CargoPoint Document Viewer*

idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

Post by idiot » Tue Feb 03, 2009 9:47 am

good question that would be easier i usually use alt tab function and image recognition to bring wich window i want forward
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

SetFocus Issue

Post by gchichester » Thu Feb 05, 2009 4:53 pm

JRL,
Thanks the asterisk (*) did the trick.

Gilc

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