Resizing Images with Automator into multiple sizes

automatordisplaygraphics

I followed this simple guide to resize images in a batch with Automator:
copy

  1. copy file to resized folder on Desktop
  2. add suffix _S (for small)
  3. resize it to 25% of its original size

First Workflow

Though I want to resize into multiple sizes:

  1. copy file to resized folder on Desktop
  2. add suffix _S (for small)
  3. resize it to 25% of its original size
  4. copy file
  5. add suffix _M (for medium)
  6. resize it to 50% of its original size

Second Workflow

Unfortunately this results in the second resize being applied to the already resized image.

So, is there a way to reset the chain back to the original file and not the resized file?

Best Answer

The easiest way would be to re-order your workflow a bit.

Instead of making the small size first, then the medium size, make the medium size first, then create the small size from the medium.

So your workflow would look like this:

  1. Copy Finder Items to the folder you want
  2. Add Text to append the _M
  3. Scale Images to 50% (if that's the medium size you want)
  4. Copy Finder Items to make the small file
  5. Change the Add Text action to Replace Text, replace _M with _S
  6. Scale Images to 50% (50% of the already scaled image will be 25% of the original)

This is what it should look like: workflow

General Method Using Variables

The above method works well for your particular situation, given the sizes you wanted. But if you need oddball sizes, or are doing some other action where feeding the output of the first task into the second won't work, Automator's variables can be used.

You can use the Set Value of Variable action to store the original input in a variable, then recall it for later use with the Get Value of Variable action.

With this method, your workflow would be:

  1. Set Value of Variable and specify a variable name
  2. Copy Finder Items to the folder you want for the small images
  3. Add Text to append the _S
  4. Scale Images to 25%
  5. Get Value of Variable with Ignore this action's input checked (click the Options button on the action if you don't see this)
    • Make sure the variable selected is the one set in step 1
  6. Copy Finder Items to the folder for medium images
  7. Add Text to append _M
  8. Scale Images to 50%