DEV Community

Krzysztof Żuraw
Krzysztof Żuraw

Posted on • Originally published at krzysztofzuraw.com on

1 1

Alfred Snippet workflow

I recently decided to remove a few no so frequently used applications. One of them was Typinator. It is a text expander - one of many. While I was researching if I can remove it and consolidate my snippets I stumbled upon a feature in one of the most used apps by me - Alfred. There are two messages if you are looking into Alfred text expanding capabilities - you can do it - yay 🎉 and it wont be so simple.

There are two types of text expanding in Alfred world:

  1. Simple - like expanding telephone number or date with cursor
  2. Complex - with multiple variables & selecting from a list of possible options.

I want to cover here the second one. To have complex text expanding you need to create snippet workflow. As a demo I've created conventional comments snippet workflow that ask me a couple of questions and pastes nicely formatted string into GitHub comment box. Workflow can be found on GitHub.

How it is working? At the beginning it ask me about label => which I can select from list; then I type title of my comment. Right after that workflow is pasting string:

**label** : title
{cursor_postion}

Enter fullscreen mode Exit fullscreen mode

into currently focused input field.

You can see workflow in action below:

Summary

If you want to have text expander like capabilities in Alfred - it is doable via snippet workflow. You can start by looking into my conventional comments one.

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly — using the tools and languages you already love!

Learn More

Top comments (0)

AI Agent image

How to Build an AI Agent with Semantic Kernel (and More!)

Join Developer Advocate Luce Carter for a hands-on tutorial on building an AI-powered dinner recommendation agent. Discover how to integrate Microsoft Semantic Kernel, MongoDB Atlas, C#, and OpenAI for ingredient checks and smart restaurant suggestions.

Watch the video 📺