Action: Run Alfred workflow []

Hello there,

it would be really amazing if I could trigger an alfred workflow from keyboardmaestro. Can and will you add that feature?

Looking forward to hearing from you :slight_smile:

1 Like

You can do that Alfred using AppleScript.

Create external trigger in the workflow. And put the code you get inside it in KM AppleScript action.


Hah, awesome. And here I am, looking for a gui button.
Thanks a lot!

This workflow serves as an interface to receive user input in the Alfred search bar on behalf of Keyboard Maestro. The value entered into Alfred gets returned back to the KM macro that called out to make use of it.

The two run script actions only serve a cosmetic function, to change the Alfred theme to a Keyboard Maestro-specific facade to set it apart from Alfred's regular use while it acts as a slave.

You haven't shared a link :slight_smile:

I'll upload anything I'll come up with, but it might take a while. It's too hot to think right now. :slight_smile:

No, it was more illustrative to show how I get them to interact. Uploading my workflow would be difficult, as I tend to keep everything very modular, so that workflow there calls another workflow, which is a receiver for any Alfred caller that wishes to run a script or script filter... So I'd have to upload that as well... But that is connected to another receiver to handle any return calls to the original caller, etc.

In a way, I'm slightly annoyed I did it like that, as it makes sharing stuff difficult. But, it allows me to keep all scripts in one place on the file system and shared between Alfred, KM, FastScripts, etc., and also makes it simpler to create script filters.

I did a similar sort of thing with KM, so I could recycle macros that have generalised functions to perform, like creating a list to display, or creating a dictionary, etc. Otherwise, I'd probably share a lot more stuff.

Btw, I'm currently working on the calendar script.

1 Like

@CJK, for my part I'd love to peek at your system. Would you considering an annotated upload to github?

@manavortex I would in principle, but I have a lot of stuff on my plate right now, so can't currently envisage when I would be able to get around to that.

@CJK I know your pain. I'll put a watch on your github if you drop me a link :slight_smile:

Hi Nikita, can this also be done in/with raycast? I would like to trigger "define a word" in raycast without using a separate shortcut by using KM palette(with one global shortcut). There are things that raycast does better(even though it is slower than alfred) like using dictionary to check definition of a word directly in raycast without opening mac dictionary app. Alfred opens it when you select a word. Also opening the app means I can't scroll, but in raycast it is very convenient.

I found it. But still thank you for sharing the link to alfred external triggers.
Here is the link to external triggers in raycast: