Jump to content

Input Fields for Snippet Expansion

Recommended Posts

Hi alfredders :)


I love Alfred and struggle to find anything wrong with it. It has managed to substitute lots of tiny utility apps (weather, calculator, clipboard manager... Just to name the first that come to mind). For my line of work I type frequently the same text over and over and over. I've been using Typinator in the past and love its Input Field options (see attached screenshots). 


I was wondering if there was something similar in development for future version of Alfred or - EVEN BETTER - if a workflow already exists to achieve a similar result. In short I'd like to have the ability to expand a snippet with multiple choice to pick from (either single option or multiple choice, doesn't matter really). Or should i simply accept the idea that this is not achievable for the time being/future? I'm not a developer: I'm in the other side of the spectrum (read Designer) so not sure what I'm talking about here :P


Thanks in advance everyone and forgive me if this was not the right section to post this!

Screen Shot 2017-06-21 at 11.25.35.png

Screen Shot 2017-06-21 at 11.25.27.png

Link to post

Hi @iiiax Welcome to the forum!


I'm glad to see you're already diving into the new 3.4 features :) I'm in fact in the process of writing a tutorial that shows you how to use Snippet Trigger objects to do exactly this.


It'll be live in a few hours on the blog, but in the meantime, you'll get a glimpse of how you can create it with this screenshot:


Screen Shot 2017-06-21 at 11.41.37.png


The top example uses a free text field, while the bottom one uses a pre-set list of arguments in a List Filter object.


I'll update this thread with a link to the tutorial and workflow itself later today - but in case I forget, be sure to check the blog :)




PS - Definitely no need to be a developer to create these snippet-based workflows!


Link to post

Hi @Vero


It's an honour to get an answer from THE developer herself :)


Thanks for the prompt response (impressive considering it's only 2 of you :D) - I'll be waiting for the blog post to discover more about this! SUPER!


Take care! Bye from London!

Link to post

@iiiax Here's the link to the tutorial on using dynamic inputs with the snippet triggers:



As per the screenshot I provided earlier, there are two examples in the tutorial:

  • Using a free text field
  • Using a list of pre-defined options

You can grab the workflow to see it in action - You'll just need to set the snippet trigger keywords, as these are stripped on import to ensure they don't clash with any of your existing keywords. :)


This is a new feature I absolutely love and will be using a lot myself, so I can't wait to see how everyone else makes use of it too!





Link to post

@Vero this is GREAT. Thank you so much. It's exactly what i was hoping for :wub:


Is there a way to have different queries in the same workflow? Let me explain: i use text expansion for renaming files using a complex naming convention. Here is an example:




In the example above, any text included in the {} is a variable. Each variable has around 3-5 option with LOT of characters so typing them manually cause typos more often than not... 


Your workflow works brilliantly - It would be amazing if it could generate multiple {query} in the final result.


Is this achievable?

Link to post

@iiiax Absolutely! I didn't include this in the original tutorial as it might be too much to swallow in one post, but it's likely I'll do a further post on chaining variables soon. Having said that, there's an excellent Getting Started workflow built into Alfred, called "Chaining Inputs".


To create your workflow, you'll need to familiarise yourself with using variables to save the arguments, but beyond that, it's very easy :) 



Here's a workflow I've just thrown together to show the Snippet Triggers in action with multiple inputs. I've added three List filters and annotated the workflow to make it easier to see what's happening, but just double-click each object to see their configuration.


Screen Shot 2017-06-21 at 16.43.28.png


You can download it here:

https://www.dropbox.com/s/eqq91b8tyxom5t1/Chaining inputs for a Snippet Trigger.alfredworkflow?dl=0


Take a look and let me know how you get on.




Link to post

@Vero you're a star thank you so much.


This is spot on! I'll build on top of the workflow you've sent across as it's a brilliant starting point for my naming convention automation project :D


Be reassure I'll be back soon asking questions :P but until then HAVE A GOOD ONE



Link to post
  • 6 months later...

Thanks @Vero

I'm trying to figure out how to "mix"  lists with free text to get a file name where some elements are fixed and others are typed by me. I made a try but the workflow "stops" when it get to the free text (I can type something but Alfred doesn't go on...) :wacko:

[UPDATE]: don't know what happened, tried a second time and it works..thanks anyway!

Edited by nestorito
Link to post
  • 1 year later...

This post helped me understand the process as well. Thank you.


However, when I type a snippet, say "ssuper" Alfred pastes the actual snippet after "ssuper" It does not replace it in many cases.


Edit: Fixed it by going into snippet setting and slowing down the key event.

Edited by slyfox
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...