-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathdocument.wflow
More file actions
190 lines (181 loc) · 5.73 KB
/
document.wflow
File metadata and controls
190 lines (181 loc) · 5.73 KB
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
<?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">
<dict>
<key>AMApplicationBuild</key>
<string>444.42</string>
<key>AMApplicationVersion</key>
<string>2.9</string>
<key>AMDocumentVersion</key>
<string>2</string>
<key>actions</key>
<array>
<dict>
<key>action</key>
<dict>
<key>AMAccepts</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Optional</key>
<true/>
<key>Types</key>
<array>
<string>com.apple.applescript.object</string>
</array>
</dict>
<key>AMActionVersion</key>
<string>1.0.2</string>
<key>AMApplication</key>
<array>
<string>Automator</string>
</array>
<key>AMParameterProperties</key>
<dict>
<key>source</key>
<dict/>
</dict>
<key>AMProvides</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Types</key>
<array>
<string>com.apple.applescript.object</string>
</array>
</dict>
<key>ActionBundlePath</key>
<string>/System/Library/Automator/Run AppleScript.action</string>
<key>ActionName</key>
<string>Run AppleScript</string>
<key>ActionParameters</key>
<dict>
<key>source</key>
<string>on run {input, parameters} tell application "Xcode" set activeDocument to document 1 whose name ends with (word -1 of (get name of window 1)) set activeDocumentPath to path of activeDocument set currentLines to selected paragraph range of activeDocument set startLine to get item 1 of currentLines set endLine to get item 2 of currentLines end tell set repositoryUrl to do shell script "cd \"$(dirname '" & activeDocumentPath & "')\"; git remote -v | grep fetch | awk '{print $2}' | sed 's/ssh:\\/\\/git@/https:\\/\\//' | sed 's/git@/https:\\/\\//' | sed 's/com:/com\\//' | sed 's/\\.git//'" set pathToRepositoryDirLocation to do shell script "cd \"$(dirname '" & activeDocumentPath & "')\"; git rev-parse --show-toplevel " set activeFilePathInRepository to replace_text(activeDocumentPath, pathToRepositoryDirLocation, "") set currentCommit to do shell script "cd \"$(dirname '" & activeDocumentPath & "')\"; git rev-parse HEAD" set githubUrl to repositoryUrl & "/blob/" & currentCommit & activeFilePathInRepository & "#L" & startLine & "-L" & endLine do shell script "open " & replace_text(githubUrl, " ", "%20") return inputend runon replace_text(this_text, search_string, replacement_string) set prevTIDs to AppleScript's text item delimiters set AppleScript's text item delimiters to the search_string set the item_list to every text item of this_text set AppleScript's text item delimiters to the replacement_string set this_text to the item_list as string set AppleScript's text item delimiters to prevTIDs return this_textend replace_text</string>
</dict>
<key>BundleIdentifier</key>
<string>com.apple.Automator.RunScript</string>
<key>CFBundleVersion</key>
<string>1.0.2</string>
<key>CanShowSelectedItemsWhenRun</key>
<false/>
<key>CanShowWhenRun</key>
<true/>
<key>Category</key>
<array>
<string>AMCategoryUtilities</string>
</array>
<key>Class Name</key>
<string>RunScriptAction</string>
<key>InputUUID</key>
<string>E144DC09-8106-4404-8681-E80FC04786A0</string>
<key>Keywords</key>
<array>
<string>Run</string>
</array>
<key>OutputUUID</key>
<string>5C55476E-76A5-48E2-B408-8A0CA93A3695</string>
<key>UUID</key>
<string>177B93D3-94F4-4FBE-9A61-076E50462E5C</string>
<key>UnlocalizedApplications</key>
<array>
<string>Automator</string>
</array>
<key>arguments</key>
<dict>
<key>0</key>
<dict>
<key>default value</key>
<string>on run {input, parameters}
(* Your script goes here *)
return input
end run</string>
<key>name</key>
<string>source</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>0</string>
</dict>
</dict>
<key>isViewVisible</key>
<true/>
<key>location</key>
<string>541.500000:844.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Run AppleScript.action/Contents/Resources/Base.lproj/main.nib</string>
</dict>
<key>isViewVisible</key>
<true/>
</dict>
</array>
<key>connectors</key>
<dict/>
<key>workflowMetaData</key>
<dict>
<key>applicationBundleID</key>
<string>com.apple.dt.Xcode</string>
<key>applicationBundleIDsByPath</key>
<dict>
<key>/Applications/Xcode.app</key>
<string>com.apple.dt.Xcode</string>
</dict>
<key>applicationPath</key>
<string>/Applications/Xcode.app</string>
<key>applicationPaths</key>
<array>
<string>/Applications/Xcode.app</string>
</array>
<key>inputTypeIdentifier</key>
<string>com.apple.Automator.text</string>
<key>outputTypeIdentifier</key>
<string>com.apple.Automator.nothing</string>
<key>presentationMode</key>
<integer>11</integer>
<key>processesInput</key>
<integer>0</integer>
<key>serviceApplicationBundleID</key>
<string>com.apple.dt.Xcode</string>
<key>serviceApplicationPath</key>
<string>/Applications/Xcode.app</string>
<key>serviceInputTypeIdentifier</key>
<string>com.apple.Automator.text</string>
<key>serviceOutputTypeIdentifier</key>
<string>com.apple.Automator.nothing</string>
<key>serviceProcessesInput</key>
<integer>0</integer>
<key>systemImageName</key>
<string>NSActionTemplate</string>
<key>useAutomaticInputType</key>
<integer>0</integer>
<key>workflowTypeIdentifier</key>
<string>com.apple.Automator.servicesMenu</string>
</dict>
</dict>
</plist>