Introduction to Automation Tasks
Automation Tasks are one of the new features introduced in Alfred 5. They behave like other Alfred Workflow objects, but instead of one specialised task, they contain a growing library of actions to choose from.
Together with the rewritten Workflow Editor and the new Palette, Automation Tasks allow you to build Workflows faster and without code.
Let's build a Workflow and look at a few Automation Tasks.
Building a Workflow without code
My Mac is set to Dark Mode and rotates the wallpaper every hour, but for screenshots I like to use Light Mode and the macOS default wallpaper. I may also resize the screenshot because retina images are large.
Changing everything back and forth is time consuming: I have to open the System Settings, go to two different panes, change the preferences in each, take the screenshot, resize it, then revert every changed setting. Even writing about it takes long!
Let's use Automation Tasks to do it for us.
We'll start simple: one Hotkey Trigger connected to two Automation Tasks in sequence. The first turns on Dark Mode and the second one changes the wallpaper.
Each Automation Task has simple configuration tailored to itself, which you can set directly from the object.
This is already an improvement. At this point we could duplicate everything and invert the settings to turn on Dark Mode and restore our wallpaper. Those two sets of actions take care of the most time-consuming part of the process, allowing us to take the screenshot in between.
But we can do better. Automation Tasks are straightforward to add and configure, plus they interact with other Alfred objects; we'll take advantage of that to do everything in one swoop.
Ready to use the Workflow?
You can download the Workflow to follow along.
- Save the path of the current wallpaper for later.
- Turn off Dark Mode (Light Mode on).
- Change to macOS' default wallpaper.
- Enter interactive screenshot mode. The Workflow waits until you're done.
- Resize the image to 50% the size.
- Restore Dark Mode and the original wallpaper.
Ten objects, zero scripting, one handy Workflow.
Automation Tasks can do so much more
We've barely scratched the surface; Automation Tasks can manipulate text, interact with web browsers, resize windows, and more! Each can be useful on their own, but they shine when strung together. Check the Automation Tasks documentation for more examples with fewer objects.
More is still to come to Automation Tasks, and we're loving the enthusiasm and ideas from the community. We're excited to see what Workflows you'll build next.