Chooce video playback speed
speed:1

Select a Lesson Template From an Alfred Workflow

InstructorJohn Lindquist

Share this video with your friends

Send Tweet

Alfred is a super speed booster when it comes to common tasks. If you're going to be creating a lot of lessons from templates, Alfred can save you from even opening your terminal.

This lesson is a Community Resource

A Community Resource means that it’s free to access for all. The instructor of this lesson requested it to be open to the public.

John Lindquist: When you have multiple templates, like a vanilla template and a svelte template, you may want an easier way of picking which one to launch.

Let's create a blank workflow. We'll just call this From Template and fromtemplate, then we'll set up a keyboard shortcut Hotkey. We'll use Command-Alt-T, hit Save. Then we want a List Filter. We don't need any arguments here, so No Arguments.

We'll create a list like this, with a title of vanilla. The argument can just be +vanilla. Then a title of svelte and + svelte. Connect these together, and then we're going to store the result of that inside of a variable.

We'll name this variable command, and that can take the value of the {query}. We don't need to pass the command name along, so we'll delete that from the arguments. We'll connect this so it stores that in a variable.

Now we can create a Keyword. We're just going to type in some text for the name of the project, so No Argument and a blank keyword. Hit Save there. Connect these. Then the output of that can be another variable. We'll delete that and name this name with the value of this {query}. Hit Save there.

Let's just add some notes. This is the command variable and this is the name variable. This will all end up in a runscript where I'll set this to ZSH. I want to source my zshrc, and then run $command with the $name. Hit Save there. Connect these.

Now I want to hit Command-Alt-T. I can pick from vanilla and svelte. I'll pick vanilla. I'll give it a name of my-new-project-from-template. Hit Enter. Then it'll run everything for me behind the scenes and launch code with my project running, everything named properly, and my browser open waiting for code to change.