Page 1 of 1

Can not match the title including "ahk_id"

Posted: 31 Mar 2021, 11:37
by QiuDao
If you match a new open txt window named "123 ahk_id 456.txt", it will go wrong.
Here is the code one may write:

Code: Select all

winWaitActive("123 ahk_id 456.txt")

Re: Can not match the title including "ahk_id"

Posted: 31 Mar 2021, 11:48
by gregster
I strongly doubt that 456.txt, which looks like a file or perhaps process name, is actually a valid ahk_id - perhaps you meant to use ahk_exe instead ?

Re: Can not match the title including "ahk_id"

Posted: 31 Mar 2021, 11:54
by QiuDao
gregster wrote:
31 Mar 2021, 11:48
I strongly doubt that 456.txt, a file or perhaps process name, is actually a valid ahk_id - perhaps you meant to use ahk_exe instead ?
Thank you for replying. I mean the file is just named "123 ahk_id 456.txt", and I want to match the window by title name rather than "ahk_id"(hwnd), then it will go wrong.

Re: Can not match the title including "ahk_id"

Posted: 31 Mar 2021, 12:02
by gregster
Not sure if this special case can exactly be handled like this - perhaps by applying the regex matching method, coming close ?? :think:

Re: Can not match the title including "ahk_id"

Posted: 31 Mar 2021, 12:42
by QiuDao
gregster wrote:
31 Mar 2021, 12:02
Not sure if this special case can exactly be handled like this - perhaps by applying the regex matching method, coming close ?? :think:
It may solve. But I prefer pulling requests to change the v2 language rather than using regex mode.

Re: Can not match the title including "ahk_id"

Posted: 31 Mar 2021, 12:53
by QiuDao
@lexikos
Wish to introduce duplicate quote like winWaitActive('ahk_exe "123 ahk_id 456.txt" ') instead of winWaitActive('ahk_exe 123 ahk_id 456.txt').

Re: Can not match the title including "ahk_id"  Topic is solved

Posted: 02 Apr 2021, 10:44
by swagfag
yeah i dont see this ever getting implemented, considering the regex mode already effectively provides the solution ure after
and if wintitle eventually gets removed in lieu of passing objects with properties, tinkering with it now would be a waste of time. besides, for rare cases such as this one, implementing this brings about more problems than it seeks to solve