Chetwood Posted October 12, 2004 Posted October 12, 2004 Seems simple but I don't know how to make it happen. I wanna start my script if either of two certain windows is popping up. Whichever window is first is irrelevant, as soon as one of those two is there I wanna start. How do I script this with WinWait? TIA! WinWait (( "window1") or ("window2")) MultiMakeMKV: batch processing for MakeMKV (Win)MultiShrink: batch processing for DVD ShrinkOffizieller Übersetzer von DVD Shrink deutsch
CyberSlug Posted October 12, 2004 Posted October 12, 2004 (edited) Do sleep(10) Until WinActive("window1") or WinActive("window2") Edit: WinExists is probably a better choice as SlimShady shows below. Edited October 12, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
SlimShady Posted October 12, 2004 Posted October 12, 2004 Do Sleep(25) Until WinExists("window1") OR WinExists("window2")
Chetwood Posted October 12, 2004 Author Posted October 12, 2004 Do Sleep(25) Until WinExists("window1") OR WinExists("window2")<{POST_SNAPBACK}>Nice idea, however, WinExists seems to require a full title match. Problem is that the two windows I'm checking arex% Analysingx% Encodingwhereas 'x' is the percentage of how much is already done which is changing constantly. Depending on the speed of the machine and the material to be encoded the percentage shown may jump in unpredictable steps like 2%, 4%, 5%, 6% and may thus elude the poll interval on some fast machines.On my slow machine I'm polling every 250 ms for '0%' and it works even though the first percentage I get to see is '2%'. Just to be on the safe side, is there any way to wait for a partial match of the tile window? MultiMakeMKV: batch processing for MakeMKV (Win)MultiShrink: batch processing for DVD ShrinkOffizieller Übersetzer von DVD Shrink deutsch
Developers Jos Posted October 12, 2004 Developers Posted October 12, 2004 Nice idea, however, WinExists seems to require a full title match. Problem is that the two windows I'm checking arex% Analysingx% Encodingwhereas 'x' is the percentage of how much is already done which is changing constantly. Depending on the speed of the machine and the material to be encoded the percentage shown may jump in unpredictable steps like 2%, 4%, 5%, 6% and may thus elude the poll interval on some fast machines.On my slow machine I'm polling every 250 ms for '0%' and it works even though the first percentage I get to see is '2%'. Just to be on the safe side, is there any way to wait for a partial match of the tile window?<{POST_SNAPBACK}>ChecK out the following in the helpfile:Opt("WinTitleMatchMode", 1) ;1=start, 2=subStr, 3=exact, 4=... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
JSThePatriot Posted October 12, 2004 Posted October 12, 2004 Did you try the following? Do Sleep(25) Until WinWait('yourwindow') or WinWait('yourwindow') That shouldnt need the full title... JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
scriptkitty Posted October 12, 2004 Posted October 12, 2004 well why not throw mine in there too. While 1 If winexists("window1") or winexists("My other app") Then ExitLoop sleep(10) Wend MsgBox(1,"info","started") AutoIt3, the MACGYVER Pocket Knife for computers.
Chetwood Posted October 13, 2004 Author Posted October 13, 2004 Thanks to your suggestions (and Scite for Autoit) I've used this approach: Opt("WinTitleMatchMode", 2) Do Sleep(250) Until WinExists("% Encoding") OR WinExists("% Analysing") which works just fine. However, is there really no way to check a parent window's contents similar to 'WinSearchChildren'? Both windows I'm checking for are child windows to the window 'Backup DVD' which has some info that I'd need... MultiMakeMKV: batch processing for MakeMKV (Win)MultiShrink: batch processing for DVD ShrinkOffizieller Übersetzer von DVD Shrink deutsch
the_lord_mephy Posted October 13, 2004 Posted October 13, 2004 Question: If you did something like this Do Sleep(10000) Until WinExists("MyWin") and the window was created at the very beginning of the 10 seconds inside the loop. Would it sleep for 10 seconds before exiting the loop? My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
Matt @ MPCS Posted October 13, 2004 Posted October 13, 2004 Question:If you did something like thisDoSleep(10000)Until WinExists("MyWin")and the window was created at the very beginning of the 10 seconds inside the loop. Would it sleep for 10 seconds before exiting the loop?<{POST_SNAPBACK}>It would sleep for 10 seconds before checking if the window exists, that is what the code says.*** Matt @ MPCS
the_lord_mephy Posted October 13, 2004 Posted October 13, 2004 k thx My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
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