Filed under: Features, How-tos
Mac Automation: Automator for Leopard
A few people commented on my first Mac Automation post that they didn't understand Automator. This post will clear that all up.AppleScript is very powerful, but it has a learning curve. When Apple set out to make Automator, they tried to make an automation environment that not only gave the user flexibility, but also power. Apple includes several actions that programs can use; they also include a plug-in type model for developers of Mac software to add even more actions.

The area in red is where the actions are located. These actions are what you link together to make a workflow. The area in blue is the workflow area. This area allows you to place your actions in the correct order to make a useful workflow. The yellow area gives you the information about the currently selected action; such as what it will accomplish and what action is needed before or after it.
Now let's try making a work flow of our own. Launch Automator and find the following actions:
- Take Video Snapshot
- Import Files into iPhoto
Next, drag the "Import Files into iPhoto" action into the work flow. Notice how the two actions are joined together by a little tab in the center (this means they are compatible actions). Select "New Album" from the drop-down box and name the label using the adjacent text box.
Once you have all the actions in place, click the Run button in the top right corner of the application window. The actions will run, producing a new iPhoto album with a snapshot from your iSight camera. And you've just created your very first Automator workflow.
This small workflow shows you the true potential of Automator -- whether for work (or play).

![TUAW [Cafepress]](http://www.blogsmithmedia.com/www.tuaw.com/media/tuaw-cafepress-promo.png)


Reader Comments (Page 1 of 2)
Desmond said 8:12AM on 12-19-2007
I LOVE automator - it was a great addition to Tiger and I was quite excited to try the Robot's new features in Leopard. But what is probably my favorite workflow (a file rename and commenting workflow I put together) is BROKEN in Leopard. I've seen lots of postings on the "file rename" bug in Leopard. I used it a lot for renaming digital photos that I would import from my camera - give them some good names and comments rather than the generic CMGxxxx.jpg.
If anybody has a fix, I'd appreciate it - this is really a big setback for an application that is otherwise a huge help.
Reply
Tim said 9:56AM on 12-18-2007
Good basics; does any body know why leopard broke my old automator actions? I have one set up to batch rename files, and one to set image to desktop picture, all saved as finder plugin.
None of these, including the Zap! one from AppZapper, works. Other than the rename one, which only runs with default setting (thus making it quite useless), all of them apparently does nothing at all when they are ran from finder. Strangely enough if I go open them in automator they seem to work again.
So now I can't really run them without open automator first, this seems positively broken to me.
Reply
bender said 10:08AM on 12-18-2007
I've been waiting for a tut on automator/apple script...please keep them coming.
reckless ronin said 10:47AM on 12-18-2007
I have problems with Automator batch renaming in Leopard too. I have a series of photos, about 60 or so of them that I was trying to batch rename. Granted it renames them, but it changes the order of the files randomly. So when I rename from yy2.jpg to photo-02.jpg, it might end up as photo-57.jpg. I also tried changing the sort order of the photos to alphabetical the in Automator workflow but no dice. It used to work fine in Tiger.
Luigi said 1:38PM on 12-18-2007
same problem here..
My plug-ins stopped working (batch rename & app zapper)
And I really need the batch rename one.. I use it every day (almost)
Luigi
rscow said 1:50PM on 12-18-2007
I had the same problem with a Batch Rename workflow. When I installed 10.5 it didn't work anymore. I opened it in Automator, and was prompted to switch one of the actions with a new, Leopard, one. I did this, but the workflow still doesn't work.
Reply
Johannes Wierny said 10:15AM on 12-18-2007
Great work Cory!
Keep on wrting. Give us normal mac users more of this automator stuff. :-) I think it is a good thing to get ideas about what to do with the animator.
Reply
Rob said 10:23AM on 12-18-2007
I just don't see how any of these actions are useful. Why would I open automator to import pictures into iPhoto when all I have to do is drag the photos onto the iPhoto icon? I seems to me all the actions in Automator will take longer than the original action.
Reply
Bart Lee said 10:38AM on 12-18-2007
That's the whole point Rob. Once you build the action in automator, you don't need to open anything, even iPhoto. You can have it run automatically at a certain time of day, or attach it to a folder. For instance, I have a folder set up for a client of mine who sends me hundreds of pictures to post on their website every week or so. When I save the pictures to that folder, the Automator action automatically renames the images, stripping out all the spaces and capital letters, and resizes the images. Saves me a TON of time.
Johnny said 10:31AM on 12-18-2007
Automator is very limited IMO compared to straight AppleScript. I find it more frustrating than helpful if you know all the other things you could do. For beginners, though, I guess it is helpful since you don't have to learn the syntax, etc.
Reply
Sajid said 4:40PM on 12-18-2007
I don't think some of the people understand the power of the automator. Yes you can drop photos on Iphoto. Can you rename 10,000 files. Can you do some other repetitive stuff requiring much more steps and for a huge number of files. I guess the answer is no.
What cory has done here, is just a guide and serves only as an idea to what can be achieved with the automator.
Cory, Keep up the good work and keep empowering an average mac user.
Reply
williamlane said 11:08AM on 12-18-2007
OK, so I constructed the work flow following the instructions. I now have the Buddy Picture editing dialog box in the middle of the screen and I can see Automator running in the background with the swirling 'Running - Take Video Snapshot' swirling away at the bottom. So far, no result after about 5 minutes. ???
While I really think Automator SHOULD be a time saver I've never had any success getting it to work the way I thought it should.
Reply
williamlane said 11:08AM on 12-18-2007
Oh, and on returning to Automator now, I cannot Stop the action.
Sigh.
Reply
williamlane said 4:08PM on 12-18-2007
So, I Force Quit Automator. Restart Automator. Thinking 'why would I do 'video' and then add it to iPhoto, I decide to take one last try at creating my own work flow. So....
First action - Take Screenshot (which brings up another question. Why can I not save this screenshot anywhere but to the clipboard? Automator provides a n option to do so, but no matter what destination I try to choose they are all greyed out).
Second action - Import Photos into iPhoto
'Ah HA!' I think, 'Success! The work flow runs!'
Or not.....
In iPhoto 08 I see it creates a new Album, identified by the name I chose (Automator test) but, on checking in the Album..... NO content, at all. None. So, where DID my screenshot go?
This, sadly, is indicative of my experience with Automator. At one point I had planned (in my role at that time as the President of our local MUG) to do a session on Automator. Despite spending WAY too much time playing with it, posting to the Apple Discussions etc etc I never did develop the confidence in the app to feel confident about presenting to others.
I am still hopeful that at some point Automator begins to cooperate, or the light bulb goes on for me in an 'ah ha!' moment but so far, this has not occurred.
Reply
Cory Bohon said 3:40PM on 12-18-2007
Did you make sure to save the image to the desktop AND click "take picture automatically"? If you didn't click the "take picture automatically" checkbox, then the computer is waiting on you to take the picture... therefore automator will sit there and do nothing (except spin the gear).
Lee H. Stites said 11:19AM on 12-18-2007
Great tut, but I have a question: I have set up a workflow to add spotlight comments to my files and it works great, but there are several file types missing. For example, there are InDesign and PhotoShop presets but none for Illustrator or EPS. Is there a way to add presets?
I do have Illustrator installed on my system if that is what it is looking at to get the presets.
Any ideas?
Reply
Taxman said 11:54AM on 12-18-2007
Does anyone know how to create an Automator workflow to encrypt and then mail a pdf file? I tried setting one up but for some reason it does not appear to be encrypting the file because after the workflow runs and saves the file to a new message, I am able to double click the pdf attachment and it opens right up. It does not prompt for a password.
Thanks in advance.
Reply
Just_a_guy said 1:47PM on 12-18-2007
could it have to do with the fact that you are already authorized to read the encrypted file?
Reply
XKCD said 2:29PM on 12-18-2007
I've used automator pretty extensively but have not found an action that will enable me to automatically start a workflow by simply quitting an application or some other user action (not clicking 'continue' in a dialogue). eg: when I play Halo I change the mouse settings so that I don't accidentally activate Dashboard or Expose mid-game, but when I quit I have to go to System Prefs and change them back. I want an action that will start my workflow whenever it senses that I have quit Halo. Is there such a thing? Please say yes...
Reply
Sabon said 3:34PM on 12-18-2007
I never thought of setting up automater for doing this for games. I have a few that use the Mac system settings for mice instead of having something in the game. I have to try to remember to change the settings before running the game then change them back.