Closed megamorphg closed 1 year ago
try
VD.PinWindow("ahk_id " this_id)
instead of
VD.PinWindow("%this_id%")
this is a scripting error
%
is not to be used inside quotes
this_id
is a variable
this is how you'd write it in javascript: string concatenation
VD.PinWindow("ahk_id " + this_id)
this is how you'd write it in ahk: .
is string concatenation operator
VD.PinWindow("ahk_id " . this_id)
or (concatenation is assumed):
VD.PinWindow("ahk_id " this_id)
props to you for putting Full code
you can also 'step into' using a debugger and see that the parameter's value isn't what you want I use https://marketplace.visualstudio.com/items?itemName=zero-plusplus.vscode-autohotkey-debug#installation
Thank you! That worked. The parameter is already variabilized so it was failing.
WinGet, HWiNFO64List, List, ahk_exe HWiNFO64.EXE
Loop, %HWiNFO64List%
{
this_id := HWiNFO64List%A_Index%
VD.PinWindow("ahk_id " this_id)
}
As per a Stack Overflow answer: I tried using process ID but I think VD.PinWindow doesn't work with it e.g. VD.PinWindow("ahk_id 0xD3854") or VD.PinWindow("ahk_id %this_id%").
Full code used: