-
Notifications
You must be signed in to change notification settings - Fork 4
/
info.plist
663 lines (647 loc) · 17.7 KB
/
info.plist
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
<?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>bundleid</key>
<string>com.pnlng.urlactions</string>
<key>category</key>
<string>Mine</string>
<key>connections</key>
<dict>
<key>4E42958F-AB37-4884-A9EF-0E3612CD935F</key>
<array>
<dict>
<key>destinationuid</key>
<string>5ECD3A62-C7D3-44A3-B448-9FA80977E138</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>5ECD3A62-C7D3-44A3-B448-9FA80977E138</key>
<array>
<dict>
<key>destinationuid</key>
<string>AB4EE45B-110B-45CF-8BC9-DC04F779792A</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
<dict>
<key>destinationuid</key>
<string>B07191C2-BB02-42AD-89E3-0D9EB5237E38</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
<dict>
<key>destinationuid</key>
<string>6F397E7D-58CB-4B78-A32E-E1FFABA54B87</string>
<key>modifiers</key>
<integer>1048576</integer>
<key>modifiersubtext</key>
<string>Remove URL query params</string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>6F397E7D-58CB-4B78-A32E-E1FFABA54B87</key>
<array>
<dict>
<key>destinationuid</key>
<string>B07191C2-BB02-42AD-89E3-0D9EB5237E38</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>8358BFA1-492D-4C8B-9993-0BDA22566D52</key>
<array>
<dict>
<key>destinationuid</key>
<string>82CABD23-2C5E-41E8-8615-11CD3B792A8B</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>AB4EE45B-110B-45CF-8BC9-DC04F779792A</key>
<array/>
<key>B07191C2-BB02-42AD-89E3-0D9EB5237E38</key>
<array>
<dict>
<key>destinationuid</key>
<string>CBCEA77B-CFD5-4C2B-BD44-47177BEEE8C1</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>sourceoutputuid</key>
<string>DE1876EB-86AE-434C-A2BB-E90FCF612514</string>
<key>vitoclose</key>
<false/>
</dict>
<dict>
<key>destinationuid</key>
<string>8358BFA1-492D-4C8B-9993-0BDA22566D52</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>C186D22C-70AF-49B1-BF8A-EDAEA23DA4A2</key>
<array>
<dict>
<key>destinationuid</key>
<string>4E42958F-AB37-4884-A9EF-0E3612CD935F</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>D42B1A15-579F-4608-8B5B-0237EC66DC8B</key>
<array>
<dict>
<key>destinationuid</key>
<string>8F5B8CD0-BF03-400B-AAB1-90CB4A5B069D</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>ECD1399A-7BCC-47BE-B4DD-AC5785660A84</key>
<array>
<dict>
<key>destinationuid</key>
<string>5ECD3A62-C7D3-44A3-B448-9FA80977E138</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
</dict>
<key>createdby</key>
<string>pnlng</string>
<key>description</key>
<string>Get tab URL and title from browser. Format a link in Markdown or add a task to OmniFocus.</string>
<key>disabled</key>
<false/>
<key>name</key>
<string>URL Actions</string>
<key>objects</key>
<array>
<dict>
<key>config</key>
<dict>
<key>concurrently</key>
<false/>
<key>escaping</key>
<integer>0</integer>
<key>script</key>
<string># THESE VARIABLES MUST BE SET. SEE THE ONEUPDATER README FOR AN EXPLANATION OF EACH.
readonly remote_info_plist='https://raw.githubusercontent.com/pnlng/alfred-url-actions/master/info.plist'
readonly workflow_url='https://github.com/pnlng/alfred-url-actions/releases/latest/download/URL.Actions.alfredworkflow'
readonly download_type='direct'
if [ "$UPDATE_FREQUENCY" = "" ]; then
readonly frequency_check='7'
else
readonly frequency_check="$UPDATE_FREQUENCY"
fi
# FROM HERE ON, CODE SHOULD BE LEFT UNTOUCHED!
function abort {
echo "${1}" >&2
exit 1
}
function url_exists {
curl --silent --location --output /dev/null --fail --range 0-0 "${1}"
}
function notification {
local -r notificator="$(find . -type d -name 'Notificator.app')"
if [[ -n "${notificator}" ]]; then
"${notificator}/Contents/Resources/Scripts/notificator" --message "${1}" --title "${alfred_workflow_name}" --subtitle 'A new version is available'
return
fi
local -r terminal_notifier="$(find . -type f -name 'terminal-notifier')"
if [[ -n "${terminal_notifier}" ]]; then
"${terminal_notifier}" -title "${alfred_workflow_name}" -subtitle 'A new version is available' -message "${1}"
return
fi
osascript -e "display notification \"${1}\" with title \"${alfred_workflow_name}\" subtitle \"A new version is available\""
}
# Local sanity checks
readonly local_info_plist='info.plist'
readonly local_version="$(/usr/libexec/PlistBuddy -c 'print version' "${local_info_plist}")"
[[ -n "${local_version}" ]] || abort 'You need to set a workflow version in the configuration sheet.'
[[ "${download_type}" =~ ^(direct|page|github_release)$ ]] || abort "'download_type' (${download_type}) needs to be one of 'direct', 'page', or 'github_release'."
[[ "${frequency_check}" =~ ^[0-9]+$ ]] || abort "'frequency_check' (${frequency_check}) needs to be a number."
# Check for updates
if [[ $(find "${local_info_plist}" -mtime +"${frequency_check}"d) ]]; then
if ! url_exists "${remote_info_plist}"; then abort "'remote_info_plist' (${remote_info_plist}) appears to not be reachable."; fi # Remote sanity check
readonly tmp_file="$(mktemp)"
curl --silent --location --output "${tmp_file}" "${remote_info_plist}"
readonly remote_version="$(/usr/libexec/PlistBuddy -c 'print version' "${tmp_file}")"
if [[ "${local_version}" == "${remote_version}" ]]; then
touch "${local_info_plist}" # Reset timer by touching local file
exit 0
fi
if [[ "${download_type}" == 'page' ]]; then
notification 'Opening download page…'
open "${workflow_url}"
exit 0
fi
download_url="$([[ "${download_type}" == 'github_release' ]] && curl --silent "https://api.github.com/repos/${workflow_url}/releases/latest" | grep 'browser_download_url' | head -1 | sed -E 's/.*browser_download_url": "(.*)"/\1/' || echo "${workflow_url}")"
if url_exists "${download_url}"; then
notification 'Downloading and installing…'
curl --silent --location --output "${HOME}/Downloads/${alfred_workflow_name}.alfredworkflow" "${download_url}"
open "${HOME}/Downloads/${alfred_workflow_name}.alfredworkflow"
else
abort "'workflow_url' (${download_url}) appears to not be reachable."
fi
fi</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
<string></string>
<key>type</key>
<integer>0</integer>
</dict>
<key>type</key>
<string>alfred.workflow.action.script</string>
<key>uid</key>
<string>AB4EE45B-110B-45CF-8BC9-DC04F779792A</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>concurrently</key>
<false/>
<key>escaping</key>
<integer>102</integer>
<key>script</key>
<string>query=$1
open $query
echo -n $query</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
<string></string>
<key>type</key>
<integer>0</integer>
</dict>
<key>type</key>
<string>alfred.workflow.action.script</string>
<key>uid</key>
<string>CBCEA77B-CFD5-4C2B-BD44-47177BEEE8C1</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>argument</key>
<string>{query}</string>
<key>passthroughargument</key>
<false/>
<key>variables</key>
<dict>
<key>raw_url</key>
<string>{query}</string>
</dict>
</dict>
<key>type</key>
<string>alfred.workflow.utility.argument</string>
<key>uid</key>
<string>4E42958F-AB37-4884-A9EF-0E3612CD935F</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>alfredfiltersresults</key>
<false/>
<key>alfredfiltersresultsmatchmode</key>
<integer>0</integer>
<key>argumenttreatemptyqueryasnil</key>
<true/>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
<integer>0</integer>
<key>escaping</key>
<integer>102</integer>
<key>keyword</key>
<string>url</string>
<key>queuedelaycustom</key>
<integer>3</integer>
<key>queuedelayimmediatelyinitially</key>
<true/>
<key>queuedelaymode</key>
<integer>0</integer>
<key>queuemode</key>
<integer>1</integer>
<key>runningsubtext</key>
<string></string>
<key>script</key>
<string>query=$1
./main $query</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
<string></string>
<key>subtext</key>
<string></string>
<key>title</key>
<string></string>
<key>type</key>
<integer>0</integer>
<key>withspace</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.input.scriptfilter</string>
<key>uid</key>
<string>5ECD3A62-C7D3-44A3-B448-9FA80977E138</string>
<key>version</key>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>action</key>
<integer>0</integer>
<key>argument</key>
<integer>1</integer>
<key>focusedappvariable</key>
<false/>
<key>focusedappvariablename</key>
<string></string>
<key>hotkey</key>
<integer>8</integer>
<key>hotmod</key>
<integer>393216</integer>
<key>hotstring</key>
<string>C</string>
<key>leftcursor</key>
<false/>
<key>modsmode</key>
<integer>0</integer>
<key>relatedAppsMode</key>
<integer>0</integer>
</dict>
<key>type</key>
<string>alfred.workflow.trigger.hotkey</string>
<key>uid</key>
<string>C186D22C-70AF-49B1-BF8A-EDAEA23DA4A2</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>lastpathcomponent</key>
<false/>
<key>onlyshowifquerypopulated</key>
<true/>
<key>removeextension</key>
<false/>
<key>text</key>
<string>{query}</string>
<key>title</key>
<string>Link Copied to Clipboard</string>
</dict>
<key>type</key>
<string>alfred.workflow.output.notification</string>
<key>uid</key>
<string>82CABD23-2C5E-41E8-8615-11CD3B792A8B</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>autopaste</key>
<false/>
<key>clipboardtext</key>
<string>{query}</string>
<key>ignoredynamicplaceholders</key>
<false/>
<key>transient</key>
<false/>
</dict>
<key>type</key>
<string>alfred.workflow.output.clipboard</string>
<key>uid</key>
<string>8358BFA1-492D-4C8B-9993-0BDA22566D52</string>
<key>version</key>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>conditions</key>
<array>
<dict>
<key>inputstring</key>
<string>{query}</string>
<key>matchcasesensitive</key>
<false/>
<key>matchmode</key>
<integer>4</integer>
<key>matchstring</key>
<string>.+:///.*</string>
<key>outputlabel</key>
<string>Open</string>
<key>uid</key>
<string>DE1876EB-86AE-434C-A2BB-E90FCF612514</string>
</dict>
</array>
<key>elselabel</key>
<string>Copy</string>
</dict>
<key>type</key>
<string>alfred.workflow.utility.conditional</string>
<key>uid</key>
<string>B07191C2-BB02-42AD-89E3-0D9EB5237E38</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>concurrently</key>
<false/>
<key>escaping</key>
<integer>102</integer>
<key>script</key>
<string>query=$1
stripped_url=$(echo $raw_url | sed -e "s/\?.*//")
echo -n $(echo $query | sed -e "s|$raw_url|$stripped_url|g")</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
<string></string>
<key>type</key>
<integer>5</integer>
</dict>
<key>type</key>
<string>alfred.workflow.action.script</string>
<key>uid</key>
<string>6F397E7D-58CB-4B78-A32E-E1FFABA54B87</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>acceptsfiles</key>
<false/>
<key>acceptsmulti</key>
<integer>0</integer>
<key>acceptstext</key>
<false/>
<key>acceptsurls</key>
<true/>
<key>name</key>
<string>URL Actions</string>
</dict>
<key>type</key>
<string>alfred.workflow.trigger.universalaction</string>
<key>uid</key>
<string>ECD1399A-7BCC-47BE-B4DD-AC5785660A84</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>argumenttype</key>
<integer>2</integer>
<key>keyword</key>
<string>urlact</string>
<key>subtext</key>
<string></string>
<key>text</key>
<string>Show workflow data folder</string>
<key>withspace</key>
<false/>
</dict>
<key>type</key>
<string>alfred.workflow.input.keyword</string>
<key>uid</key>
<string>D42B1A15-579F-4608-8B5B-0237EC66DC8B</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>path</key>
<string>settings.json</string>
</dict>
<key>type</key>
<string>alfred.workflow.action.revealfile</string>
<key>uid</key>
<string>8F5B8CD0-BF03-400B-AAB1-90CB4A5B069D</string>
<key>version</key>
<integer>1</integer>
</dict>
</array>
<key>readme</key>
<string>Get tab URL and title from browser. Format a link in Markdown or add a task to OmniFocus.
Variables:
- `CLEAN_AMAZON` - Default: true
- The workflow removes tracking tokens from Amazon URLs if this variable is set to `true`.
- To disable the feature, set the variable to `false`.
- `UPDATE_FREQUENCY` - Default: 7
- Set once how many days the workflow should check for updates
- Updates done through [OneUpdater](https://github.com/vitorgalvao/alfred-workflows/tree/master/OneUpdater)
- `CUSTOM_ACTIONS_FILE` - Default: null
- The name of a JSON file in the workflow data directory supplying custom actions that override the default actions.
- `CUSTOM_ACTIONS` - Default: null
- A string in JSON format supplying custom actions that override the default actions.
- If both `CUSTOM_ACTIONS` and `CUSTOM_ACTIONS_FILE` are defined, only the `CUSTOM_ACTIONS_FILE` will be used.
GitHub repo: https://github.com/pnlng/url-actions</string>
<key>uidata</key>
<dict>
<key>4E42958F-AB37-4884-A9EF-0E3612CD935F</key>
<dict>
<key>xpos</key>
<integer>165</integer>
<key>ypos</key>
<integer>155</integer>
</dict>
<key>5ECD3A62-C7D3-44A3-B448-9FA80977E138</key>
<dict>
<key>xpos</key>
<integer>210</integer>
<key>ypos</key>
<integer>220</integer>
</dict>
<key>6F397E7D-58CB-4B78-A32E-E1FFABA54B87</key>
<dict>
<key>note</key>
<string>Remove URL query params</string>
<key>xpos</key>
<integer>340</integer>
<key>ypos</key>
<integer>360</integer>
</dict>
<key>82CABD23-2C5E-41E8-8615-11CD3B792A8B</key>
<dict>
<key>xpos</key>
<integer>705</integer>
<key>ypos</key>
<integer>245</integer>
</dict>
<key>8358BFA1-492D-4C8B-9993-0BDA22566D52</key>
<dict>
<key>xpos</key>
<integer>540</integer>
<key>ypos</key>
<integer>245</integer>
</dict>
<key>8F5B8CD0-BF03-400B-AAB1-90CB4A5B069D</key>
<dict>
<key>xpos</key>
<integer>385</integer>
<key>ypos</key>
<integer>515</integer>
</dict>
<key>AB4EE45B-110B-45CF-8BC9-DC04F779792A</key>
<dict>
<key>colorindex</key>
<integer>12</integer>
<key>note</key>
<string>OneUpdater</string>
<key>xpos</key>
<integer>370</integer>
<key>ypos</key>
<integer>15</integer>
</dict>
<key>B07191C2-BB02-42AD-89E3-0D9EB5237E38</key>
<dict>
<key>xpos</key>
<integer>440</integer>
<key>ypos</key>
<integer>245</integer>
</dict>
<key>C186D22C-70AF-49B1-BF8A-EDAEA23DA4A2</key>
<dict>
<key>xpos</key>
<integer>45</integer>
<key>ypos</key>
<integer>220</integer>
</dict>
<key>CBCEA77B-CFD5-4C2B-BD44-47177BEEE8C1</key>
<dict>
<key>note</key>
<string>Open URL scheme</string>
<key>xpos</key>
<integer>540</integer>
<key>ypos</key>
<integer>105</integer>
</dict>
<key>D42B1A15-579F-4608-8B5B-0237EC66DC8B</key>
<dict>
<key>note</key>
<string>Show workflow folder</string>
<key>xpos</key>
<integer>220</integer>
<key>ypos</key>
<integer>515</integer>
</dict>
<key>ECD1399A-7BCC-47BE-B4DD-AC5785660A84</key>
<dict>
<key>xpos</key>
<integer>45</integer>
<key>ypos</key>
<integer>370</integer>
</dict>
</dict>
<key>variables</key>
<dict>
<key>CLEAN_AMAZON</key>
<string>true</string>
<key>UPDATE_FREQUENCY</key>
<string>7</string>
</dict>
<key>variablesdontexport</key>
<array>
<string>UPDATE_FREQUENCY</string>
</array>
<key>version</key>
<string>1.1.7</string>
<key>webaddress</key>
<string>https://github.com/pnlng/alfred-url-actions</string>
</dict>
</plist>