Skip to content

Commit 7d05027

Browse files
committed
Remove update conditional.
1 parent fc7c3fc commit 7d05027

File tree

2 files changed

+29
-242
lines changed

2 files changed

+29
-242
lines changed

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,10 @@ Find and open Mac automation dictionaries
66

77
## About
88

9-
<!-- BEGIN ABOUT -->
9+
Run `asdic` to list installed AppleScript dictionaries. Press ↩ to open.
1010

11-
Run `asdic` to list installed AppleScript dictionaries. Press ↵ to open.
12-
13-
![](https://user-images.githubusercontent.com/1699443/152067731-cbb4db84-a387-4387-927b-ee16c40b1815.png)
11+
![Alfred results for asdic m](Workflow/images/about/asdicm.png)
1412

1513
The first run will take a few seconds to find the dictionaries, but subsequent runs will be instant. Updating the dictionaries list is done automatically but can be forced with `:applescriptdictionariesforceupdate`.
1614

17-
<!-- END ABOUT -->
18-
1915
<a href='https://github.com/alfredapp/applescript-dictionaries-workflow/releases/latest/download/AppleScript.Dictionaries.alfredworkflow'>⤓ Download Workflow</a>

Workflow/info.plist

Lines changed: 27 additions & 236 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,6 @@
3434
<false/>
3535
</dict>
3636
</array>
37-
<key>68E3717D-4670-4B20-9B18-2DEE779E5281</key>
38-
<array>
39-
<dict>
40-
<key>destinationuid</key>
41-
<string>ADA59DA3-60F5-41BD-9A12-F2FC07E1A5CE</string>
42-
<key>modifiers</key>
43-
<integer>0</integer>
44-
<key>modifiersubtext</key>
45-
<string></string>
46-
<key>vitoclose</key>
47-
<false/>
48-
</dict>
49-
</array>
5037
<key>7D4ED081-C6A3-4262-9578-229B307CE081</key>
5138
<array>
5239
<dict>
@@ -86,36 +73,11 @@
8673
<false/>
8774
</dict>
8875
</array>
89-
<key>ADA59DA3-60F5-41BD-9A12-F2FC07E1A5CE</key>
90-
<array>
91-
<dict>
92-
<key>destinationuid</key>
93-
<string>CA8C43EA-268B-45D5-B6BD-63235124FDD8</string>
94-
<key>modifiers</key>
95-
<integer>0</integer>
96-
<key>modifiersubtext</key>
97-
<string></string>
98-
<key>sourceoutputuid</key>
99-
<string>162C4049-4FA3-49CB-8E7E-9DC1B57AF737</string>
100-
<key>vitoclose</key>
101-
<false/>
102-
</dict>
103-
<dict>
104-
<key>destinationuid</key>
105-
<string>8AE945AB-3A58-4CE9-B786-67B2B849A03A</string>
106-
<key>modifiers</key>
107-
<integer>0</integer>
108-
<key>modifiersubtext</key>
109-
<string></string>
110-
<key>vitoclose</key>
111-
<false/>
112-
</dict>
113-
</array>
11476
<key>FEF4C44B-EF6E-4FB0-B440-44A54C7A3B27</key>
11577
<array>
11678
<dict>
11779
<key>destinationuid</key>
118-
<string>68E3717D-4670-4B20-9B18-2DEE779E5281</string>
80+
<string>CA8C43EA-268B-45D5-B6BD-63235124FDD8</string>
11981
<key>modifiers</key>
12082
<integer>0</integer>
12183
<key>modifiersubtext</key>
@@ -145,29 +107,6 @@
145107
<string>AppleScript Dictionaries</string>
146108
<key>objects</key>
147109
<array>
148-
<dict>
149-
<key>config</key>
150-
<dict>
151-
<key>concurrently</key>
152-
<false/>
153-
<key>escaping</key>
154-
<integer>102</integer>
155-
<key>script</key>
156-
<string>echo "${alfred_version}" | cut -d. -f1 | tr -d '\n'</string>
157-
<key>scriptargtype</key>
158-
<integer>1</integer>
159-
<key>scriptfile</key>
160-
<string></string>
161-
<key>type</key>
162-
<integer>5</integer>
163-
</dict>
164-
<key>type</key>
165-
<string>alfred.workflow.action.script</string>
166-
<key>uid</key>
167-
<string>68E3717D-4670-4B20-9B18-2DEE779E5281</string>
168-
<key>version</key>
169-
<integer>2</integer>
170-
</dict>
171110
<dict>
172111
<key>config</key>
173112
<dict>
@@ -371,131 +310,6 @@ fi</string>
371310
<key>version</key>
372311
<integer>2</integer>
373312
</dict>
374-
<dict>
375-
<key>config</key>
376-
<dict>
377-
<key>conditions</key>
378-
<array>
379-
<dict>
380-
<key>inputstring</key>
381-
<string></string>
382-
<key>matchcasesensitive</key>
383-
<false/>
384-
<key>matchmode</key>
385-
<integer>2</integer>
386-
<key>matchstring</key>
387-
<string>4</string>
388-
<key>outputlabel</key>
389-
<string>Update</string>
390-
<key>uid</key>
391-
<string>162C4049-4FA3-49CB-8E7E-9DC1B57AF737</string>
392-
</dict>
393-
</array>
394-
<key>elselabel</key>
395-
<string>Version 4</string>
396-
</dict>
397-
<key>type</key>
398-
<string>alfred.workflow.utility.conditional</string>
399-
<key>uid</key>
400-
<string>ADA59DA3-60F5-41BD-9A12-F2FC07E1A5CE</string>
401-
<key>version</key>
402-
<integer>1</integer>
403-
</dict>
404-
<dict>
405-
<key>config</key>
406-
<dict>
407-
<key>concurrently</key>
408-
<false/>
409-
<key>escaping</key>
410-
<integer>0</integer>
411-
<key>script</key>
412-
<string># Special values for OneUpdater reuse
413-
readonly workflow_webaddress="$(/usr/libexec/PlistBuddy -c 'print webaddress' './info.plist')"
414-
readonly workflow_repo_name="$(basename "${workflow_webaddress}" | sed 's/-workflow$//')"
415-
416-
# THESE VARIABLES MUST BE SET. SEE THE ONEUPDATER README FOR AN EXPLANATION OF EACH.
417-
readonly remote_info_plist="https://github.com/alfredapp/legacy-workflows/raw/main/Workflows/${workflow_repo_name}/info.plist"
418-
readonly workflow_url="https://github.com/alfredapp/legacy-workflows/raw/main/Workflows/${workflow_repo_name}/${workflow_repo_name}.alfredworkflow"
419-
readonly download_type='direct'
420-
readonly frequency_check='4'
421-
422-
# FROM HERE ON, CODE SHOULD BE LEFT UNTOUCHED!
423-
function abort {
424-
echo "${1}" &gt;&amp;2
425-
exit 1
426-
}
427-
428-
function url_exists {
429-
curl --silent --location --output /dev/null --fail --range 0-0 "${1}"
430-
}
431-
432-
function notification {
433-
local -r notificator="$(find . -type d -name 'Notificator.app')"
434-
if [[ -n "${notificator}" ]]; then
435-
"${notificator}/Contents/Resources/Scripts/notificator" --message "${1}" --title "${alfred_workflow_name}" --subtitle 'A new version is available'
436-
return
437-
fi
438-
439-
local -r terminal_notifier="$(find . -type f -name 'terminal-notifier')"
440-
if [[ -n "${terminal_notifier}" ]]; then
441-
"${terminal_notifier}" -title "${alfred_workflow_name}" -subtitle 'A new version is available' -message "${1}"
442-
return
443-
fi
444-
445-
osascript -e "display notification \"${1}\" with title \"${alfred_workflow_name}\" subtitle \"A new version is available\""
446-
}
447-
448-
# Local sanity checks
449-
readonly local_info_plist='info.plist'
450-
readonly local_version="$(/usr/libexec/PlistBuddy -c 'print version' "${local_info_plist}")"
451-
452-
[[ -n "${local_version}" ]] || abort 'You need to set a workflow version in the configuration sheet.'
453-
[[ "${download_type}" =~ ^(direct|page|github_release)$ ]] || abort "'download_type' (${download_type}) needs to be one of 'direct', 'page', or 'github_release'."
454-
[[ "${frequency_check}" =~ ^[0-9]+$ ]] || abort "'frequency_check' (${frequency_check}) needs to be a number."
455-
456-
# Check for updates
457-
if [[ $(find "${local_info_plist}" -mtime +"${frequency_check}"d) ]]; then
458-
if ! url_exists "${remote_info_plist}"; then abort "'remote_info_plist' (${remote_info_plist}) appears to not be reachable."; fi # Remote sanity check
459-
460-
readonly tmp_file="$(mktemp)"
461-
curl --silent --location --output "${tmp_file}" "${remote_info_plist}"
462-
readonly remote_version="$(/usr/libexec/PlistBuddy -c 'print version' "${tmp_file}")"
463-
464-
if [[ "${local_version}" == "${remote_version}" ]]; then
465-
touch "${local_info_plist}" # Reset timer by touching local file
466-
exit 0
467-
fi
468-
469-
if [[ "${download_type}" == 'page' ]]; then
470-
notification 'Opening download page…'
471-
open "${workflow_url}"
472-
exit 0
473-
fi
474-
475-
download_url="$([[ "${download_type}" == 'github_release' ]] &amp;&amp; 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}")"
476-
477-
if url_exists "${download_url}"; then
478-
notification 'Downloading and installing…'
479-
curl --silent --location --output "${HOME}/Downloads/${alfred_workflow_name}.alfredworkflow" "${download_url}"
480-
open "${HOME}/Downloads/${alfred_workflow_name}.alfredworkflow"
481-
else
482-
abort "'workflow_url' (${download_url}) appears to not be reachable."
483-
fi
484-
fi</string>
485-
<key>scriptargtype</key>
486-
<integer>1</integer>
487-
<key>scriptfile</key>
488-
<string></string>
489-
<key>type</key>
490-
<integer>0</integer>
491-
</dict>
492-
<key>type</key>
493-
<string>alfred.workflow.action.script</string>
494-
<key>uid</key>
495-
<string>8AE945AB-3A58-4CE9-B786-67B2B849A03A</string>
496-
<key>version</key>
497-
<integer>2</integer>
498-
</dict>
499313
<dict>
500314
<key>config</key>
501315
<dict>
@@ -518,6 +332,8 @@ fi</string>
518332
</array>
519333
<key>elselabel</key>
520334
<string>Keep current cache</string>
335+
<key>hideelse</key>
336+
<false/>
521337
</dict>
522338
<key>type</key>
523339
<string>alfred.workflow.utility.conditional</string>
@@ -550,6 +366,8 @@ fi</string>
550366
<dict>
551367
<key>config</key>
552368
<dict>
369+
<key>availableviaurlhandler</key>
370+
<false/>
553371
<key>triggerid</key>
554372
<string>rebuild_cache</string>
555373
</dict>
@@ -606,7 +424,7 @@ osascript -l JavaScript -e '
606424
</dict>
607425
</array>
608426
<key>readme</key>
609-
<string>Run `asdic` to list installed AppleScript dictionaries. Press to open.
427+
<string>Run `asdic` to list installed AppleScript dictionaries. Press to open.
610428
611429
![Alfred results for asdic m](images/about/asdicm.png)
612430
@@ -618,81 +436,50 @@ The first run will take a few seconds to find the dictionaries, but subsequent r
618436
<key>note</key>
619437
<string>Force cache rebuild</string>
620438
<key>xpos</key>
621-
<integer>45</integer>
439+
<real>45</real>
622440
<key>ypos</key>
623-
<integer>205</integer>
441+
<real>205</real>
624442
</dict>
625443
<key>4D3E1793-10DA-4EA8-B0B2-6A64955267AD</key>
626444
<dict>
627445
<key>xpos</key>
628-
<integer>605</integer>
629-
<key>ypos</key>
630-
<integer>205</integer>
631-
</dict>
632-
<key>68E3717D-4670-4B20-9B18-2DEE779E5281</key>
633-
<dict>
634-
<key>colorindex</key>
635-
<integer>5</integer>
636-
<key>note</key>
637-
<string>Major Alfred version</string>
638-
<key>xpos</key>
639-
<integer>605</integer>
446+
<real>605</real>
640447
<key>ypos</key>
641-
<integer>35</integer>
448+
<real>205</real>
642449
</dict>
643450
<key>7307CF18-FA86-41AF-BDC7-AB66D75667E9</key>
644451
<dict>
645452
<key>note</key>
646453
<string>Rebuild cache</string>
647454
<key>xpos</key>
648-
<integer>785</integer>
455+
<real>785</real>
649456
<key>ypos</key>
650-
<integer>360</integer>
457+
<real>360</real>
651458
</dict>
652459
<key>7D4ED081-C6A3-4262-9578-229B307CE081</key>
653460
<dict>
654461
<key>note</key>
655462
<string>List AppleScript dictionaries</string>
656463
<key>xpos</key>
657-
<integer>45</integer>
464+
<real>45</real>
658465
<key>ypos</key>
659-
<integer>35</integer>
660-
</dict>
661-
<key>8AE945AB-3A58-4CE9-B786-67B2B849A03A</key>
662-
<dict>
663-
<key>colorindex</key>
664-
<integer>12</integer>
665-
<key>note</key>
666-
<string>OneUpdater</string>
667-
<key>xpos</key>
668-
<integer>905</integer>
669-
<key>ypos</key>
670-
<integer>185</integer>
466+
<real>35</real>
671467
</dict>
672468
<key>99D694BC-7C8B-4735-A22C-21F9CAAE5A54</key>
673469
<dict>
674470
<key>note</key>
675471
<string>Open dictionary</string>
676472
<key>xpos</key>
677-
<integer>240</integer>
473+
<real>240</real>
678474
<key>ypos</key>
679-
<integer>35</integer>
475+
<real>35</real>
680476
</dict>
681477
<key>A53489BD-C2E1-4896-BC6F-E6A6C52C4FE7</key>
682478
<dict>
683479
<key>xpos</key>
684-
<integer>45</integer>
685-
<key>ypos</key>
686-
<integer>360</integer>
687-
</dict>
688-
<key>ADA59DA3-60F5-41BD-9A12-F2FC07E1A5CE</key>
689-
<dict>
690-
<key>colorindex</key>
691-
<integer>5</integer>
692-
<key>xpos</key>
693-
<integer>765</integer>
480+
<real>45</real>
694481
<key>ypos</key>
695-
<integer>55</integer>
482+
<real>360</real>
696483
</dict>
697484
<key>CA8C43EA-268B-45D5-B6BD-63235124FDD8</key>
698485
<dict>
@@ -701,22 +488,26 @@ The first run will take a few seconds to find the dictionaries, but subsequent r
701488
<key>note</key>
702489
<string>OneUpdater</string>
703490
<key>xpos</key>
704-
<integer>905</integer>
491+
<real>605</real>
705492
<key>ypos</key>
706-
<integer>35</integer>
493+
<real>35</real>
707494
</dict>
708495
<key>FEF4C44B-EF6E-4FB0-B440-44A54C7A3B27</key>
709496
<dict>
710497
<key>note</key>
711498
<string>Check if cache is old</string>
712499
<key>xpos</key>
713-
<integer>420</integer>
500+
<real>420</real>
714501
<key>ypos</key>
715-
<integer>35</integer>
502+
<real>35</real>
716503
</dict>
717504
</dict>
505+
<key>userconfigurationconfig</key>
506+
<array/>
507+
<key>variablesdontexport</key>
508+
<array/>
718509
<key>version</key>
719-
<string>2022.2</string>
510+
<string>2022.3</string>
720511
<key>webaddress</key>
721512
<string>https://github.com/alfredapp/applescript-dictionaries-workflow/</string>
722513
</dict>

0 commit comments

Comments
 (0)