Argument and Variables Utility

This versatile utility allows you to make two types of changes to the input from the previous object; Use Argument to modify the input before outputting it, and use variables to store the input for use later in your workflow.


Using Arguments and Variables

Arguments

The Argument utility allows you to modify the input from the previous object. By default, the argument box will contain {query}, which is the input.

In this example, I've simply added a dash in front of it, so that it can be added to a to-do list and look like a list item.

Argument

Not using the Argument? Leave the box blank.

Variables

Variables add incredible flexibility to workflows, allowing you to store multiple inputs to use later, or to set defaults which can be dynamically overridden.

In this example, I've set two variables; The first variable named task will save the {query} input, allowing me to re-use it later in the workflow with {var:task}; var stands for variable, and task is the name of the variable I created.

The second variable, todo, is set with a fixed variable called home. You can use it in your workflow by adding {var:todo}.

Variables

Need to find out more about variables? Take a look at our guide to using variables in workflows.

Including dynamic placeholders

From Alfred 3.3, we've added dynamic placeholders, so that you can include the date, time, as well as clipboard items to your variables.

Take a look at the Dynamic Placeholders page for more details.


Workflow Examples Using Arg and Vars

Want to see the arguments and variables in action? We've included a few workflows in the Getting Started guides and examples in Alfred, which you can find under the [+] button at the bottom of the Workflows sidebar in Alfred's preferences.

In particular, Add the Simple To-Do list example. It uses variables to store two values; first, your task and, in the second input, your selected to-do list. It also uses an argument to turn the task into a to-do list entry by adding a dash before it.

Simple To-Do list example workflow

Latest Blog Post:

Tutorial: Creating the Fastest Hotkey-Based Web Search

CacheFly Campaign Monitor

"Alfred" is a registered trademark of Running with Crayons Ltd. ©2017 Running with Crayons Ltd. All rights reserved.

Terms & Conditions, Privacy Policy, Cookies.