Skip to content

Error when calling ahk.show_tooltip() #361

@stvncao5

Description

@stvncao5

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions