spyoungtech / ahk

Python wrapper for AutoHotkey with full type support. Harness the automation power of AutoHotkey with the beauty of Python.
MIT License
887 stars 66 forks source link

win_move does not work in AutoHotkey v2 unless width and height are specified #280

Closed spyoungtech closed 7 months ago

spyoungtech commented 7 months ago

describe your issue

win_move does not work in AutoHotkey v2 unless width and height are specified.

ahk.version

1.5.4

AutoHotkey version

v2

Code to reproduce the issue

from ahk import AHK
ahk = AHK(version='v2')
notepad = ahk.win_get(title='Untitled - Notepad')
notepad.move(100, 100) # fails with v2

Traceback/Error message

AHKExecutionException: Error occurred in WinMove (line 2276). The error message was: Parameter #3 of WinMove requires a Number, but received an empty string.. Specifically:
Stack:
C:\Users\Spencer\AppData\Local\Temp\python-ahk-lbxrl9be.ahk (2276) : [WinMove] WinMove(x, y, width, height, title, text, extitle, extext)
C:\Users\Spencer\AppData\Local\Temp\python-ahk-lbxrl9be.ahk (2276) : [AHKWinMove] WinMove(x, y, width, height, title, text, extitle, extext)
C:\Users\Spencer\AppData\Local\Temp\python-ahk-lbxrl9be.ahk (2661) : [] pyresp := %func_name%(argsArray*)