Jump to content

Recommended Posts

Posted (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 by icene
Posted

Look at StringInStr or StringRegExp if you need it to be more specific.

hi

if 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 .

Posted

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
Posted

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 :D

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...