From d212ca342ce8e94f501d3ac75a74ee90454d648d Mon Sep 17 00:00:00 2001 From: Rob Walton Date: Sun, 17 Dec 2017 14:15:54 +0000 Subject: [PATCH] Fix 'uo' command to work with renamed app under Ulysses 12 --- README.md | 3 ++ info.plist | 93 +++++++++++++++++++++++------------------------------- 2 files changed, 43 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index b16cd70..03d05cc 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,9 @@ To install, download a released Ulysses.alfredworkflow and double-click to open ## Versions +**1.0.2** +- Fixed 'uo' command to work with renamed UlyssesMac application name under Ulysses 12 update + **1.0.1** - Fixed displayName KeyError exception that **completely broke the workflow with Ulysses 12 update** - Fixed an older issue with 'un' command diff --git a/info.plist b/info.plist index 5c3f091..6d1dec8 100644 --- a/info.plist +++ b/info.plist @@ -146,19 +146,6 @@ - 4D3DEADF-FC0D-4085-ACA7-3A1CCE6865A9 - - - destinationuid - 31247F5F-C0FC-46BB-AEEB-33B53A0EA869 - modifiers - 0 - modifiersubtext - - vitoclose - - - 51639D3C-CF18-491E-846B-4C6771C1CFA5 @@ -379,7 +366,7 @@ destinationuid - 4D3DEADF-FC0D-4085-ACA7-3A1CCE6865A9 + 31247F5F-C0FC-46BB-AEEB-33B53A0EA869 modifiers 0 modifiersubtext @@ -645,6 +632,10 @@ ulysses_view.set_view_setting("group", view_to_set) alfredfiltersresults + alfredfiltersresultsmatchmode + 0 + argumenttrimmode + 0 argumenttype 1 escaping @@ -689,6 +680,10 @@ ulysses_view.set_view_setting("group", view_to_set) alfredfiltersresults + alfredfiltersresultsmatchmode + 0 + argumenttrimmode + 0 argumenttype 1 escaping @@ -754,23 +749,6 @@ ulysses_view.set_view_setting("sheet", view_to_set) version 2 - - config - - keychar - o - keycode - -1 - keymod - 1048576 - - type - alfred.workflow.output.dispatchkeycombo - uid - 4D3DEADF-FC0D-4085-ACA7-3A1CCE6865A9 - version - 1 - config @@ -801,19 +779,15 @@ ulysses_view.set_view_setting("sheet", view_to_set) 68 script on run argv + set theQuery to item 1 of argv - set ulyssesWasRunning to application "Ulysses" is running - if not ulyssesWasRunning - activate application "Ulysses" + + --bring Ulysses to forground starting if necessary activate application "UlyssesMac" --Ulysses takes a while to open its main window even after it has started. --So loop until its in the forground: repeat while getFrontmostApplicationName() is not "UlyssesMac" delay 0.2 end repeat tell application "System Events" keystroke "O" using command down end tell return theQuery - repeat until application "Ulysses" is running - delay .2 - end repeat - - end if +end run - return theQuery -end run + +on getFrontmostApplicationName() tell application "System Events" set frontApp to name of first application process whose frontmost is true end tell return frontApp end getFrontmostApplicationName scriptargtype 1 scriptfile @@ -1030,6 +1004,10 @@ cat "$query" alfredfiltersresults + alfredfiltersresultsmatchmode + 0 + argumenttrimmode + 0 argumenttype 1 escaping @@ -1095,6 +1073,10 @@ cat "$query" alfredfiltersresults + alfredfiltersresultsmatchmode + 0 + argumenttrimmode + 0 argumenttype 1 escaping @@ -1165,6 +1147,8 @@ Allow Alfred access in the Accessibility section of the Privacy tab of your Mac' config + count + 1 keychar f keycode @@ -1322,6 +1306,10 @@ sys.stdout.write(ulysses_view.get_view_setting(node_type)) alfredfiltersresults + alfredfiltersresultsmatchmode + 0 + argumenttrimmode + 0 argumenttype 1 escaping @@ -1392,6 +1380,10 @@ sys.stdout.write(ulysses_view.get_view_setting(node_type)) alfredfiltersresults + alfredfiltersresultsmatchmode + 0 + argumenttrimmode + 0 argumenttype 1 escaping @@ -1454,6 +1446,10 @@ sys.stdout.write(ulysses_view.get_view_setting(node_type)) alfredfiltersresults + alfredfiltersresultsmatchmode + 0 + argumenttrimmode + 0 argumenttype 1 escaping @@ -1736,15 +1732,6 @@ create_new_sheet = true ypos 1160 - 4D3DEADF-FC0D-4085-ACA7-3A1CCE6865A9 - - colorindex - 4 - xpos - 400 - ypos - 370 - 51639D3C-CF18-491E-846B-4C6771C1CFA5 colorindex @@ -1935,7 +1922,7 @@ then highlight query in sheet colorindex 4 note - Activate Ulyssis and wait until running + Activate Ulyssis and wait until running then send cmd-O xpos 210 ypos @@ -2032,10 +2019,10 @@ then highlight query in sheet variables SemVer - 1.0 + 1.0.2 version - 1.0 + 1.0.2 webaddress github.com/robwalton/alfred-ulysses-workflow