/
PDF Copy.ahk
123 lines (101 loc) · 3.19 KB
/
PDF Copy.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
#SingleInstance force
; See https://wyagd001.github.io/zh-cn/docs/commands/_SingleInstance.htm
; force 跳过对话框并自动替换旧实例
if not A_IsAdmin
Run *RunAs "%A_ScriptFullPath%"
; 以管理员身份运行
^F12::
Sleep 100
SendMessage, 0x112, 0xF170, 2,, Program Manager
BlockInput, On
return
#UseHook
LWin & F12::
BlockInput, Off ;取消禁用输入
Send {LCtrl}{RCtrl} ;同时按下两边Ctrl
return
#IfWinActive ahk_class AcrobatSDIWindow
^c::
clipboard := ""
Send ^c
ClipWait 0.2
;中文
clipboard := StrReplace(clipboard, "`r`n", "")
clipboard := StrReplace(clipboard, " ", "")
;英文
;clipboard := StrReplace(clipboard, "`r`n", " ")
;clipboard := StrReplace(clipboard, "- ", "")
Clipwait 0.2
return
#IfWinActive ahk_class AcrobatSDIWindow
!c::
;中文
clipboard := StrReplace(clipboard, "`r`n", "")
clipboard := StrReplace(clipboard, " ", "")
;英文
;clipboard := StrReplace(clipboard, "`r`n", " ")
;clipboard := StrReplace(clipboard, "- ", "")
Clipwait 0.2
return
;---FoxitReader---
#IfWinActive ahk_class classFoxitReader
^c::
clipboard := ""
Send ^c
ClipWait
;中文
clipboard := StrReplace(clipboard, "`r`n", "")
clipboard := StrReplace(clipboard, " ", "")
;英文
;clipboard := StrReplace(clipboard, "`r`n", " ")
;clipboard := StrReplace(clipboard, "- ", "")
Clipwait
return
;---OneNote---
;Alt+K 实现选中字符变为楷体
#IfWinActive ahk_class Framework::CFrame
!k::
Send !2
Send 楷体
send {enter}
send {escape}
return
;Alt+T 实现全文字符变为Timew New Roman
#IfWinActive ahk_class Framework::CFrame
!t::
Send ^a
Send ^a ; 两次Ctrl+A
Send !2
Send Times New Roman
send {enter}
send {escape}
return
;Alt+J 调整行间距 0 2 11
#IfWinActive ahk_class Framework::CFrame
!j::
Send ^a
Send ^a ; 两次Ctrl+A
Send !9
Send {tab}
Send 2
Send {tab}
Send {11}
send {enter}
return
;-----------------------------------------------------------------
^+v:: ;work with clipboard: paste clipboard content as plain text
ClipboardOld := ClipboardAll ;save original clipboard contents
Clipboard = %Clipboard% ;store plain text from clipboard to clipboard
Send ^v ;send the Ctrl+V command
Sleep, 250 ;give some time to finish paste (before restoring clipboard)
Clipboard := ClipboardOld ;restore the original clipboard contents
ClipboardOld = ;clear temporary variable (potentially contains large data)
Return
^!v:: ;work with clipboard: paste clipboard content as plain text
ClipboardOld := ClipboardAll ;save original clipboard contents
Clipboard = %Clipboard% ;store plain text from clipboard to clipboard
Send ^v ;send the Ctrl+V command
Sleep, 250 ;give some time to finish paste (before restoring clipboard)
Clipboard := ClipboardOld ;restore the original clipboard contents
ClipboardOld = ;clear temporary variable (potentially contains large data)
Return