Tutorial: Automator Basics
In case you haven’t heard, Automator rules. Automator is the often under-appreciated and underestimated automation tool, provided by Apple in Mac OS X 10.4 Tiger, to bring the power of automation to users with no need for programming. In this simple tutorial I’ll show you the basics of Automator and walk you through a simple Backup application example. This should give you the solid foundation to start making useful actions for yourself.
The Basics of Automator
First, load the Automator editor application located in the Applications folder. On the upper-left hand side of the Automator window you will notice the Library pane which lists the applications on your system that are supported by Automator. If you don’t see your favorite App in this window write the author of the software, only they can add Automator support. Just to the left of the library pane is the Actions pane which lists the available actions for a selected application. These two windows act as your toolbox while making an Automator action. Naturally there is also a search field to quickly find an action without needing to select a specific target application. Below these two panes is the Action Description pane. Here you can find important information about different actions like what sort of “Input” it expects, what “Result” it returns and any other requirements.
This concept may be familiar if you have any experience with the programming concept of “protocol”, if you you are unfamiliar don’t fret! It’s not that hard, I promise. Every Automator action expects a certain “type” of input. For example the iTunes action “Add Songs to Playlist” expects “Songs” as the input, naturally if you sent this action a text file, an email address and a sandwich it would be unable to add them to a playlist. In return for you giving an action what it expects it “promises” to consistently return a certain type of response or “Result”. These Results can often be passed into other actions making a sequence of events that does something useful for you.
To the right side of the Automator window is the Workflow pane. Here you place Actions which will occur one by one from top to bottom. Actions can be placed into the Workflow by either dragging an action to the Workflow pane or by double-clicking on an action.
The toolbar also contains two buttons you’ll be using a lot, the Run (Command R) and Stop (Command .).
Instant Backup Automator Action
This is a handy little Automator action I use all the time on projects or assignments where I’m experimenting with a file (usually code) enough that “Undo” won’t suffice and setting up a version control system feels over-kill. This action when placed in the dock will make a copy of whatever file or folder you have selected in the Finder and conveniently append a date-stamp onto the name of the copy. Please keep in mind that the following example is definitely not the only way and likely not the best way of backing up your files, so while you’re working through the tutorial think of how you would do it better and go ahead and give it a try.
The first step of this workflow involves letting Automator know which file(s) you wish to deal with. For this example we’ll simply tell Automator to make a back up of the file (or folder) that is currently selected in the Finder. To do this you will want to find the “Get Selected Finder Items” action by selecting Finder in the library pane and dragging “Get Selected Finder Items” to the work flow window.

Next we will want to copy the file to your backup destination. I’ve created a “Backup” folder in my home directory (the directory named with your user name) in which to place the backed up files. The Action that will do this for us is called “Copy Finder Items”, lets try using the search to find it this time. Drag the action to the workflow pane and take a look at the action “bubble” you’ve created. You will notice that unlike the “Get Selected Items” action this one contains some further controls. In the “To:” drop-down menu I will select my Backup folder. If you choose to place your files elsewhere please change the “To:” destination directory accordingly. There is another option here to replace existing files in the destination directory if they have the same name. I would not recommend you check this box, it will erase similarly named files without asking. If you leave the replace check box unchecked when there is another file sharing the same name the Finder will rename the new file to prevent a collision.

Rename your Backup
Although this action is pretty good already, when I’m making many revisions and changes to a file I like to keep track in the file name that it is a backup and the time and date the backup was created. We can do this very simply with Automator.

First I’d like to append onto the file name the suffix “_Backup” to remind me I’m looking at a backed up file. The action we will use to add this suffix, date and time is the “Rename Finder Items” action. As we will use this same action three times in a row go ahead and add three of them to the work flow.
To append the text suffix focus on the first of the three “Rename Finder Items” actions. From the action’s drop-down menu select “Add Text”. In the “Add:” text field type “_Backup”. I preceded the word “Backup” with an underscore, “_”, so the title is easier to read. Set the next drop-down menu to “after name”, this will make the text act as a suffix to the prior name rather than a prefix. Mac OS X recognizes when there is a file extension visible at the end of the file name (.mov, .pdf, etc.) and will append your text between the file name and the file extension.

To add the time of day you created the backup you will edit the second “Rename Finder Items” action that you added. This time you will set the first drop-down menu to “Add Date or Time”. Because I want to see when I made this backup rather than when it was last modified I select “Current” from the “Date/Time:” drop down menu. The “Format:” drop-down menu will be the only difference between adding the time and the date, here we will choose “Hour Minute”. Again the we will want to add the text after the name by selecting “After name”. You can choose whichever “Separator:” drop-down selections you find easiest to read for the next two options, I’ve chosen “Dash” and “Underscore”. You can also enable the use of leading zeroes with the final check box. For example, with leading zeros, eight o’clock and one minute in the morning will read 08-01 rather than 8-1, it’s a matter of personal preference.

