AutoHotkey: Launch or Switch App

By Xah Lee. Date: . Last updated: .

Set Key to Launch App or Switch Window

set a key that launches a browser, but if it is already running, just switch to it.

; launch or switch to Firefox
; Version 2021-02-21 2022-01-19
if WinExist("ahk_class MozillaWindowClass")
WinActivateBottom, ahk_class MozillaWindowClass
 Run "C:\Program Files\Mozilla Firefox\firefox.exe"


Use Taskbar Key

Pin the apps you want to the taskbar. Microsoft Windows Taskbar

; make F1 send Win+1
$F1::Send #1

; make F2 send Win+2
$F2::Send #2

AutoHotkey, Switch Window