Try Tuts+ Premium, Get Cash Back!
10 Awesome Uses for Automator Explained

10 Awesome Uses for Automator Explained

Tutorial Details
  • Topics: Automation, Automator
  • Difficulty: Intermediate
  • Estimated Completion Time: 45 Minutes

This post aims to give you a quick look into the potential of Automator by creating some very simple and actually quite handy workflow applications of your own. Many of these applications will take a matter of seconds for you to create, but could save you much more time in the long run. Automator is certainly worth spending some time getting know. I hope creating these basic automations will give you a view at the potential for some much more complicated and incredible time saving automations that can be created.


1. Rename a Group of Photos

We’re going to start off with a fairly simple task. I like to take photos, and I’m not always the best at organizing them. This becomes a bit of a problem after a while. A simple thing (that I often avoid, because I just don’t want to deal with it) to help in the organization would be a simple file naming convention.

For this workflow I’m going to create a folder action. The action will initiate and act upon any files that are dropped into the folder. When you create a new Automator workflow you’ll be asked what type you’d like to create. Choose Folder Action and proceed.

Photo Rename
Photo Rename – pick the Folder option

You’ll be presented with an empty workflow navigator. What I’m looking to do is to give myself the option to change the name of the files and append the date created. I think that should help out with my photo organization.

First, you’ll want to choose the proper folder where this action is assigned to. At the top of the workflow window you’ll see the space to do this.

Every action we’ll need for this one will be filed under Files & Folders. The first thing we need to do is to rename the files. To do this drag the Rename Finder Items over to the workflow window. It’s going ask you whether you’d like to copy the original images or not (do what you’d like…I’m going to choose to copy). The Copy Finder Items action will be automatically added to the beginning of the workflow.

On the Rename Finder Items action select the Make Sequential option. Choose the option for a new name as well. Feel free to customize the other options as you wish.

Next, drag in another Rename Finder Items action. This time select the Add Date or Time option. Adjust the options as you’d like.

Photo Rename Workflow
Photo Rename Workflow

That’s it. Drag a group of photos and drop them into the folder we’ve just assigned this workflow to. You’ll be prompted for the name. That name, along with a number and the date created will now be the name for each photo.


2. Resize a Group of Photos

Following along in the photography vein, this one will quickly enable you to resize a group of photos. We’ll create an application for this one. From the new menu select the Application option

Photo Resize - choose Application template
Photo Resize – choose Application template

We are looking to resize photos here, but let’s think about the actual steps that are going to be involved and walk through our workflow. The first thing we will need to do is to be able to select the photos we want to resize.

Under the the Files & Folders section you’ll see Ask for Finder Items at the top of the list. Drag that action to the workflow window. This will prompt for the files needed. Customize the start point if you’d like and make sure to check the option to Allow Multiple Selection.

I want to keep my original photos and just create copies to resize. To do this add in the Copy Finder Items action to the workflow.

So far we have our photos selected and copied. Next comes the actual guts of this application. Navigate to the Photos section and locate and drag in the Scale Images action. You may select a default size here. What I’ve done is to enable this action to prompt for the size as I would like the option to adjust this setting as needed.

Now the last thing we need to do is find a place to put these resized photos. From the Files & Folders action group, locate and drag in the New Folder action. I’ve also checked the option to prompt for a name here so I can customize this as I see fit.

Photo Resize Workflow
Photo Resize Workflow

One thing I’d like to point out that is very handy to consider when just getting started with Automator, is that you’ll notice triangles connecting these actions together. What one action creates is applied to the next. Not all actions will have this link, but a lot do.

You’ll want to save the application so that you can run it whenever you’d like. I’d suggest a folder within your Applications directory where you can save all your Automator applications. These applications will behave just like any other application. So, for example, you could drag them into your Dock if you’d like just as you could with any other application.


3. Open Multiple Webpages

My thought process here is that I end up often opening up the same group of web pages each morning to start out my day. Why not create an application to open up all those pages all at once. Not a huge time saver, but it’ll save you a few clicks.

