Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win_wait() cannot find window title that includes a comma; doesn't raise Timeout Error either #186

Closed
Croculus opened this issue Dec 27, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@Croculus
Copy link

I am trying to use win_wait to find a window that has a comma in it's title. It can't seem to find the window and for some reason it never returns a timeout error.

from ahk import AHK

ahk = AHK()


try:
    win = ahk.win_wait(title='comma,.txt - Notepad', timeout=5) # this part never returns anything
    print('Window found') #unreached code
except TimeoutError:
    print('Notepad was not found!') #unreached code

It could just be an AHK issue. I looked at the method definition and it looks clean, but I could be missing something.

@spyoungtech spyoungtech added the bug Something isn't working label Dec 29, 2022
@spyoungtech
Copy link
Owner

spyoungtech commented Dec 29, 2022

I believe this is a bug. The title is not properly escaped in the win_wait implementation resulting in a malformed script where the arguments do not get injected as intended.

To workaround this bug in v0.x, you can escape manually the comma with a tilde:

win = ahk.win_wait(title='title`,withcomma', timeout=5)

This issue will be fixed in v1 (wherein the workaround above should not be used).

If you install ahk from the rewrite branch for v1 (#185 ), your code should work as expected.

@spyoungtech
Copy link
Owner

This is now fixed in v1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants