-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathNested Hotkeys.ahk
170 lines (159 loc) · 5.98 KB
/
Nested Hotkeys.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#NoTrayIcon
#SingleInstance, force
#Include lib\NestedHotkeysWGui.ahk
;---------------------------------------
;| To know when the script restarted |
;---------------------------------------
SoundBeep, 2000, 80
SoundBeep, 2500, 80
SoundBeep, 3000, 80
;-----------------------------------
;| Configure the look of the GUI |
;| (Global variables) |
;-----------------------------------
NHWGUI_bgColor :="580316"
NHWGUI_textColor := "A0DFFF"
NHWGUI_textSize := 18
;-------------------
;| Reload Script |
;-------------------
INSERT & `::
SoundBeep, 2000,100
Run %A_ScriptFullPath%
Return
;------------------------
;| Write common stuff |
;------------------------
INSERT & q::
nhgCommonData := New NestedHotkeysWGui("Write")
nhgCommonData
.Add("Q","WriteEmails","E-mails")
.Add("W","WritePhones","Phone Numbers")
.Run()
WriteEmails(){
nhgWriteEmails := New NestedHotkeysWGui("Write Email")
nhgWriteEmails
.Add("Q","Write","[email protected]" ,"[email protected]")
.Add("W","Write","[email protected]" ,"[email protected]")
.Add("E","Write","[email protected]" ,"[email protected]")
.Add("R","Write","[email protected]" ,"[email protected]")
.Run()
}
WritePhones(){
nhgWritePhones := New NestedHotkeysWGui("Write Phones")
nhgWritePhones
.Add("Q","Write","John's Number" ,"5550123")
.Add("W","Write","Monica's Number" ,"5551234")
.Run()
}
Return
;---------------------------
;| Quick programs access |
;---------------------------
INSERT & w::
nhgPrograms:= New NestedHotkeysWGui("Programs Quick Access")
nhgPrograms
.Add("Q","ShowOrRunProgram","Vivaldi" ,["ahk_exe vivaldi.exe" ,"vivaldi.exe"])
.Add("W","ShowOrRunProgram","VS Code" ,["ahk_exe code.exe" ,"C:\Users\Luis\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Visual Studio Code\Visual Studio Code.lnk"])
.Add("E","ShowOrRunProgram","Visual Studio 2017" ,["ahk_exe devenv.exe" ,"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe"])
.Add("R","ShowOrRunProgram","Putty" ,["ahk_exe putty.exe" ,"putty.exe"])
.Add("A","OfficeProducts" ,"+ Office Products")
.Add("S","ShowOrRunProgram","Streamlabs Chatbot" ,["ahk_exe Streamlabs Chatbot.exe" ,"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Streamlabs\Streamlabs Chatbot\Streamlabs Chatbot.lnk"])
.Add("D","ShowOrRunProgram","Discord" ,["ahk_exe Discord.exe" , A_AppData "\..\Local\Discord\Update.exe --processStart Discord.exe"])
.Run()
OfficeProducts(){
nhgOP:=New NestedHotkeysWGui(">Office Products")
nhgOP
.Add("Q","ShowOrRunProgram","Word" ,["ahk_exe WINWORD.EXE" ,"C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE"])
.Add("W","ShowOrRunProgram","Excel" ,["ahk_exe EXCEL.EXE" ,"C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE"])
.Add("E","ShowOrRunProgram","PowerPoint" ,["ahk_exe POWERPNT.EXE" ,"C:\Program Files (x86)\Microsoft Office\root\Office16\POWERPNT.EXE"])
.Add("R","ShowOrRunProgram","Outlook" ,["ahk_exe OUTLOOK.EXE" ,"C:\Program Files (x86)\Microsoft Office\root\Office16\OUTLOOK.EXE"])
.Run()
}
Return
;--------------------------
;| Quick folders access |
;--------------------------
INSERT & e::
nhgFolder:= New NestedHotkeysWGui("Folder Navigation")
nhgFolder
.Add("Q","OpenProgrammingFolders" ,"+ Programming")
.Add("W","Run","Google Drive" ,"C:\Users\Luis\Google Drive")
.Add("E","Run","Chatbot Scripts" ,"C:\Users\Luis\AppData\Roaming\Streamlabs\Streamlabs Chatbot\Services\Scripts")
.Add("D","Run","Documents folder" ,A_MyDocuments)
.Run()
OpenProgrammingFolders(){
nhgProgrammingFolders:=New NestedHotkeysWGui(">Programming")
nhgProgrammingFolders
.Add("Q","Run","AHK" ,"C:\Users\Luis\Google Drive\Programming\AHK")
.Add("W","Run","C#" ,"C:\Users\Luis\source\repos")
.Add("E","Run","Java" ,"C:\Java")
.Add("R","Run","Node JS","C:\NodeJs")
.Run()
}
Return
;--------------------
;| Favorite links |
;--------------------
INSERT & f::
nhgFavURLs := New NestedHotkeysWGui("URLs")
nhgFavURLs
.Add("Q","TwitchURLs","+ Twitch")
.Add("W","Run" ,"Youtube" ,"https://www.youtube.com/")
.Add("E","Run" ,"Google" ,"https://www.google.com/")
.Add("R","Run" ,"Reddit" ,"https://reddit.com/")
.Add("S","Run" ,"Speedtest.net" ,"https://www.speedtest.net``/")
.Run()
TwitchURLs(){
nhgTwitchURLs := new NestedHotkeysWGui("Twitch URLs")
nhgTwitchURLs
.Add("Q", "Run","Streamer1's Channel" ,"https://twitch.tv/streamer1/")
.Add("W", "Run","Streamer1's Chat" ,"https://twitch.tv/popout/streamer1/chat?popout=")
.Add("E", "Run","Streamer2's Channel" ,"https://twitch.tv/streamer2/")
.Add("R", "Run","Streamer2's Chat" ,"https://twitch.tv/popout/streamer2/chat?popout=")
.Run()
}
Return
;-----------------------------
;| Functions Used in Menus |
;-----------------------------
;Lists all subfolders in a folder on a new GUI
ShowSubFolders(path){
nhgSubFolders:=New NestedHotkeysWGui(path)
folderKeys:=["Q","W","E","R","A","S","D","F","Z","X","C","V"]
subFolders=
Loop, %path%\*,2
{
subFolders=%subFolders%%A_LoopFileTimeModified%|%A_LoopFileFullPath%|%A_LoopFileName%`n
}
Sort, subFolders, N R
i:=1
Loop, Parse,subFolders,`n
{
item:=StrSplit(A_LoopField,"|")
nhgSubFolders.Add(folderKeys[i],"Run",item[3],item[2])
i:=i+1
If (i>folderKeys.MaxIndex())
Break
}
nhgSubFolders.Run()
}
Run(path){
Run %path%,,max
}
ShowOrRunProgram(params){
windowIdentifier:=params[1]
programPath:=params[2]
IfWinExist %windowIdentifier%
WinActivate %windowIdentifier%
Else
Run %programPath%,,max
}
Write(msg){
oldClipboard := Clipboard
Clipboard := msg
ClipWait
Send ^v
Sleep 50
Clipboard := oldClipboard
}