-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtitle-case-and-header.ahk
54 lines (51 loc) · 1.25 KB
/
title-case-and-header.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
RepFunc(subString){
done := subString
matches := {" And ": " and "
," As ": " as "
," But ": " but "
," For ": " for "
," If ": " if "
," Nor ": " nor "
," Or ": " or "
," So ": " so "
," Yet ": " yet "
," A ": " a "
," An ": " an "
," The ": " the "
," At ": " at "
," By ": " by "
," In ": " in "
," Of ": " of "
," Off ": " off "
," On ": " on "
," Per ": " per "
," To ": " to "
," Up ": " up "
," Via ": " via "}
for what, with in matches
StringReplace, done, done, %what%, %with%, All
return done
}
!b::
!n::
!m::
keypress := SubStr(A_ThisHotkey, 2)
Switch keypress
{
Case "b":
theNum := 1
Case "n":
theNum := 2
Case "m":
theNum := 3
}
Clipboard =
SendInput, ^a
SendInput, ^x
ClipWait 0 ;pause for Clipboard data
StringUpper, Clipboard, Clipboard, T
Clipboard := SubStr(Clipboard, 1, 2) . RepFunc(SubStr(Clipboard, 3))
SendInput, ^v
SendEvent {Ctrl down}{Alt down}{%theNum% down}
SendEvent {Ctrl up}{Alt up}{%theNum% up}
Return