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

Error when calling ahk.show_tooltip() #361

Closed
stvncao5 opened this issue Dec 25, 2024 · 2 comments · Fixed by #362 or #363
Closed

Error when calling ahk.show_tooltip() #361

stvncao5 opened this issue Dec 25, 2024 · 2 comments · Fixed by #362 or #363
Labels
bug Something isn't working

Comments

@stvncao5
Copy link

describe your issue

I have copied the 'ahk.show_tooltip()' function from the official documentation, but it throws an error instead. While I vaguely understand the error (because I regularly use the fourth argument for the ToolTip AHK function and am only recently transitioning my AHK scripts to Python), I am not sure how to correct it.

I am running this with the ahk[binary] package installed.

ahk.version

1.8.2

AutoHotkey version

v2

Code to reproduce the issue

from ahk import AHK

ahk = AHK(version='v2')

ahk.show_tooltip("hello4", x=10, y=10)
#ahk.show_tooltip("hello4", x=10, y=10, 15) # I have also tried this

Traceback/Error message

Traceback (most recent call last):
File "C:\py_scripts\test.py", line 5, in
ahk.show_tooltip("hello4", x=10, y=10)
File "C:\Users\SC\AppData\Local\Programs\Python\Python39\lib\site-packages\ahk_sync\engine.py", line 1595, in show_tooltip
self._transport.function_call('AHKShowToolTip', args)
File "C:\Users\SC\AppData\Local\Programs\Python\Python39\lib\site-packages\ahk_sync\transport.py", line 532, in function_call
return self.send(request, engine=engine)
File "C:\Users\SC\AppData\Local\Programs\Python\Python39\lib\site-packages\ahk_sync\transport.py", line 745, in send
return response.unpack() # type: ignore
File "C:\Users\SC\AppData\Local\Programs\Python\Python39\lib\site-packages\ahk\message.py", line 216, in unpack
raise self._exception_type(s)
ahk.exceptions.AHKExecutionException: Error occurred in Array.Prototype.__Item.Get (line 2509). The error message was: Invalid index.. Specifically: 4
Stack:
C:\Users\SC\AppData\Local\Temp\python-ahk-pdjs_hen.ahk (2509) : [Array.Prototype.__Item.Get] which := args[4]

C:\Users\SC\AppData\Local\Temp\python-ahk-pdjs_hen.ahk (2509) : [AHKShowToolTip] which := args[4]

C:\Users\SC\AppData\Local\Temp\python-ahk-pdjs_hen.ahk (2793) : [] pyresp := %func_name%(argsArray*)

Auto-execute

@spyoungtech spyoungtech added the bug Something isn't working label Jan 6, 2025
spyoungtech added a commit that referenced this issue Jan 14, 2025
gh-361 fix bug in show_tooltip that silently omitted `which` argument
@spyoungtech
Copy link
Owner

I believe this should be fixed with #362 -- I will do some testing and if it all looks good, prepare a release in the coming days.

@spyoungtech
Copy link
Owner

This should now be fixed in version 1.8.2

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
2 participants