UXcellence Exploring excellent user experience

Automation for Designers: Starting with Email, Photoshop, and Sketch

As I mentioned in the previous post, there are many great tools for automating various parts of our workflow. Before we start investing in other tools, it’s worth looking at the ones we already have. So let’s dive in and play around with some common uses for automation in our everyday tools.

Automating email

Let’s start with a tool that nearly everyone uses: email. Like many people, I have several email addresses: one for work, one personal, as well as a few others for various side projects (like this site for instance). Even with one email address, managing incoming messages can be overwhelming at times. That’s why I rely heavily on filters.

Filters fit well within the trigger and response concept of automation from the previous article. An email arriving in our inbox is the trigger. We use filters (or rules) to automatically evaluate that incoming email for various criteria: its from address, to address, subject line, keywords in the body, and more. If the email meets any of our criteria (in order of our filters), then we can perform a variety of actions: flag the email, label it, file it in a folder, mark it as read, delete it, forward it, and much more.

I use Gmail to manage personal and side project emails and Outlook for work. Both systems have pretty robust filtering options, and I use them profusely. I find I prefer Gmail slightly because their labeling system allows me to do a bit more with filters. In Outlook, I can only move an email to another individual folder. In Gmail, I can apply more than one label to the same email, effectively filing it in multiple places at once. This is handy when I want to file it under one label for archival purposes and another label to denote that I need to take action on it.

Gmail’s filters are all server-based (unless you set them up in a mail client like Apple’s Mail.app) where Outlook often has both server-side options and local (depending on what your email provider allows). In general I prefer my filters to reside server-side so that they get processed no matter what app I’m checking mail from.

Creating filters can be a little tricky. It’s handy to keep in mind that filters are applied in the order they are sorted in the overall list. The topmost rules will be applied earlier, so if a message matches more than one rule, it may only be affected by the first (depending on what that rule does).

Screenshot of Gmail filters: Triggers include From, To, Subject, Has the Words, Doesn't Have, Size, and whether the email has an attachment or chat attached.
We can search by a number of different fields and even use advanced search parameters to target the messages we want to filter in Gmail.

When creating filters, look for repetitive data. It’s often handy to have more than one example email to work with as some things may change from one similar email to another. A good place to start filtering is the from address — especially for newsletters, transactional emails, and auto-generated notifications. This address rarely changes from email to email for most companies. (The subject and content are much more volatile.) We can also combine a few fields to get more specific, like an email from a specific address whose subject contains the word “Ticket”. Looking for subjects that contain a word rather than those that match a full phrase is a handy way to make our rule more adaptive. Finally we can also look for emails that don’t contain a certain phrase: for instance, Jira tickets that don’t have our username or name in them.

Once we’ve found suitable data points that match the emails we want to filter (without matching any false positives), we can decide what actions we want to take. These may vary drastically depending on your workflow. I tend to prefer moving any emails that are not directly addressed to me out of my inbox.

Screenshot of actions you can take on a filter in Gmail: Skip the inbox, Mark as read, Star it, Apply a label, Forward it, Delete it, Never send to spam, Always mark as important, Never mark as important, Categorize it, and apply the filter to any matching messages.
Actions we can take on Gmail filters offer a lot of power and flexibility, especially considering we can apply multiple actions on a single filter.

Here’s a few example filters I have:

  • File every message from Jira in a folder named Jira, marking any that don’t include my name or username as read.
  • At work I’m on several different group mailing lists: one for our regional office, one that’s company-wide, and a few others that are project specific. Each of these gets filtered to specific folders. If an email from the local office list contains the word “cake” or “donut” anywhere, it gets flagged and left in the inbox.
  • Filter sales notifications for products I sell to their own label and skip the inbox.
  • Apply a “Family” label to every email that contains the last name of someone from my family (luckily my family name and other close relatives’ last names are fairly uncommon), excluding any of MY personal emails.
  • I also have a slowly-growing filter for companies that don’t respect my attempts to unsubscribe from their emails. Anything from those companies gets marked as read and deleted.

We can get ever more fancy with filters, given enough time and thought. The core tenet, though, is to cull our incoming firehose to only the emails that we actually need to see and respond to. By filtering out the rest appropriately, we can drastically decrease the time we need to spend in email which means more time doing real work.

Now that we’ve handled email, let’s take a look at a couple common design tools: Photoshop and Sketch.

Photoshop automation

Within Photoshop (and possibly other design tools), we can create Actions. Actions let us chain together multiple manipulations to easily reproduce them. One of the most common uses is to chain a bunch of image adjustments and filters to process photos and give them a similar style, but actions can do so much more.

Creating an action

The New Action dialog in Photoshop has 4 fields: Name, Set, Function Key, and Color. Then you create your action by hitting Record.
We can start recording an action just by giving it a name, but Photoshop provides other useful settings to make our action even more handy.

Creating actions is surprisingly easy considering how powerful they can be. To get started, we’ll need to have an example image open to perform our action on. Then:

  1. Find the Actions palette. It may be closed or hidden. If so, it’s under the Windows menu as Actions.
  2. Create a new Action from the bottom of the palette. Look for the icon that looks like a square with the bottom left corner folded up. The folder icon beside it creates a new Action Set (which can store multiple actions).
  3. Give it a name in the dialog that pops up. We can also select which set to place it in, give it a keyboard shortcut, and assign a color to make it stand out in the Actions list.
  4. Then hit record. At this point, go through the motions of what our action will do to process our image.
  5. When we’re done, hit stop at the bottom of the Actions palette.
  6. Voila, we have a new action.