Create a new application and navigate to the Internet section of the Library. Drag over the Get Specified URLs into the workflow window. Here you’ll be able to add in the web pages you’d like to load. Next, add in the Display Webpages action and you’re all set. This is the action that actually launches your default browser with the specified URLs.

Starting Webpages Workflow
Starting Webpages Workflow

4. Extract Text from a PDF

This is a pretty straight-forward, yet very handy, use for Automator. It will allow you to pull the text out of a PDF document. We’ll just jump right into building this application.

Open a new Application and navigate to the PDFs Library section. Drag the Extract PDF Text action into the workflow window. You’ll see several options you can set.

Now, you can fully automate this process and make all the selections in advance, or you could check the option to show this action when the workflow runs. With that checked you’ll be prompted with all of these options when you run the application.

Drop a PDF right on your new app to run the workflow. If you picked to be prompted, you’ll see that window, otherwise it will just run.

Extract Text from PDF Workflow
Extract Text from PDF Workflow

5. Archive Files and Folders

This workflow will allow you to pick a file or folder (or both) and create an archive. This could be used to save some space on your hard drive, or maybe you need to zip up some items before attaching them to an email.

Open up a new Automator Application. First, we’ll want the task to ask for what items we’d like archived. To do this we’ll use the Ask for Finder Items under the Files & Folders Library section. Drag that task into the workflow window.

Next, add in the Create Archive from that same section. Notice the two tasks will link together. This indicates that the input from the first action will be acted upon by the second action.

Create Archive
Create Archive

One possible variation to this would be to enable the Create Archive action to prompt when it runs. This will allow you a bit more control in naming the archive file and also to specifiy where it will be saved.


6. Combine PDF Documents

Combining PDF documents isn’t necessarily that difficult to accomplish, but we can create a small Automator application to make it even easier and quicker.

I’m going to create an application that I can run for this workflow. First, we’ll grab the Ask for Finder Items action from the Files & Folders section. Drag that action into the workflow window. This will prompt the user to select the files that we want to combine. You can select the starting point if you’d like.

You’ll want to make sure you select the option to to select Files and also check the box to allow for multiple files. If we’re looking to combine files we’ll need multiple files right? Otherwise, this thing wouldn’t be too effective…

Next we’ll add in the Combine PDF Pages action from the PDF section into the workflow window. This is the piece that actually does the work, and we have the option to either select to append pages or to shuffle them. In this case we’re going to pick to append.

Lastly, add in the Open Finder Items action from the Files & Folders section and leave the default option to open the folder in the default application. This will open the new PDF using your default PDF reader.

Combine PDF Documents Workflow
Combine PDF Documents Workflow

7. Quit All Applications

Sometimes you may get to a point in your work when you realize your workspace is completely cluttered and you’ve lost track of what you have open and what you don’t. It’s time for a fresh start. Wouldn’t it be nice to just quit everything with a click of the mouse? Let’s make a short Automator application to take care of that for us.

This workflow only requires one action. Create a new application and add in the Quit All Applications action located under the Utilities section into the workflow. It is possible to add some applications that will be exceptions and stay open when the application runs. Maybe you want to keep your email client open. Add that application to the list and it will stay open.

Put this application in your Dock and run it whenever you need to refresh!

Quit All Applications Workflow
Quit All Applications Workflow

8. Automatic Backup

If you’re not currently performing regular backups (or even if you are), here is another really simple method for automatically backing up some important items.

This applicaiton will use iCal to trigger the copying of a specified file. Create a new workflow, but this time use the iCal template as a starting point. By using iCal we’re able to trigger this workflow to run based on a calendar entry.

Automatic Backup - Select iCal template
Automatic Backup – Select iCal template

All the actions will come from the Files & Folders section for this workflow. First, add in the Get Specified Items action. Add in the folder you’d like to backup to that action.

Next, add in the Get Folder Contents action. This will grab the files in the folder you’ve selected. The last action you’ll need is the Copy Finder Items action. Select the folder you wish to use as the backup location. For this “backup” action choose a loction on another drive if possible.

Automatic Backup Workflow
Automatic Backup Workflow

