Jump to content

Retrieve whats between [ ] in a string.


Recommended Posts

Hello. Once again im stuck within a problem that seems to be easy to solve... But I can't find anywhere how... :)

Here it goes:

I'm having Winlist to detect how many windows with a certain title exist, and then I make ControlGetText to check the text within those windows.

And then, when a certain text is found in the window, I want it to return me some text that is included in the window title, that for this case, is beetween [ ].

I'll give you this part of my script so that you can understand what i pretend, better:

$var = WinList("Wintitle")
    For $i = 1 to $var[0][0]
        $sText=ControlGetText($var[$i][0],"",606)
        If Stringinstr($sText, "The Text") Then "Tell Me whats beetween [] on $var[$i][0]"

Now I have no idea what to do so that autoit returns whats in the title, i can get the title, since it is $var[$i][0] but how can I make it to return ONLY whats beetween [ ] on the title? The title is something like: [This is what should be returned] "Other Stuff on the tile......"

Thanks for your attention, hope you can help me out with this, since this is stopping me from finishing my code :) .

EDIT: I've found another way to pass through my problem, but anyways I'd like to know how to pass this if this ever comes to me, Knowledge is never too much ;) .

Edited by jiglei
Link to comment
Share on other sites

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...