Last active
June 30, 2025 22:06
-
-
Save datmt/5b7d17e8886d14bb0024f8e6c45dabcd to your computer and use it in GitHub Desktop.
Autohotkey script to start program on hotkey pressed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
SetTitleMatchMode, 2 | |
!c:: | |
if WinExist("ahk_exe chrome.exe") | |
{ | |
WinActivate | |
} else | |
{ | |
Run "C:\Program Files\Google\Chrome\Application\chrome.exe" | |
} | |
Return | |
!f:: | |
if WinExist("ahk_exe chrome.exe") | |
{ | |
WinActivate | |
} else | |
{ | |
Run "C:\Program Files\Mozilla Firefox\firefox.exe" | |
} | |
Return | |
!s:: | |
if WinExist("ahk_exe photoshop.exe") | |
{ | |
WinActivate | |
} else | |
{ | |
Run "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Adobe Photoshop 2020.lnk" | |
} | |
Return | |
!n:: | |
if WinExist("ahk_exe notepad++.exe") | |
{ | |
WinActivate | |
} else | |
{ | |
Run "C:\Program Files\Notepad++\notepad++.exe" | |
} | |
Return | |
!a:: | |
if WinExist("ahk_exe studio64.exe") | |
{ | |
WinActivate | |
} else | |
{ | |
Run "C:\Users\dtt\AppData\Local\Programs\Android Studio\bin\studio64.exe" | |
} | |
Return | |
!r:: | |
if WinExist("ahk_exe SumatraPDF.exe") | |
{ | |
WinActivate | |
} else | |
{ | |
Run "C:\Users\dtt\AppData\Roaming\Microsoft\Windows\Start Menu\SumatraPDF.lnk" | |
} | |
Return | |
!p:: | |
if WinExist("ahk_exe phpstorm64.exe") | |
{ | |
WinActivate | |
} else | |
{ | |
Run "C:\Users\dtt\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\JetBrains Toolbox\PhpStorm.lnk" | |
} | |
Return | |
!j:: | |
if WinExist("ahk_exe idea64.exe") | |
{ | |
WinActivate | |
} else | |
{ | |
Run "C:\Users\dtt\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\JetBrains Toolbox\IntelliJ IDEA Ultimate.lnk" | |
} | |
Return | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment