get a window ?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Mark Gevry
Pro Scripter
Posts: 63
Joined: Sat Dec 25, 2004 3:23 pm

get a window ?

Post by Mark Gevry » Sun May 29, 2005 12:45 am

Is there a way to get like 4 windows. Let me explain...

setfocus>in example Slots*
setfocus>in example2 Slots*

They will not both be open, only one, and theres 2 other window names. Which ever window it finds, go to a specific spot in the script. So if it finds like something - Microsoft Internet Explorer, then go do something but if its not there look for someotherscreen - Microsoft Internet Explorer and then go to a different part in the script.

Mark Gevry

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 » Sun May 29, 2005 2:23 am

1. Cannot set focus to Window that is not opened. Can set focus to minimized window, but that will now become the active window.
2. Cannot set focus to more than one window at a time.

Your need is confusing.
Are you trying to loop through all open windows, and if they are a specific application, then perform a particular task?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Mark Gevry
Pro Scripter
Posts: 63
Joined: Sat Dec 25, 2004 3:23 pm

Post by Mark Gevry » Sun May 29, 2005 3:55 am

Something like that. One of the four windows WILL be open. And i need to search which one it is, and perform a certain task.

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 » Sun May 29, 2005 8:46 pm

Maybe something like this?

Code: Select all

Label>Loop
GetActiveWindow>windowtitle,X,Y
If %windowtitle%=InternetExplorer,MSIE
If %windowtitle%=Mozilla,Moz
If %windowtitle%=Notepad,Notes
Wait>30
Goto>Loop

Label>MSIE
do stuff
.....
Wait>30
Goto>Loop

Label>Moz
do stuff
.....
Wait>30
Goto>Loop

Label>Notes
do stuff
.....
Wait>30
Goto>Loop
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Mark Gevry
Pro Scripter
Posts: 63
Joined: Sat Dec 25, 2004 3:23 pm

Post by Mark Gevry » Tue May 31, 2005 2:00 am

Yep thnx Bob!

Mark Gevry

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