Finally to add the date to the third “Rename Finder Items” action, do the same as you did for time in the second “Rename Finder Items” action but select the “Format:” drop-down menu option “Day Month Year” instead of “Hour Minute”.

Finishing Up
Now would be a great time to save your work, this can be done by pressing Command-S or by selecting Save from the File Menu. In the save window you will notice a “File Format:” drop-down, this gives you the choice of saving as a Workflow or an Application. For our example we’ll choose to save an Application. As an Application your Automator action can be double clicked in the Finder and be activated. I would recommend you save your new Automator action “application” to your Applications folder for easy access. A cool little feature of these Automator action applications is that unlike a complied Application built in Xcode you can just drop your creation or one you downloaded that you want to learn from onto Automator to examine and edit its workflow.

We’re on the home stretch now, you’ve got a working Automator action but… what to do with it? If you double click on it now you will likely just end up with a backup of your Automator action application in your backup destination (remember it’s setup to backup Finder’s current selection). I think an excellent solution would be to drag your Automator Application to the dock so you can access it anytime from the Finder. Now select the file you wish to backup, click on the your application in the dock and like magic you’ve got a dated backup!
The Future of Automator
Rest assured, your new little robot friend, Automator, will not be disappearing with the release of Mac OS X 10.5 Leopard. In fact Apple is adding many very helpful enhancements to Automator in Leopard that will make the automation process even easier. According to the public WWDC course page, actions will no longer be just scriptable but also recordable in Leopard, that’s really exciting. I can assure you there are other neat things in the works and can’t wait until we can all get our hands on the Leopard version of Automator. Until then, happy Automating!





