tommyvallier Posted October 27, 2011 Share Posted October 27, 2011 Hey, I just discovered AutoIt and have fallen for it. I'm new to the forums, too, and appreciate any help. I'm trying to activate a window using WinActivate. The title of the window contains a section in brackets that I'd like to ignore. Esentially, I want to be able to search for "Window Title Part One (ignore this) And Part Two". I know this can be done using regex, but don't know how to go about it. Thanks for any help. Link to comment Share on other sites More sharing options...
bogQ Posted October 27, 2011 Share Posted October 27, 2011 WinList() For To If StringInStr() Then ; ... EndIf Next TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
tommyvallier Posted October 27, 2011 Author Share Posted October 27, 2011 Yeah... StringInStr() would work with an If... But I already know the title bar has the string I need... It just changes with each (regular) revision. Currently it's "Example title bar (V 12.34) Following Text"... But it's also been "Example title bar (Ver 12.34b) Following Text". So really, I'm looking to trigger WinActivate(), using "Example title bar ({wildcard}) Following Text" Link to comment Share on other sites More sharing options...
bogQ Posted October 27, 2011 Share Posted October 27, 2011 (edited) so your telling me that you cant trigger title that you need withIf StringInstr($var,'Example title bar (') And StringinStr($var,') Following Text') Then WinActivate($var)?! If you cant maby its best for you to look under "Window Titles and Text (Advanced)" in help file Edited October 27, 2011 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
kaotkbliss Posted October 27, 2011 Share Posted October 27, 2011 (edited) what about using AutoItSetOption("WinTitleMatchMode",2) then you could do $title = WinList( "Example title bar") *edit to expand on that* $title will become an array of all the windows that have "Example title bar" somewhere in the title and you can then WinActivate from that list Edited October 27, 2011 by kaotkbliss 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
bogQ Posted October 27, 2011 Share Posted October 27, 2011 something like REGEXPTITLE:test(.*?)goo tor title named like test aaa goo.txt shud work if im not wrong (or many im worng, did i already tell anyone that i will newer learn StringRegExp? ) TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 27, 2011 Moderators Share Posted October 27, 2011 bogQ, i will newer learn StringRegExpI do not want to hijack the thread, but try ressions.info/tutorial.html'>this site - the best SRE tutorial I have come across. M23 P.S. And do not forget GEOSoft's PCRE Toolkit - look in his sig. Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
bogQ Posted October 27, 2011 Share Posted October 27, 2011 (edited) your telling me that REGEXPTITLE:test(.*?)goo will work? or itl not work and your redirecting me to learn more eather way i will try to wrap my mind around it in the near future, ty for the link Edited October 27, 2011 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 27, 2011 Moderators Share Posted October 27, 2011 bogQ,your telling me that REGEXPTITLE:test(.*?)goo will work? or itl not work and your redirecting me to learn moreNeither - just pointing you to a good resource. And now back to our scheduled programming...pun fully intended! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
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