eleblanc Posted December 20, 2007 Posted December 20, 2007 I have a script i've done a few years back with winwait, is there any way to specify more then one name. For exemple Winwait,test1 or test2.
Nevin Posted December 20, 2007 Posted December 20, 2007 (edited) Okay, what the hell. My post keeps getting all garbled when I edit it. Forget it. It was a bad idea anyway. (I suggested WinExists, but that won't wait for it. Perhaps you could just use WinWait with the timeout parameter) Also, if the names are similar in nature, you could try matching them in a different way. For example, if you were matching AIM windows, they all say "Instant Message" in them, so you could do partial substring matches with wintitlematchmode. Edited December 20, 2007 by Nevin
weaponx Posted December 20, 2007 Posted December 20, 2007 Something like: Opt("WinTitleMatchMode", 4) WinWait("[REGEXPTITLE:.?(Notepad|Calculator).?]") MsgBox(0,"","One of the specified windows opened") This should match *Notepad* or *Calculator*, if you need it to match the exact title, take off the .? from both sides.
eleblanc Posted December 26, 2007 Author Posted December 26, 2007 Something like: Opt("WinTitleMatchMode", 4) WinWait("[REGEXPTITLE:.?(Notepad|Calculator).?]") MsgBox(0,"","One of the specified windows opened") This should match *Notepad* or *Calculator*, if you need it to match the exact title, take off the .? from both sides. Can i use wildcard, here section of the script WinWait,NR2003 WinSetTitle,NR2003, ,NRrs%numrs% WinMinimize,NR2003rs%numrs% Could this work WinWait,NR* WinSetTitle,NR*, ,NRrs%numrs% WinMinimize,NR*rs%numrs% My issue is that the window could be NR2003 or NR"something else"
weaponx Posted December 27, 2007 Posted December 27, 2007 The example I provided is using a wildcard on both sides of the stringThis should match *Notepad* or *Calculator*, if you need it to match the exact title, take off the .? from both sides.
eleblanc Posted December 27, 2007 Author Posted December 27, 2007 Can i use wildcard, here section of the scriptWinWait,NR2003WinSetTitle,NR2003, ,NRrs%numrs%WinMinimize,NR2003rs%numrs%Could this workWinWait,NR*WinSetTitle,NR*, ,NRrs%numrs%WinMinimize,NR*rs%numrs%My issue is that the window could be NR2003 or NR"something else"Sorry but i'll need more explanation to understand your exemple, Do i need Opt and MsgBox in my exemple? What is REGEXPTITLE?is ? the wildcard? if so will replacing * with ? in my exemple work?
weaponx Posted December 27, 2007 Posted December 27, 2007 You need the Opt("WinTitleMatchMode", 4) to get the put title matching into advanced mode for the regular expression.REGEXPTITLE will match whatever is in the regular expression. My example would be the same as *Notepad* or *Calculator*You can't replace .? with *That isn't how regular expressions work.See:http://www.autoitscript.com/autoit3/docs/f...tringRegExp.htmhttp://en.wikipedia.org/wiki/Regular_expressionhttp://www.regular-expressions.info/
MHz Posted December 27, 2007 Posted December 27, 2007 Can i use wildcard, here section of the scriptWinWait,NR2003WinSetTitle,NR2003, ,NRrs%numrs%WinMinimize,NR2003rs%numrs%Could this workWinWait,NR*WinSetTitle,NR*, ,NRrs%numrs%WinMinimize,NR*rs%numrs%My issue is that the window could be NR2003 or NR"something else"That is AutoIt2 syntax. This is a AutoIt3 forum btw. AutoIt3 is the latest and greatest. Please visit the AutoIt3 download page for AutoIt3 if you are interested. AutoIt3 is what weaponx is preaching about.Also look within the AutoIt3 help file at the topic "AutoIt" -> "Using AutoIt" -> "Window Titles and Text (Advanced)".You can consider using AdlibEnable() for the 2nd window if it is unpredictable for appearance.
herewasplato Posted December 27, 2007 Posted December 27, 2007 ...I have a script i've done a few years back...Like MHz said, you should consider moving up to AutoIt3. If you do not want to convert to AutoIt3, you can post your request for help in this forum: http://www.autoitscript.com/forum/index.php?showforum=5 (...but you already knew that - since you have a topic and a reply in that forum already :-) http://www.autoitscript.com/forum/index.php?showtopic=6101 [some admin might want to move this post to the V2 forum.] Either way, enjoy AutoIt2 or AutoIt3. [size="1"][font="Arial"].[u].[/u][/font][/size]
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