Need some inspiration before creating an action? These 20 Free Photoshop Actions All Designers Must Have are a good starting point.

Batch processing images

Once we’ve created actions, we can quickly manipulate multiple images by using File > Automate > Batch. With this tool, we can run an action on every image in a folder and output the results to a new folder (or even the same folder with new names). This can be very powerful if you want to apply the same effect(s) to a whole series of photos or even create multiple variations of an image. And with Variables (as we’ll see in a bit), we can even change data within an image during batch processing.

The Photoshop Batch dialog lets you choose what action to apply, the location of your source images, where you want to save the updated images, and a few other settings.
The Photoshop Batch dialog looks super complicated (probably because it is very powerful), but once we’ve run it a couple times, we can safely ignore many of the settings.

So how do we batch? Follow these steps:

  1. Go to File > Automate > Batch. This brings up the batch processing dialog window.
  2. Select which Action Set and Action we want to run on the images. Want to run multiple actions as part of a batch? Rather than having to run the batch multiple times (once for each action), we can create a new overarching action in which we run the other actions, effectively nesting them.
  3. Choose the Source folder where our starting images are found.
  4. Check the options for opening that make the most sense for our situation. I typically turn on both Suppress options (Suppress File Open Options Dialogs and Suppress Color Profile Warnings) and set Errors to log to a file. That way, my batch won’t be stopped, and I can do other things while it’s running.
  5. Decide on a Destination. Save and Close will save the images in place (overwriting the original), Folder will let us create new copies of the edited images in another location. I typically recommend Folder as it’s a bit safer in case the action we select does things we don’t want.
Mixing in Variables

Want to make batch processing even more powerful? Enter Variables. With Variables, we can automatically substitute images or text within a Photoshop document to quickly create variations from a set of data. There are three types of variables we can manipulate: Opacity, Text, and Pixel. Opacity relates to the relative transparency of a layer. Text lets us change the content of a Text layer from a set of data. And Pixel lets us substitute one bitmap image with others. With these combinations, we can set up a single Photoshop document as a template and automatically make multiple variations with different text and images.

See more from Adobe on creating data-driven graphics using variables.

Sketch automation

While we can’t record actions and process images in batches in Sketch like we can in Photoshop, there’s still a lot we can do in Sketch to avoid repetitive work and speed up our workflow. First we’ll look at some of the built-in tools, then we’ll take a quick look at some plugins that can automate other work for us.

Use symbols, text and layer styles, and libraries

Using symbols for repetitive elements across our artboards is a great way to automate propagating changes to them quickly. I covered creating symbols and libraries pretty thoroughly in my guide to Sketch symbols a couple years ago.

Similarly, creating text and layer styles for our common visual sets is a very handy way to automatically make changes across a bunch of elements at once. When we need to make a change to a defined style that we’ve used across multiple artboards or pages, we can quickly make the change to one element that has that style and update it to force all the other instances using it to match.

My only caveat with styles as they are currently is that they are mutually exclusive. This means that we can’t apply multiple separate styles to an element, like say, have a heading in a dark color that’s centered. If we want another heading that is white and left-aligned, we would need to create a new text style variation. For now this means that our styles can get pretty bloated with many variations as opposed to using something like design tokens.

Use realistic data

Forget using lorem ipsum and John Doe filler text in our designs. Sketch now has the ability to import text and images from external data sources to prefill symbol overrides. So instead of a single generic name across a set of symbols (or having to change them manually), we can now have more realistic mockups with a whole array of variable data. I’m planning to dive into this in more detail soon, but Sketch’s documentation is a great starting point.

Sketch on the Terminal

Sketch also includes a tool for interacting with Sketch files from the command line interface in Terminal. It’s called sketchtool. (If we want to use it, we’ll likely need to add it to our $PATH first.) Why might we want to access Sketch from the command line? The sketchtool command can speed up batch exports, help us get more detailed data about our Sketch files, and become a small part of a larger script automation. For instance, combined with an app like Hazel, we could watch a folder or file for changes and automatically export specific (or all) artboards with a command line script. Learn more from these handy links:

Plugins for automation

With plugins, we can automate design in Sketch even further. Depending on what we want to do, there’s a good chance we can find a plugin to help automate it. Here are a few I’d recommend to start:

  • Sketch Chart - Create variety of charts automatically from real data.
  • Looper - Duplicate, rotate, scale, and move shapes to quickly create patterns.
  • ImageOptim - Optimize images as you export them.
  • Data Populator - Add meaningful data to mockups using JSON or APIs.
  • InVision Craft - Automate exporting artboards and prototypes to InVision, & importing data from a variety of sources.
  • Sketch Cleaner - Remove unused layers and layer styles and automatically sort layers from top to bottom and left to right on the canvas.

And so much more

This is the tip of the iceberg of things we can do to help automate our workflow. Using tools we already have, we can begin finding ways to skip the tedium, cut down on repetition, and save ourselves work by being mindful of our tools and exploring the options available in more detail. By automating what we can, we’ll save ourselves time and mental energy for the more important and valuable tasks. Want even more automation? Subscribe! I’ll be writing about more tools for automating the design workflow over the coming months.

Like this? Please share: