Jump to content

4.2.2 update broke external triggers


Recommended Posts

I took a look at changelog: `Create new URL Helper to parse raw / non-encoded (RFC 3986) URL strings, paving the way to overhauling Alfred's URL handling`

 

And have a feeling this is what broke all my external triggers. If I have a trigger like:

 

image.thumb.png.63c620fc3bcd4494fc1bc68e86acf807.png

 

I activate those from Karabiner by calling osascript: https://github.com/nikitavoloboev/dotfiles/blob/master/karabiner/karabiner.edn#L7

 

`"osascript -e 'tell application \"Alfred 4\" to run trigger \"%s\" in workflow \"%s\" with argument \"%s\"'"`

 

I am not sure what changed exactly but 4.2.1 update was working correctly and now nothing works. The external triggers don't get called and nothing gets logged in the console.

 

Thank you for any help. Hopefully I don't need to downgrade and there is a fix for this.

Link to post

Okay found 

 

 

I guess I need to URL encode all spaces inside those strings.

 

~/.config/karabiner
❯ osascript -e 'tell application "Keyboard Maestro Engine" to do script "open: Safari"'

~/.config/karabiner
❯ osascript -e 'tell application "Alfred 4" to run trigger "search wiki" in workflow "nikivi.mind" with argument ""'
31:99: execution error: Not authorized to send Apple events to Alfred 4. (-1743)

 

Strange it didn't even ask me for authorisation. KM call asked for authorization but then worked perfectly.

 

Not sure which of these I should give Alfred for those external triggers to start working again.

 

image.thumb.png.1ac6bf13a5f421609e67322fdf65e198.png

 

Okay I went in 'General' section in app and checked, I indeed gave all permissions to Alfred. Even Automation ones as I think that's the relevant bit.

 

image.png.bad910f21b69850aa046f2934f27b26d.png

 

Specifically System Events has permission. No idea why it fails. Reading through this as I think that's my issue as I get no prompt showing up.

 

Okay I am not sure, I downgraded to 4.2.1 and turned pre releases off. Perhaps there is a bug with macOS.

 

Edited by nikivi
Link to post
3 minutes ago, deanishe said:

You're not using URLs, though, are you?


I am not, that's why I am confused. Don't know why it's failing. Apologize again for a wall of text, just my entire workflow relies on this stuff working so I went to a little panic mode (all my workflows are ran off external triggers, turns out using mac without Alfred is very painful).

 

I downgraded and things work. Maybe someone knows an answer can reply. Would be very happy to hear it. ♥️ 

Edited by nikivi
Link to post
2 minutes ago, deanishe said:

What makes you think the problem is between Alfred and KM, not Karabiner and Alfred?

 

I think it's because all the KM macros are still working and are called in the same way. Using osascript. Karabiner just calls osascript shell command. Makes me think that perhaps I need to add some new permission to Karabiner Elements.

 

image.png.c89ea38a7ab57efe9cb5d3d735cc75ac.png


I think that karabiner user server implies that permission was granted. Although console implies logging, not calling into shell commands. Very confusing. Also I don't think its karabiner <> alfred interaction because its Alfred that starts breaking after updating to new version. Karabiner version is the same. And the only thing in the changelog that implies breaking change is the URL thing.

Edited by nikivi
Link to post

No, I get this when I run same commands in shell:

 

```

~/.config/karabiner
❯ osascript -e 'tell application "Keyboard Maestro Engine" to do script "open: Safari"'

~/.config/karabiner
❯ osascript -e 'tell application "Alfred 4" to run trigger "search wiki" in workflow "nikivi.mind" with argument ""'
31:99: execution error: Not authorized to send Apple events to Alfred 4. (-1743)

```

 

With this 4.4.1 version I run `osascript -e 'tell application "Alfred 4" to run trigger "search wiki" in workflow "nikivi.mind" with argument ""'` and I did get a prompt to authorize. Something is off with permissions.

Edited by nikivi
Link to post

Okay I hate computers. So I ran `osascript -e 'tell application "Alfred 4" to run trigger "search wiki" in workflow "nikivi.mind" with argument ""'` with Alfred version 4.2.1 and I finally got a prompt to authorize it. I did. Then I installed latest 4.2.2 pre release and things magically work. 

 

If someone comes across this, it's apparently useful to downgrade and try the same thing again then upgrade again.

[Admin note: Downgrading and upgrading Alfred again does not resolve macOS permissions issues. There's no correlation between downgrading and fixing this issue so we do not recommend this as a solution.]

 

What was annoying me most is that I never could get the authorization prompt to show and the answers in Stack Overflow weren't that helpful.

Edited by Vero
Admin note added
Link to post
1 hour ago, nikivi said:

Create new URL Helper to parse raw / non-encoded (RFC 3986) URL strings, paving the way to overhauling Alfred's URL handling

 

This won't have anything to do with the External Triggers, and currently is only internally being used for the URL handing from Alfred's Contacts Viewer (e.g. tel:). It will eventually replace all URL handling within Alfred though.

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...