-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal.ahk
207 lines (169 loc) · 4.33 KB
/
global.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
F1::switchDesktopByNumber(1)
F2::switchDesktopByNumber(2)
F3::switchDesktopByNumber(3)
F4::switchDesktopByNumber(4)
F5::switchDesktopByNumber(5)
+F1::switchDesktopByNumber(6)
+F2::switchDesktopByNumber(7)
+F3::switchDesktopByNumber(8)
+F4::switchDesktopByNumber(9)
-::deleteVirtualDesktop()
=::createVirtualDesktop()
`::return
backspace::
Send {AltDown}{Tab Down}{Tab Up}{AltUp}
return
;;------------------------NEXT ROW--------------------------;;
+r::Reload
+v::MsgBox, 4,, The script could not be reloaded. Would you like to open it for editing?
tab::switchDesktopToLastOpened()
; AMBOSS SEARCH
^a::
MyClip := ClipboardAll
Clipboard = ; empty the clipboard
Send, ^c
ClipWait, 2
if ErrorLevel ; ClipWait timed out.
{
return
}
if RegExMatch(Clipboard, "^[^ ]*\.[^ ]*$")
{
Run "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" %Clipboard%
}
else
{
; Modify some characters that screw up the URL
; RFC 3986 section 2.2 Reserved Characters (January 2005): !*'();:@&=+$,/?#[]
StringReplace, Clipboard, Clipboard, `r`n, %A_Space%, All
StringReplace, Clipboard, Clipboard, #, `%23, All
StringReplace, Clipboard, Clipboard, &, `%26, All
StringReplace, Clipboard, Clipboard, +, `%2b, All
StringReplace, Clipboard, Clipboard, ", `%22, All
Run % "https://next.amboss.com/us/search?v=overview&q=" . clipboard ; uriEncode(clipboard)
}
Clipboard := MyClip
return
; -------------------!
^g::
MyClip := ClipboardAll
Clipboard = ; empty the clipboard
Send, ^c
ClipWait, 2
if ErrorLevel ; ClipWait timed out.
{
return
}
if RegExMatch(Clipboard, "^[^ ]*\.[^ ]*$")
{
Run "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" %Clipboard%
}
else
{
; Modify some characters that screw up the URL
; RFC 3986 section 2.2 Reserved Characters (January 2005): !*'();:@&=+$,/?#[]
StringReplace, Clipboard, Clipboard, `r`n, %A_Space%, All
StringReplace, Clipboard, Clipboard, #, `%23, All
StringReplace, Clipboard, Clipboard, &, `%26, All
StringReplace, Clipboard, Clipboard, +, `%2b, All
StringReplace, Clipboard, Clipboard, ", `%22, All
Run % "https://www.google.com/search?hl=en&q=" . clipboard ; uriEncode(clipboard)
}
Clipboard := MyClip
return
^v::
if WinExist("ahk_exe Notion")
{
EL =
trmp = %ClipboardAll% ; save clipboard
Clipboard := "" ; clear clipboard
Send, ^c ; simulate Ctrl+C (=selection in clipboard)
ClipWait, 0, 1 ; wait until clipboard contains data
selection = %Clipboard% ; save the content of the clipboard
If (EL = 1)
{
sendinput {(}{)}{left}
}
else
{
Winactivate, ahk_exe Notion
sendinput ^v
Send, {Enter}
Clipboard = %trmp% ; restore old content of the clipboard
}
}
return
~space::RapidHotkey("!{Space}""#{Tab}}", "1""2")
;;===================== MODIFIERS =========================;;
*SC072::
Run "C:\Program Files\Everything 1.5a\Everything64.exe"
return
insert::switchDesktopToLeft()
delete::switchDesktopToRight()
pgup::#PgUp
pgdn::#PgDn
DetectHiddenWindows On
^PgDn::Brightness(-1)
^PgUp::Brightness(+1)
;;================= NEXT SECTION ======================;;
up::^PgUp
down::^PgDn
; left::
; right::
; ;;================== THE NUMPAD ======================;;
ActSwitch(){
If !WinExist(exe){
Send #%winnum%
WinWait, % exe
sleep, 3000
winactivate, % exe
}
else If WinExist(exe)
If !WinActive(exe)
WinActivate, % exe
Else WinActivateBottom, % exe
}
Return
DetectHiddenWindows off
numpad0::
global exe := "ahk_exe TickTick"
global winnum := "0"
ActSwitch()
return
numpad1::
global exe := "ahk_exe Notion"
global winnum := "1"
ActSwitch()
return
numpad2::
global exe := "ahk_exe Edge"
global winnum := "2"
ActSwitch()
return
numpad3::
global exe := "ahk_exe Anki"
global winnum := "3"
ActSwitch()
return
numpad4::
global exe := "ahk_exe WhatsApp"
global winnum := "4"
ActSwitch()
return
numpad5::
Run "C:\Program Files\Kodi\Kodi.exe"
return
; numpad6::
; numpad7::
; numpad8::
; ;numpad9::
; ;;NumLock::tooltip, DO NOT USE THIS IN YOUR 2ND KEYBOARD!
; numpadDiv::return
; numpadMult::return
; numpadSub::return
numpadAdd::Send {WinDown}{ShiftDown}
numpadEnter::Send {ShiftUp}{WinUp}
numpadDot::return
;;================== ======================;;
#if
;#include %A_ScriptDir%/Lib/notion.ahk