Code: Select all
; Open new Chrome tab (Win+Alt+C)
;^+C::
; Run, C:\Program Files\Google\Chrome\Application\chrome.exe --new-tab
;return
"Error at line 2.
Line Text: WinExist, ahk_class chrome.exe
This line does not contain a recognized action.
The program will exit."
Code: Select all
^+C::
WinExist, ahk_class chrome.exe, ; Check if Chrome is running (by class name)
IfWinExist, ahk_class chrome.exe {
WinActivate, ahk_class chrome.exe ; Switch focus to existing Chrome
Sleep, 100 ; Optional: Short delay to ensure Chrome activation (adjust if needed)
Run, chrome.exe --new-tab ; Open new tab in activated Chrome
}
return
[Mod edit: Moved topic from AHK v2 help since this v1 code.]