syntax53 Posted July 20, 2017 Share Posted July 20, 2017 $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? Link to comment Share on other sites More sharing options...
Malkey Posted July 20, 2017 Share Posted July 20, 2017 Try If StringInStr($title, "Stereo_Mix") > 0 Then Link to comment Share on other sites More sharing options...
syntax53 Posted July 20, 2017 Author Share Posted July 20, 2017 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 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