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 comment

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 :)

 

Cheers,
Vero

 

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

 

Link to comment

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 comment

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

https://www.alfredapp.com/help/workflows/triggers/snippet/snippet-triggers-with-dynamic-inputs/

 

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!

 

Cheers,
Vero

 

 

Link to comment

@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:

 

GH{project_code}-{project_part}of{total_project_parts}*F17{designer_name}

 

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 comment

@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 :) 

https://www.alfredapp.com/help/workflows/advanced/variables/

 

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.

 

Cheers,
Vero

 

Link to comment

@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

 

Max

Link to comment
  • 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
UPDATE
Link to comment
  • 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 comment
  • 4 years later...
On 6/21/2017 at 5:47 PM, Vero said:

@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 :) 

https://www.alfredapp.com/help/workflows/advanced/variables/

 

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.

 

Cheers,
Vero

 

 

could you reupload this workflow? would be glad to get help to create my own complex snippet. its not that easy to begin with

Link to comment
27 minutes ago, Wura said:

could you reupload this workflow?

 

@Wura Welcome to the forum :)

 

This workflow is now built into Alfred; Open the Workflow preferences and click the [+] at the bottom of the sidebar > Getting Started > Chaining Inputs.

 

Don't hesitate to ask if you have any questions creating your own workflows!

Link to comment

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...