- It shows a window temporarily, but ScriptInfo can suppress that.
ScriptInfo(): Get ListLines/ListVars/ListHotkeys/KeyHistory text - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=9656
- Another interesting link.
DebugVars - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=24984
Code: Select all
q:: ;object pointer to object variable name
oArray1 := {}
oArray2 := {}
oArray3 := {}
MsgBox, % ObjGetVarName(oArray1)
MsgBox, % ObjGetVarName(oArray2)
MsgBox, % ObjGetVarName(oArray3)
return
ObjGetVarName(ByRef oArray)
{
ListVars
WinWaitActive, ahk_class AutoHotkey
vPtr2 := &oArray
;MsgBox, % Format("0x{:X}", vPtr2)
Loop
{
ControlGetText, vText, Edit1, ahk_class AutoHotkey
if InStr(vText, ": Object object {address: ")
break
Sleep, 100
}
WinHide, ahk_class AutoHotkey
Loop, Parse, vText, `n, `r
{
vTemp := A_LoopField
if (vTemp = "Global Variables (alphabetical)")
vOutput := ""
if !vPos := InStr(vTemp, ": Object object {address: ")
continue
vPtr := SubStr(vTemp, vPos+26, -1)
;MsgBox, % "[" vPtr "]"
if (vPtr = vPtr2)
vOutput .= vTemp "`r`n"
}
;MsgBox, % Clipboard := vOutput
return SubStr(vOutput, 1, -2)
}
return