-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgramShortcuts.ahk
38 lines (37 loc) · 1.44 KB
/
ProgramShortcuts.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
CapsLock & Tab::appFlapper("C:\Users\kurtb\AppData\Local\Programs\Notion\Notion.exe") ;Tab - Notion
CapsLock & w::AppFlapper("C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe")
#space::appFlapper("C:\Windows\System32\notepad.exe")
CapsLock & d::
EnvGet, UserProfileEnv, USERPROFILE
appFlapper( UserProfileEnv . "\AppData\Local\Programs\Microsoft VS Code\Code.exe")
return
CapsLock & f::
; Store the current working directory
currentDir := A_WorkingDir
EnvGet, UserProfileEnv, USERPROFILE
SetWorkingDir, %UserProfileEnv%\AppData\Local\Discord\
; Get a list of all subfolders in the directory
Loop, Files, * , d
{
; Store the folder name in the variable "folder"
folder := A_LoopFileName
; Check if the folder name starts with "app-"
if (SubStr(folder, 1, 4) = "app-")
{
; Update the newest folder if a newer version is found
if (folder > newestFolder)
newestFolder := folder
}
}
; Restore the previous working directory
SetWorkingDir, %currentDir%
appFlapper( UserProfileEnv . "\AppData\Local\Discord\" . newestFolder . "\Discord.exe")
return
CapsLock & c::
EnvGet, UserProfileEnv, USERPROFILE
if WinActive("GitHub Desktop") {
WinMinimize
} else {
appFlapper( UserProfileEnv . "\AppData\Local\GitHubDesktop\GitHubDesktop.exe")
}
return