When you save the workflow, you’ll be asked to name it. Then iCal will open up and allow you to schedule the action to run automatically. The real power to this workflow is scheduling it as recurring event. I know this still isn’t the most elegant backup solution, but it is automatic and costs nothing other than a few minutes of your time.


9. Create Clipboard to a Text File

When this application runs it will take whatever you have copied to your clipboard and create a new text file with that information in it.

We’ll create a application for this workflow and begin by adding in the Get Contents of Clipboard action from the Utilities section to the workflow window. This will do just as it says, grab the contents of the clipboard.

Next add in the New Text File action. You’ll notice a connection appear with the first action. This means that the information the first action holds will be applied to this action.

I chose to check the option to show the action when it runs. This will allow us to name the text file whatever we’d like and also pick a location to save. If you want to quicken things up a bit more just set these options and don’t show the action when it runs.

Clipboard to Text Workflow
Clipboard to Text Workflow

10. Turn Text into an Audio File

There could be several instances where this may come in handy. This application will take text that has been copied to the clipboard and create an audio file. This will allow you to actually listen to a document, for example. This could be very beneficial for the visually impaired.

Create a new application and locate the Get Contents of Clipboard action under the Text section. Drag that action over into the workflow window. Next drag in the Text to Audio File from this same section.

You’ll see some options for you to customize. You’re able to select the voice that will be reading the text to you. I’m going to check the option to show the action when the workflow runs again so that I can have the ability to name and save each file as I see fit. Again, this is something that can be set, but as you’ve probably noticed I do like a bit of control over my automation!

Clipboard to Speech Workflow
Clipboard to Speech Workflow

Conclusion

I hope this post gave you some nice examples to not only better learn Automator, but also to help improve your current working process and maybe give you some ideas for your own workflows. Automator is a very powerful utility that we all have access to and really should take advantage of.

It is very beneficial to spend some time learning how it works. A bit of time learning the utility and building a handful of workflows could save you immense amounts of time in your day to day work!

