Elgato stream deck and Alfred

Hi… anybody using stream deck and Alfred Workflows? Is it even possible? Anything you can share?

Yes, it’s possible. if your Alfred Workflow has an " External" trigger.
No, I haven’t done it. But it should be as easy as calling an AppleScript from your SD button.

Yes, I’ve recently started using them together. I assigned a keyboard shortcut to a workflow and then added a hotkey switch to the stream deck with the relevant keyboard shortcut. It works a dream.

Next up I’m looking to see if I can do something similar with Notion, as I use it a lot. There will be a way I’m sure: stream deck is becoming more and more useful!

In case it helps someone else, this was a little trickier to set up than I thought it would be.

  1. In Alfred, add an External Trigger (as mentioned by @vco1). Call it whatever you want. Ignore the second text box for now.
  2. Still in Alfred, double-click the workflow in the left sidebar and give it a bundle identifier. Something like com.alfredapp.workflows.yourworkflowname.
  3. Reopen the External Trigger you added in (1), and copy the sample code from the box.
  4. Install the OSA Script plugin from the Stream Deck plugin gallery.
  5. Add a Run OSA Script action to your Stream Deck.
  6. Paste the code block you copied in (3) into the run action.
  7. Make sure Stream Deck has permissions in macOS Security & Privacy → Privacy tab → Full Disk Access.

That should be it!

Edit: I should add that I prefer this script-based approach over simulating keystrokes or keypresses because it eliminates the chance that a keypress conflict will occur. The script-based approach guarantees that only this workflow will be executed when you run the Stream Deck action.

2 Likes

Stream Deck External Trigger for Alfred

I took @[ryanjamurphy] steps and added a few extra tips.
This resource will allow you to use the stream deck to trigger Alfred Workflows

  1. Make sure Stream Deck & Alfred both have permissions in macOS Security & Privacy → Privacy tab → Full Disk Access.
  2. Install the OSA Script plugin from the Stream Deck plugin gallery.
  3. In Alfred, double-click the workflow in the left sidebar and give it a bundle identifier. Something like com.alfredapp.workflows.yourworkflowname.
  4. In Alfred, add an External Trigger to your workflow. Call it whatever you want.
  5. Copy the sample code from the box. Example:

tell application id “com.runningwithcrayons.Alfred” to run trigger “StreamDesk-Onboarding” in workflow “com.alfredapp.onboarding” with argument “test”

  1. In StreamDeck Add a Run OSA Script action to your Stream Deck profile page.
  • I recommend a multistep action so you can also layer in a logging clock such as toggl or clockify.
  1. Paste the code block you copied in step 5 into the run action.
  2. Edit the code the workflow will trigger but with the test argument. Delete the TEST

tell application id “com.runningwithcrayons.Alfred” to run trigger “StreamDesk-Onboarding” in workflow “com.alfredapp.onboarding” with argument “”

  1. Add script line to auto-press enter. (keycode 36)

tell application “System Events”

key code 36

end tell

End result:

tell application id “com.runningwithcrayons.Alfred” to run trigger “StreamDesk-Onboarding” in workflow “com.alfredapp.onboarding” with argument ""

tell application "System Events"

key code 36

end tell

Use AppleScript Editor for creating and testing for advanced scripts and then paste into stream desk if needed.

Complete list of AppleScript key codes

2 Likes