icene Posted April 11, 2009 Posted April 11, 2009 (edited) Hi Could autoit use like * or % to compare string if "abcde" = "*bc*" then return true I know there is stringcompare function, but have the other sulotion for this? Thanks Edited April 11, 2009 by icene
Authenticity Posted April 11, 2009 Posted April 11, 2009 Look at StringInStr or StringRegExp if you need it to be more specific.
icene Posted April 11, 2009 Author Posted April 11, 2009 Look at StringInStr or StringRegExp if you need it to be more specific.hiif i have two windows with the same title but different text.i want to choose the correct one.use ControlSetText ( "title", "text","controlID")but i only know the part of text , like "xxxx this is xxxxx"could i type ControlSetText ( "hello", "*this is*","edit1") ?ps: the two windows have the same title and controlID only texts are difference .
Authenticity Posted April 11, 2009 Posted April 11, 2009 Well, there is REGEXPTITLE and REGEXPCLASS (Advanced Window Descriptions) but there is not REGEXPTEXT so I guess you'll need to use WinList('TheWindowTitle') and use WinGetText like: Dim $avWindows = WinList('TheWindowTitle') For $i = 1 To $avWindows[0][0] If StringInStr(WinGetText($avWindows[$i][1]), 'Sometext') Then ; Or If StringRegExp(WinGetText($avWindows[$i][1]), '.*?Text') Then... ; ... EndIf Next
icene Posted April 11, 2009 Author Posted April 11, 2009 Well, there is REGEXPTITLE and REGEXPCLASS (Advanced Window Descriptions) but there is not REGEXPTEXT so I guess you'll need to use WinList('TheWindowTitle') and use WinGetText like: Dim $avWindows = WinList('TheWindowTitle') For $i = 1 To $avWindows[0][0] If StringInStr(WinGetText($avWindows[$i][1]), 'Sometext') Then ; Or If StringRegExp(WinGetText($avWindows[$i][1]), '.*?Text') Then... ; ... EndIf Next Thanks for your reply
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