(Windows)[alt]キーのダブルプレスのショートカットで Chromeアプリに切り替える

# [alt]キーダブルタップでVSCodeを保存してChromeへ切り替え
~LAlt:: ;~ prefix when the hotkey fires, its key's native function will not be blocked
IF !(A_TickCount < LAlt)
{
  KeyWait, LAlt
  LAlt := A_TickCount + 150
  Return
}
LAlt =
If WinActive("ahk_exe chrome.exe"){   ;Chromeがアクティブな時は何もしない

}else If WinActive("ahk_exe Code.exe"){  ;VS Codeがアクティブなら保存してChromeをアクティブにする
    Send,^+s
    WinActivate,ahk_exe chrome.exe
}else{
    WinActivate,ahk_exe chrome.exe    ;それ以外はChromeをアクティブにする
} 
return
No.1981
04/01 14:33

edit