syntax53

Trouble with StringInStr

3 posts in this topic

#1 ·  Posted

$title = WinGetTitle("[active]")
$title = StringRegExpReplace($title, "(?i)[^0-9a-z]", "_")

If StringInStr("Stereo_Mix", $title) > 0 then
    MsgBox (0, "Script", "mix found.")
    $ret = WinClose("[active]")
else
    $ret = WinClose("[active]")
endif

I am trying to find the title of a window that opens (from the sound recording properties).  The windows title that you see is "Stereo Mix Properties".  If I message box it, it also shows the same thing.  I even added that RegExpReplace to make sure there aren't any weird characters in the title.  The regex makes the title become "Stereo_Mix_Properties" but it still doesn't match.  What the heck am I missing here?

Share this post


Link to post
Share on other sites



#3 ·  Posted

Holy sh--, what an idiot.  10 years of programming and I missed that.  I copied the function from an old script and, assuming it was working there (and it may have been because it was probably a full-string match), didn't even think to check the params order.  thanks

Share this post


Link to post
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