I modified @evilC's TapHoldManager script to make it so when I double tap F2, the last active windows explorer window gets placed in a certain position on the screen. Here is the code snippet:
Code: Select all
FuncF2(isHold, taps, state)
{
if (taps)
{
if (taps == 1)
Send {F2}
else if (taps == 2)
{
WinMove, ahk_class CabinetWClass ahk_exe explorer.exe, ,1400, 225, , , ,
;~ WinMove, ahk_class CabinetWClass ahk_exe explorer.exe, ,970, 210, , , ,
WinActivate, ahk_class CabinetWClass ahk_exe explorer.exe
}
return
}
}
Every time I switch from one monitor to the other, I have to comment out the other line so the positioning works fine.
I'm wondering if there is a way to make the code recognize what is the active monitor (or, better yet, the resolution of the active monitor, so it works on other monitors) and apply the corresponding WinMove coordinates accordingly. Is such a thing possible? Or is there a better way to achieve what I want?