AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

If statement that will work for switching between windows

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
pt80chip



Joined: 27 Feb 2008
Posts: 20

PostPosted: Mon May 05, 2008 10:52 pm    Post subject: If statement that will work for switching between windows Reply with quote

Hi. I have a program that changes it's that has a winactive name that changes every time you open a different document, just like excel for example.
What I'd like to do is go to that program and enter some information into the correct document. If that document is not open, then do a file, open and select the document. The program would always be open on my computer and only have 1 of 4 different documents open.
Here is an example. If you open Microsoft Excel and opened a spreadsheet called test1, this is what the name of the window would be: Microsoft Office Excel 2003 - test1.
However, I may have test2 open, so I need AHK to check to make sure that test1 is open, if it is, WinActivate Microsoft Office Excel 2003 - test1. If not, it has to look for test2, if that is open, then it should open test1. if it isn't open either, then look for test3, if it is open, then it should close it and open test1.
Any ideas?
Regards,
Andy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group