Very nice tutorial! I have never really gotten into Automator, not sure why exactly, but this is a great walkthrough and certainly makes it more appealing to try out for all sorts of things
Does the backup workflow you provided make updated (meaning it only adds modified files after the first backup) backups?
[...] Automator Basics [...]
Keep posting more workflows; Automator rocks!!
[...] — cogiddo @ 10:29 pm Using the Automator. Thanks to Lifehacker, for bringing me this link. I will study it tomorrow, as I can really use a simple version control system and don’t feel [...]
I’ve found it to be most useful when saved as a Finder plugin. This way I can just right-click on a folder or file, select Automater->BackUp my data is archived. Thanks for the great tutorial.
[...] The backup methods used are very similar to my simple version control system for Windows, but this Mac solution takes advantage of the much-maligned/beloved Automator. Not only is this a useful versioning method, but the post also serves as a nice introduction to Automator. MacApper [...]
Mason:
No, this action will make a copy of any files you select, even if they have not changed since your last ‘backup’.
Maybe with Leopard, we can make use of Time Machine as ‘subversion for the rest of us’ (and maybe some of the new features in Automator 10.5 will help this process)
One suggestion I have would be to make the versioned file name in the order:
XXXX_Backup_YYYY-MM-DDTHHMM
(this is based on the standard ISO 8601)
The ‘T’ is based on the standard but it’s not crucial, just make sure you use leading zeros on all numbers and use the 24-hr clock.
This way, all your like-named files will be chronological when sorted alphabetically
Filename_backup_2007-06-01T1403
Filename_backup_2007-06-01T1407
Other File_backup_2007-05-30T0743
Other File_backup_2007-05-31T0918
If you would rather have all files chronological regardless of content, the YYYY-MM-DDTHHMM can go at the start, I use a combination of both systems for different purposes – Date/Time at the start for time specific files (business expense receipts etc.) and Date/Time at the end for content specific files and versioning (this keeps like-named files together)
This dating system works without the dashes but they make the filenames easier to read (and to make Smart Folders with – Name contains “2007-06″ for a Smart Folder with all June 2007 files)
[...] The backup methods used are very similar to my simple version control system for Windows, but this Mac solution takes advantage of the much-maligned/beloved Automator. Not only is this a useful versioning method, but the post also serves as a nice introduction to Automator. MacApper [...]
[...] Tutorial: Automator Basics | MacApper [...]
[...] Tutorial: Automator Basics | MacApper aprenda a usar o Automator (tags: automator osx mac tutorial howto Apple backup) [...]
[...] Tutorial: Automator Basics | MacApper aprenda a usar o Automator (tags: automator osx mac tutorial howto Apple backup) [...]
I can’t get this to work! “Data Conversion failed” is in the log. Any ideas?
[...] It’s good to note that Apple’s Automator Actions download page has a wide selection of useful Automator Actions to add to Automator this way. If you feel like what you’re seeing here is a bit over your head please go and check out the Automator Basics Tutorial. [...]
Thanks for posting this, it was a big help!
I discovered Automator when trying to find a free way to turn iTunes into an alarm clock and from that day on I’ve used it a lot.
The recording feature in Leopard is cool but not as cool as I would have liked it to be. It’s the equivalent to ScriptIT on Windows but I was hoping more for something like ZenWorks on Novell which is so much better.
That being said though it means anything can be scripted including closing down applications. The trade off is that it isn’t pretty as it picks up movement so your cursor will go all over the place which looks untidy, but then ScriptIT on Windows is similar.
How does one set up to trigger a workflow with a keyboard shortcut? thanks. nice tutorial
how do we know that an application supports automator?
[...] hat ein Tutorial zu QuartzComposer veröffentlicht. Teil 2 folgt. Auch die Automator-Tutorials sind zu [...]
Automator somehow got turned on and I don’t want it. It happened like this. I clicked on Fetch and Automator opened. I closed Automator and it still opened when I clicked on Fetch. Now I don’t know how to get to Fetch to upload something to my website. Darned automator. Tell me how I can close it so that Fetch opens like it is supposed to. I need help with this today.
I watched a tutorial on Youtube yesterday and found out how to rename a large number of photos quickly. So that was great. The pictures were all renamed but I noticed that that the date when they were made was not in order like in the original ones from the camera.
Has anyone had the same problem?
Hi, How do I make a workflow on automator that opens up a web page, then refreshes the webpage every 2 minutes. It then tells me if anything changes on that webpage.
Thanks,
David
Well I have found Automator both awesome and very limited.
I am trying to copy / replace icons that live in the core folder …… well so far I haven’t found a way to do this. I know there is a way as I can make a installer package and it will install a whole theme …. I want to be able to make a drag and drop icon changer ….
my problem is linking one action to a shell script ….
I need to be able to use the CP action in the shell script but I can’t seem to figure out how to tell the script to use the input item as the source for the script.
Automator is cool ….. but dont give it too much credit yet….. you guys are just playing with the user friendly functions….. when it comes to business …. it lacks alot of functions.
How had would it have been for apple to include “with adminitrative rights”
to the copy replace action ?
if any one knows the answer to my week old headache please email me .
Ducati9595fx@aol.com
I am fairly new to automator, is it possible to scrape web sites etc and automate tasks like in iMacros ?
Btw, what are the best tutorials for automator ?
CAN AUTOMATOR SYNCHRONIZE DATA ON SEVERAL HARD DISKS ?
HI, I am also very new in the world of Mac and very excited about Automator potential.
Chris
I would really like to implement the following : synchronize the data stored on various HD. Indeed, I have McBook + a desktop PC + a Time Capsule and my purpose is tthe following : whatever is the computer I work from to modify or create a file (ex : desktop PC), I want this modification to be reported accordingly onto the Time Capsule HD… and then, via an smart synchro, be reported onto the other computer HD (onto my MacBook in the current example).
Nota : In parallel to that, I use Time Machine to make sure I have a back-up containing the ‘historical” versions. So my question on Automator is really relatd to synchronizing the content of data stored on various HD.
Thanks in advance for your help, guys
I really wish Windows had a tool like Automator.
Perhaps it’s time I really bit the bullet and got a Mac
I will give this a try! Thank’s for this info!
Mac have a lot of great application, I’ll try having one..
[...] Tutorial: Automator Basics | MacApper [...]
Hi Guys, I just found a pretty nice site for a free iphone unlock / jailbreak/ iphone 3g 3gs and iphone4 jailbreak.
http://www.anysim.net
http://www.bmw-eba.de.tl
You definitely know how to bring an issue to light and make it important. I cant believe youre not more popular because you definitely have the gift.
<a href="http://www.hatsnewera.com" title="Wholesale Hats New era">Wholesale Hats New era</a>
<a href="http://www.hatsnewera.com" title="Cheap New Era Hats">Wholesale Hats New era</a>
<a href="http://www.hatsnewera.com" title="New Era 59fifty Hats">Wholesale Hats New era</a>
thanks for your sharing ,i like it,it’s so intersting
Like the Bailey Button, the Ugg bailey button boot met logo chestnut is a tall boot made from genuine twin-face sheepskin. We’ve updated this traditional style with three wooden UGG® logo buttons and elastic band closure. The Ugg bailey button fancy boot can either be worn up or cuffed down adding a little variety depending on your style.
10. 4Make4 the most of Social Media – Begin networking first on Linkedin, Fb, Myspace, or any web 2.zero destination that connects you to individuals with comparable interests. Start building up your contacts/associates listing, and construct up your relationship with these people. As soon as you’re feeling comfy, invite them to hitch a networking event with you. This may increasingly help the lessen any intimidation you may feel of going it alone.