From 61e2e05e941b55a7dd69a9bb3c488e0a4e63ee8b Mon Sep 17 00:00:00 2001 From: Dan F-M Date: Tue, 2 Jul 2019 18:35:28 -0400 Subject: [PATCH] even better ordering --- info.plist | 208 +++++++++++++++++++++++++++++++++---------------- parse_query.py | 5 +- 2 files changed, 146 insertions(+), 67 deletions(-) diff --git a/info.plist b/info.plist index 5398b1d..4168ebd 100644 --- a/info.plist +++ b/info.plist @@ -8,11 +8,11 @@ Internet connections - 0851CD52-A32F-450D-9CE2-99F95F4EFD55 + 2469E046-0CF8-40FC-BD78-A8449D453634 destinationuid - DAFF399E-22B6-4655-BD72-BD3870F30A91 + D5EE24F0-8EB7-48DD-B091-7AAD1B64C5C2 modifiers 0 modifiersubtext @@ -21,7 +21,7 @@ - 1A874EFE-642F-479B-A4BE-CBEDE574FF42 + 5532B5BB-86D1-4826-BAB2-1D0AB757D978 destinationuid @@ -47,11 +47,36 @@ + D5EE24F0-8EB7-48DD-B091-7AAD1B64C5C2 + + + destinationuid + 5532B5BB-86D1-4826-BAB2-1D0AB757D978 + modifiers + 0 + modifiersubtext + + sourceoutputuid + 57141663-833E-41D5-88BD-A799004BDFAF + vitoclose + + + + destinationuid + DAFF399E-22B6-4655-BD72-BD3870F30A91 + modifiers + 0 + modifiersubtext + + vitoclose + + + DAFF399E-22B6-4655-BD72-BD3870F30A91 destinationuid - 407E7C1B-5537-436F-8D97-71204E3433D3 + 11D5721D-E45C-4D45-82C8-2CC370002271 modifiers 0 modifiersubtext @@ -71,46 +96,6 @@ adsabs objects - - config - - browser - - spaces - - url - {query} - utf8 - - - type - alfred.workflow.action.openurl - uid - 11D5721D-E45C-4D45-82C8-2CC370002271 - version - 1 - - - config - - argumenttype - 0 - keyword - ads - subtext - - text - Execute search on the ADS website - withspace - - - type - alfred.workflow.input.keyword - uid - 1A874EFE-642F-479B-A4BE-CBEDE574FF42 - version - 1 - config @@ -134,6 +119,23 @@ version 2 + + config + + matchmode + 0 + matchstring + __ads__ + replacestring + + + type + alfred.workflow.utility.replace + uid + 5532B5BB-86D1-4826-BAB2-1D0AB757D978 + version + 2 + config @@ -149,28 +151,102 @@ type alfred.workflow.action.openurl uid - 407E7C1B-5537-436F-8D97-71204E3433D3 + 11D5721D-E45C-4D45-82C8-2CC370002271 version 1 config - argumenttype + alfredfiltersresults + + alfredfiltersresultsmatchmode + 0 + argumenttreatemptyqueryasnil + + argumenttrimmode 0 + argumenttype + 1 + escaping + 110 keyword ads + queuedelaycustom + 3 + queuedelayimmediatelyinitially + + queuedelaymode + 0 + queuemode + 1 + runningsubtext + + script + cat << EOF +{ + "items": [ + { + "title": "Search on the web", + "subtitle": "The results will be displayed at ui.adsabs.harvard.edu in your browser", + "arg": "__ads__ {query}" + }, + { + "title": "Search in Alfred", + "subtitle": "The results will be displayed directly in Alfred", + "arg": "{query}" + } + ] +} +EOF + + scriptargtype + 0 + scriptfile + subtext - text - Execute search in Alfred + title + Search for papers on ADS + type + 0 withspace type - alfred.workflow.input.keyword + alfred.workflow.input.scriptfilter + uid + 2469E046-0CF8-40FC-BD78-A8449D453634 + version + 3 + + + config + + conditions + + + inputstring + + matchcasesensitive + + matchmode + 4 + matchstring + __ads__ + outputlabel + + uid + 57141663-833E-41D5-88BD-A799004BDFAF + + + elselabel + else + + type + alfred.workflow.utility.conditional uid - 0851CD52-A32F-450D-9CE2-99F95F4EFD55 + D5EE24F0-8EB7-48DD-B091-7AAD1B64C5C2 version 1 @@ -229,44 +305,44 @@ 11D5721D-E45C-4D45-82C8-2CC370002271 xpos - 385 + 645 ypos - 70 + 130 - 407E7C1B-5537-436F-8D97-71204E3433D3 + 2469E046-0CF8-40FC-BD78-A8449D453634 xpos - 380 + 35 ypos - 200 + 130 - 0851CD52-A32F-450D-9CE2-99F95F4EFD55 + 5532B5BB-86D1-4826-BAB2-1D0AB757D978 xpos - 40 + 345 ypos - 200 + 95 - 1A874EFE-642F-479B-A4BE-CBEDE574FF42 + BB651561-1A0A-42DB-8B5C-A41D5ADA51B6 xpos - 40 + 435 ypos - 70 + 65 - BB651561-1A0A-42DB-8B5C-A41D5ADA51B6 + D5EE24F0-8EB7-48DD-B091-7AAD1B64C5C2 xpos - 220 + 235 ypos - 70 + 150 DAFF399E-22B6-4655-BD72-BD3870F30A91 xpos - 215 + 435 ypos - 200 + 195 variables diff --git a/parse_query.py b/parse_query.py index 9b9039e..8d40044 100644 --- a/parse_query.py +++ b/parse_query.py @@ -41,4 +41,7 @@ def parse_query_string(query): if __name__ == "__main__": query = " ".join(sys.argv[1:]) query = parse_query_string(query) - sys.stdout.write("https://ui.adsabs.harvard.edu/search/q="+query) + if len(query): + sys.stdout.write("https://ui.adsabs.harvard.edu/search/q="+query) + else: + sys.stdout.write("https://ui.adsabs.harvard.edu")