I would like to mention that Josh Johnson wrote a more in depth Automatortutorial here on Mac.Appstorm a while back that will take you through all the ins and outs of the utility. It’s an excellent place to start if you are completely new to Automator or just want a bit more information than is provided in this post.

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • http://www.coroflot.com/joshuajohnson Joshua Johnson

    Great article! I love Automator.

    • benj

      ok if u may help me i am a student that needs a bunch of headings done for school and i need auto to type it when i have to so for example i need to write a paper for class and i have to make a heading that looks like this

      my name teacher name my class period

      can u teach me how to do this so that i can hit a button of some sort and make the text show up on the screen

  • Superian

    Great idea ! The automatic backup can be a real nice combo with dropbox by the way : you can have your regular folders with your regular files synced every day at 8 (for me), or twice a day very easily for free.

    I love automator because it really makes the difference when you know how to use it. It’s probably one of the more powerful Mac OS X application ever.

  • netgui

    Great article !

    Is it possible to launch an Automator generated Application by right clicking on an file ? (for instance when you want to resize some picts, you right click on them and then select the resize application) ?

    • Joesph

      yes, that would be a service. Create services and they can display in the right click menu.

      • netgui

        Thx a lot, i will try this one !

  • http://misfitmedia.ca carson

    Thanks for the tips. The first tip however does not ask for a name when you add images to the folder.

    You will have to click options and then check the “show this action when the workflow runs” box.

  • bbluth03

    Thanks for the great article. The “Rename a Group of Photos” example is very useful.

  • http://adrusi.com/ Adrian

    I made a simple automator workflow that automatically prints a file when its put in a folder, I made it as a folder action so it would be called automatically when I put it in the folder. This isn’t any better than sharing your printer over your home network, but you can set it to print the contents of a folder in your dropbox so that you can print from your printer at home wherever you are.

    • http://www.google.com/ Laquisha

      Holy Toledo, so glad I cleikcd on this site first!

  • http://fairheadcreative.com Adam Fairhead

    Automator is one of those things that I’ve always accepted as powerful but never actually used. The more Automator posts I read, the more I think I should go play with it some more!

  • stickan

    Nice tips, i modified the save clipboard to text to name the text file automatically by the date and time variables.

  • Tuomas

    I don’t see the point of having Automator open multiple websites in Safari. Safari has built-in functionality to accomplish this.

    Just place a folder of bookmarks into your bookmarks bar, go to All Bookmarks (the leftmost icon of the bookmarks bar) and check the Auto-Click checkbox for that particular folder.

    Now, when you click the folder in your bookmarks bar, all bookmarks inside that folder open in tabs automatically. You can also open any folder of bookmarks in tabs by selecting Open in Tabs from its menu.

    • Liam

      This would be useful if you set it to open automatically at a time. For example, set it to launch all of the websites at 6am when you wake up… or 6pm when you get home. think outside the box

      • Tuomas

        Ah, that changes everything then. I just immediately thought about this since the scheduling thing wasn’t mentioned. (:

  • Vinay Bhat

    I’m a Windows User and don’t know much about macs, but every day I read this blog it is a step closer for me to make the change.

    Great work guys! and Awesome Article :D

  • http://www.nitropdfcoupon.com/ Nitro PDF Coupon

    Dead great post, thanks for the automation :)

  • cool

    It seems that automation is perfect for automating repetitive tasks, but I am searching a way to batch open all hyperlinks inside a word document in safari tabs and I cannot manage it! It is so a simple task, and I cannot automate it! Can automator help me do this task?

  • Aidan Brian Conway

    i really dont get why we would use automator for some of these things e.g.

    combine pdf’s simply right click on a pdf open in preview, drag other pdf’s into the side bar and then save (done)

    text to speech……system prefs, speech, choost the voice Alex is best, choose speak selected text… and then set a key….i use command shift S. Now all you have to do is select text or a whole document and then command shift s and the mac will read it aloud for you. Every other time all you do is select the text and command shift s (done)

    No automator required.

    • PeterBreis

      That’s what I find odd too!

      Most of the tasks people choose to automate seem pointless to me.

      Yet all the useful stuff you end up hunting forever on the ‘net.

    • elfronto

      All actions explained in here are only simple examples that you can combine to do complexes processus.

      A friend of mine used actions explained here for his project. A photocabine hosts a mac linked to a reflex apn and a thermal printer. When you push a button in the photocabine, Automator takes a picture, reads a text (to make the user wait), it resizes the picture, embed a logo on it, and sends it to an ftp. The same picture is printed to a ticket (with a logo and a reference number that is time – the photocabine have been used only for one day, at an opening -). Once on the ftp, a php script adds randomly this picture on a megapixel fresco displayed with a “Google Maps” system hack.

      The user can now go on the website and search his reference number (that he got on his ticket) to display the picture taken in the photocabine.

      Originally we wanted to print a qr-code on the ticket (via Google Charts API), but we have not had time to do so.

      So ok, you can use actions in mac os to do simples things (no interest)… but the automator’s objective is to create complexes process, like this one.

      You can see the result here : http://www.ultracopains.com/

  • http://Sequentialnumberingdoenstworkin10.5.8 Perry Faciana

    I’m actually having to write an actual applescript on the fly so I can get through image production this weekend. It worked perfectly in 10.4.11, but renaming images sequentially is a failure and I have no reason why. Nor can I find a solution other then applescriting it my self. If you have a solution please contact me, as I’m on deadline for Saturday.

    Perry perroni@cox.net

  • Pingback: Best of AppStorm in January | Programming Blog

  • PeterBreis

    I’ve been unsuccessfully trying to get AppleScript or Automator to batch convert .eps, .ps and .ai files into .pdfs using Preview.

    It has been a frustrating task which I have not conquered mainly due to Preview being unscriptable, dumping conversions into the Documents folder instead of the original folder, and now in Snow Leopard it even strips the name off the opened file replacing it with Untitled.

    I want to use the PSNormalizer.framework in Preview because of its superior results over the usual Unix scripts that are available.

    Could you please offer some guidance as to how to beat this?

    I and thousands of graphic designers would be eternally grateful.

  • Donny

    My “go-to” Automator is a service that allows me to attach any file to my Outlook email. I work in a PC-laden world which requires me to use Outlook for my email service. However, I prefer using iWork for the assignments in my work. It would be great to directly email my iWork files using Outlook the way iWork does with Mail (or Office does with Outlook). Instead I created a “service” that me to generate an email with any file as an attachment.

    Under “Mail” – select “Create New Outlook Mail Message” and then “Add Attachments to Outlook Messages” and save.

    Now I can “right click” with the option to “Attach to Outook” for any file in my Finder.

  • Pingback: Use the Automator to Extract a list of Filenames to a Txt file « Leala Abbott

  • Pingback: Enlaces interesantes recopilados | Vectoralia | Vectoralia

  • Bob

    Just discovered Automator and maybe a project if I new how to go about it.

    I would like my MacBook Pro to autonomously record webinars at a certain time when I’m not at home. I don’t have access to remotes. The webinars are about 1 1/2 hours.

    Could someone talk me thru it? Thanks in advance

  • Marcia

    I had an automator action on my old computer that I want on my new computer. It did this

    If I opened a zip file from download window it automatically did 2 things filed my zip file into a zip folder AND put the extracted file in a folder that I named “Newly downloaded”

    But now I’ve lost the directions for how I set that up. Can you help me?

  • Edwin

    Thanks, but I’ve got a problem…

    I followed the ‘Resize photos’ tutorial, and I believe I did it exactly as you put it here, but when I run it, I get the following error from Automator:

    2011-12-10 20:03:10 +0000: Error 4: no file was specified

  • http://nohaybronca.wordpress.com/ TC

    Thanks for the info. Great post.

    I have one question. I set up the application to extract text from PDFs but I get nothing. I am using PDFs with text in Spanish – does that make a difference?

    • TC

      I’m a dumbass. My files are JPG, not PDF.

      Are there mac applications that extract text from JPGs?

      Thanks again.

      • True Dee

        Not sure if this will work. There is a “New PDF from Images” option. So, maybe you could first create a PDF from the JPG then “Extract text from PDF.”

  • Pingback: Macs built in file renamer…

  • Bold_Sue

    Good article. I use Automator all the time to rename my photos prior to loading them into iPhoto. My method is different than yours. When I have a new batch of photos, I make a new folder under “Pictures” and name it “YYYY-MM-DD xxEventxx”, then I plug in my SD card and copy the new photos into the folder I just created. Next I drag these same photos into Automator/Workflow & select “Rename Finder Items”/Don’t Add/Add Text/Before name. For the text, I always copy/paste in the name of the parent folder I created “YYYY-MM-DD xxEventxx” plus I add an underscore. The result I get is “YYYY-MM-DD xxEventxx_IMG_nnnn”. Since the images are already sequentially numbered, I don’t change the number. I would like to make a service to perform this function directly from Finder against a selection of files but I don’t know how to define to automator to get the name of the parent folder. I tried this “..*.*”+_ ?????? meaning from the location (1st period) of my selected file, go up a level in the directory structure (2nd period), copy the parent folder’s name (*.*), add the underscore (+_) then did a cmd-s to save this new service. When I tested it by selecting a photo, my new service was there and when I tried to execute it against my photo, the photo disappeared or went somewhere without its original name as I can no longer find it. Is there a command I can put in to do this function?

  • Susan Prescott

    Hello,

    I am trying to set up a home photo booth to run automatically. I have photobooth and automator but was not able to follow directions I found to make a workflow.

    Can you help with writing a workflow example?

  • Pingback: How to open a Mac OS X application with command line arguments | The λ♥[love] Blog

  • http://commercialrealestate41865.beautylush.com/2012/05/value-of-a-detailed-real-estate-property-appraisal/ commercial property values

    Youre so awesome, man! I cant believe I missed this blog for so long. Its just great stuff all round. Your design, man…too amazing! I cant wait to read what youve got next. I love everything that youre saying and want more, more, MORE! Keep this up, man! Its just too good.

  • tom

    Seemed really keen until I started adding up all of the preceious disk space this thing will eat up….

  • Pingback: My Five: Top Digital Humanities Tools from Mitch Fraas – Apps On Tap

  • Ayushman Anand

    NICE

  • a

    shell scripting > mac automator