-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFormatWordText.ahk
More file actions
52 lines (47 loc) · 995 Bytes
/
FormatWordText.ahk
File metadata and controls
52 lines (47 loc) · 995 Bytes
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
#Requires AutoHotkey v2.0
#SingleInstance Force
^!f:: ;; ctrl-alt-f (format)
{
if WinActive("ahk_exe WINWORD.EXE")
{
SendEvent("!hpg") ;; open paragraph menu
Sleep(10)
SendEvent("!gj") ;; justify text
Sleep(10)
SendEvent '{Enter}'
Sleep(10)
SendEvent("!b") ;; remove space before paragraph
Sleep(10)
SendEvent("0")
Sleep(10)
;;SendEvent '{Enter}'
Sleep(10)
SendEvent("!f") ;; remove space after paragraph
Sleep(10)
SendEvent("0")
Sleep(10)
;;SendEvent '{Enter}'
Sleep(10)
SendEvent("!a") ;; set line spacing
Sleep(10)
SendEvent("1.15")
Sleep(10)
SendEvent '{Enter}'
Sleep(10)
SendEvent("!hfca") ;; black font
Sleep(10)
SendEvent("!hff") ;; font
SendEvent("calibri")
Sleep(10)
SendEvent '{Enter}'
Sleep(10)
SendEvent("!hfs") ;; font size
SendEvent("11")
Sleep(10)
SendEvent '{Enter}'
}
else
{
MsgBox("Microsoft Word window not active.")
}
}