-
Notifications
You must be signed in to change notification settings - Fork 10
/
22)Indent Text.kmmacros
153 lines (149 loc) · 3.6 KB
/
22)Indent Text.kmmacros
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>IsActive</key>
<true/>
<key>Macros</key>
<array>
<dict>
<key>Actions</key>
<array>
<dict>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<false/>
<key>KeyCode</key>
<integer>7</integer>
<key>MacroActionType</key>
<string>SimulateKeystroke</string>
<key>Modifiers</key>
<integer>256</integer>
<key>ReleaseAll</key>
<false/>
</dict>
<dict>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<false/>
<key>MacroActionType</key>
<string>Pause</string>
<key>Time</key>
<string>0.1</string>
<key>TimeOutAbortsMacro</key>
<true/>
</dict>
<dict>
<key>DisplayKind</key>
<string>Pasting</string>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<false/>
<key>MacroActionType</key>
<string>ExecuteShellScript</string>
<key>Path</key>
<string></string>
<key>Text</key>
<string>#!/usr/bin/env ruby
# encoding: utf-8
# Markdown Service Tools v 2.11
if RUBY_VERSION.to_f > 1.9
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
input = IO.popen('pbpaste', 'r+').read.force_encoding('utf-8')
else
input = IO.popen('pbpaste', 'r+').read
end
# Since any Ruby version before 1.9 doesn't much care for Unicode,
# patch in a new String#utf8_length method that returns the correct length
# for UTF-8 strings.
UNICODE_COMPETENT = ((RUBY_VERSION)[0..2].to_f > 1.8)
unless UNICODE_COMPETENT # lower than 1.9
class String
def utf8_length
i = 0
i = self.scan(/(.)/).length
i
end
end
else # 1.9 and above
class String
alias_method :utf8_length, :length
end
end
input.split("\n").each {|line|
puts " #{line}"
}
</string>
<key>TimeOutAbortsMacro</key>
<true/>
<key>TrimResults</key>
<false/>
<key>TrimResultsNew</key>
<false/>
<key>UseText</key>
<true/>
</dict>
<dict>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<false/>
<key>MacroActionType</key>
<string>DeletePastClipboard</string>
<key>PastExpression</key>
<string>0</string>
</dict>
<dict>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<false/>
<key>MacroActionType</key>
<string>DeletePastClipboard</string>
<key>PastExpression</key>
<string>0</string>
</dict>
</array>
<key>CustomIconData</key>
<string>KMEC=Rounded=KMCOLOR:0,0,0,255=→=86=0=0=0=KMCOLOR:255,255,255,255</string>
<key>IsActive</key>
<true/>
<key>ModificationDate</key>
<real>413328848.80304402</real>
<key>Name</key>
<string>22)Indent Text</string>
<key>Triggers</key>
<array>
<dict>
<key>FireType</key>
<string>Pressed</string>
<key>KeyCode</key>
<integer>30</integer>
<key>MacroTriggerType</key>
<string>HotKey</string>
<key>Modifiers</key>
<integer>6656</integer>
</dict>
<dict>
<key>MacroTriggerType</key>
<string>StatusMenu</string>
</dict>
</array>
<key>UID</key>
<string>4DF62F61-0A58-43AA-BE64-3C52B9B4F9DA</string>
</dict>
</array>
<key>Name</key>
<string>Markdown</string>
<key>UID</key>
<string>99EA1468-0BA6-4207-AA91-83620B60BF5E</string>
</dict>
</array>
</plist>