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

Discuss the future of the AutoHotkey language
QiuDao
Posts: 18
Joined: 25 Mar 2021, 22:55

Can not match the title including "ahk_id"

Post by QiuDao » 31 Mar 2021, 11:37

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")

gregster
Posts: 9014
Joined: 30 Sep 2013, 06:48

Re: Can not match the title including "ahk_id"

Post by gregster » 31 Mar 2021, 11:48

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 ?

QiuDao
Posts: 18
Joined: 25 Mar 2021, 22:55

Re: Can not match the title including "ahk_id"

Post by QiuDao » 31 Mar 2021, 11:54

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.

gregster
Posts: 9014
Joined: 30 Sep 2013, 06:48

Re: Can not match the title including "ahk_id"

Post by gregster » 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:

QiuDao
Posts: 18
Joined: 25 Mar 2021, 22:55

Re: Can not match the title including "ahk_id"

Post by QiuDao » 31 Mar 2021, 12:42

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.

QiuDao
Posts: 18
Joined: 25 Mar 2021, 22:55

Re: Can not match the title including "ahk_id"

Post by QiuDao » 31 Mar 2021, 12:53

@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').

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

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

Post by swagfag » 02 Apr 2021, 10:44

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

Post Reply

Return to “AutoHotkey Development”