ImTheShane Posted April 7, 2008 Posted April 7, 2008 I apologize if the answer to this is posted elsewhere. I did a forum search and checked the included help file and couldn't find what I was looking for. Let's say that I have two windows, both with the exact same name. Let's call them Test1 and Test2. I want to activate Test1 using WinActivate and send a command to it, then activate Test2 using WinActivate and send a command to it as well. So far when I try, it will just activate one of the windows. WinActivate is the correct function to use, correct? If so, how do I differentiate between the windows assuming there is no text that can be used as the second argument of WinActivate?
d4rk Posted April 7, 2008 Posted April 7, 2008 work with the first, close it, then do the same with the 2nd [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys
ImTheShane Posted April 7, 2008 Author Posted April 7, 2008 That would work, but it's not what I intend for it to do. I need to keep both windows open.
d4rk Posted April 7, 2008 Posted April 7, 2008 work with the first, close it, then do the same with the 2ndthen run() the first to open it [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys
ImTheShane Posted April 7, 2008 Author Posted April 7, 2008 then run() the first to open itSorry, my mistake. I didn't explain fully what I was trying to do. I don't want the script to open the windows. I will have two windows open on my desktop. I want the script to set one window as active, execute a command, then set the other window as active, and execute a command. I don't want it to close the windows after the script is finished.The problem that I'm having is that both of the windows have the exact same name. I know that I could just have the script Alt-Tab, but I'd like to be able to use WinActivate to switch between the windows at a certain point in the script, but since both windows have the exact same name the script can't differentiate between the two.Is there a way to differentiate between two windows with the exact same name for the purposes of using WinActivate?
killab4061 Posted April 11, 2008 Posted April 11, 2008 I'm having a similar issue switching between windows. I'm just trying to script a "silent install" for CompuStat. The problem I run into is the main install window closes when install progress bar is shown. Once the software is installed it brings back the main install window and I can not activate it to send it an "enter" to select finish to close the window. I tried using the winactivate command and it does not select the window. I also tried recording the mouse strokes and that still doesn't work. WinWait("Research Insight Setup","") If Not WinActive("Research Insight Setup","") Then WinActivate("Research Insight Setup","") WinWaitActive("Research Insight Setup","") Send("{TAB}{TAB}{TAB}{ENTER}") Sleep(500) Send("*******{SHIFTDOWN}*****{SHIFTUP}{TAB}{TAB}{ENTER}") Sleep(200000) WinWait("Research Insight Setup","") If Not WinActive("Research Insight Setup","") Then WinActivate("Research Insight Setup","") WinWaitActive("Research Insight Setup", "") Send("{ENTER}") I believe the problem is there is only one window name for the whole install. Originally the script had one line of keystrokes but I had to split it up because it was entering the serial number too fast. Any suggestions.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now