It returns an AutoHotkey Array, not a JavaScript Array. As far as I can recall, there isn't any way to call a property getter/setter
with parameters in JavaScript, aside from explicitly retrieving it with GetOwnPropDesc.
To fix it, you can just add the following to funcs.ahk (and recompile jk if you're using it that way).
Code: Select all
ArrayToJs(a) => js.Array(a*)
WinGetControls.returns := ArrayToJs
WinGetControlsHwnd.returns := ArrayToJs
ControlGetItems.returns := ArrayToJs
For each AutoHotkey function exposed to JavaScript, jk uses
function.returns (or
function.output if it has output parameters), if present, to translate the return value to something appropriate for JavaScript.