Skip to Content

Submit your nominations for the Luxist Awards' Best in Decor
AOL Tech

MacAutomation posts

Filed under: AppleScript, Snow Leopard

Snow Leopard offers more Automator "purrfection"



If you know me, then you know that I love Automator and scripting things on the Mac. I believe that Automator should be something that everyone can take advantage of, not just the select few that already know how to use it well. That's why I've been working on the TUAW Mac Automation and AppleScript series for over a year now (we're going to have more coming soon, so stay tuned).

I was watching the WWDC '09 keynote, desperately waiting to see if anything new was announced for Mac OS X 10.6 Snow Leopard in regards to automation, and specifically Automator.app. Nothing was said at the keynote, but when I looked on the newly updated Snow Leopard page on Apple's site, I was ecstatic. One of the refinements listed was that Mac OS X Services would now be a feature of Automator. Services let you use features of one application while you are inside of another. In the Automator instance, you would be able to use workflows while you are inside of any Mac OS X application that supports the use of Services.

In addition to updating Automator for Services, Apple has also added more starting points for workflows. You can now choose between a standard workflow, application, service, folder action, print plugin, iCal alarm, or an image capture plugin. We will have more information about Automator and Services in Snow Leopard when it launches in September.

Filed under: Features, How-tos

Mac Automation: Make your text speak its mind


Have you ever wanted to type something into your Mac and have it record what you typed audibly using any one of the Mac OS X voices? It's easily done with a few Automator actions, and in this Mac Automation post, I'll show you how.

Open Automator and find the following actions, then drag them to the workflow area (in the same order):
  • Get Specified Text
  • Text to Audio File

Running the workflow
With these two actions in place, you can enter text into the Get Specified Text action, and a file name in the Text to Audio File action, and run it with great results. The text that you enter will be magically encoded into audio using the specified voice in the audio file action.

Read on to learn more about saving the workflow, and adding additional options.

Continue readingMac Automation: Make your text speak its mind

Filed under: Features, How-tos, AppleScript

Mac Automation: Integrating Spotlight searches with your workflows

We've discussed some pretty neat uses for Automator workflows in the past, but did you know you can easily integrate Spotlight searches into your automation workflows? Well, you can, and it might be easier than you think. In this Mac Automation post, I'm going to show you how you can integrate it into a workflow that will burn the resulting files to a CD or DVD.

Creating the workflow
To create this simple workflow, you'll need to use two actions. Find the "Spotlight" action and drag it to your workflow section; then, find the "Burn a Disc" action and drag it below the newly added Spotlight action. That's it; your workflow is now completed, but we need to tweak the actions.

Using the workflow
To test the workflow, you can enter a search term in the Spotlight action, and a Disc name in the Burn a Disc action. Insert a rewritable disc, or a regular CD/DVD, and click the "Run" button in the upper right corner of the Automator window. Automator will then go to work finding all of the search terms that matched files, then will then burn all found items to the disc. This could take a while to burn, depending on the resulting files.

Remember that all of the Spotlight tricks, such as exclusion, denoting kind, etc. are still available even though you're using the Automator action.

Continue readingMac Automation: Integrating Spotlight searches with your workflows

Filed under: Features, AppleScript

AppleScript: Exploring the power of Folder Actions, part II

In the last AppleScript post, I mentioned some of the useful ways to create Folder Actions, and showed you how to use one of the built-in scripts to perform a pretty useful action. In this AppleScript post, we'll dive into the built-in scripts in more detail, and I will tell you how each of them works.

Once you create a new folder action (as we did in the last tutorial), you will have a pop-up dialog asking if you would like to attach an Apple-created script. There should be around 13 preinstalled on your Mac. Now let's go through each of them, and see what they will do when attached:

Add-new item alert.scpt - This included script, which we covered in the last post, allows you to get a pop-up dialog upon dropping files in the attached folder. So, if you were to drop file x into the folder, a dialog would display a message that file x was just dropped in there. This script is great for networked folders, as you get a dialog when someone drops something in there.

Close-close sub-folders.scpt - This script will, when a file is dropped in the attached folder, close all opened Finder windows associated with that folder and subfolders. So, if you have that folder opened, or another subfolder within that folder, when you drop a file into it the script will close those opened Finder windows. You can use this script to tidy up your screen.

Convert-PostScript to PDF.scpt - If you have a PostScript file type (i.e. eps or ps files), then you can enable this folder action. When you drop a PostScript file on it there will be two folders created, one called "Original" and the other called "PDF." This folder action will take those PS files and turn them into PDFs for your instant viewing pleasure. You can use it in your workflow to easily convert from PS to PDF.

Read on to learn about even more built-in folder action scripts.

Continue readingAppleScript: Exploring the power of Folder Actions, part II

Filed under: Features, AppleScript

AppleScript: Exploring the power of Folder Actions, part I

Welcome to Part I of this mini AppleScript feature on creating useful folder actions. We'll have more posts on this topic coming up, but for now, let's introduce what a folder action is. Have you ever wanted to just drop a file into a folder and have something magically happen? Say, have a file printed, whisked to a remote site via FTP, or perhaps have an image be automatically flipped from horizontal to vertical? With Mac OS X's built-in folder actions, you can easily do this with a simple drag and drop.

Creating the folder
First, let's talk about how we can enable these "magical folders" that perform actions on files dropped within them. For this example, I'll show you how to make a folder on your desktop that, when a file gets dropped into it, will display a dialog letting your know that the file was placed there.

Continue readingAppleScript: Exploring the power of Folder Actions, part I

Filed under: Features, How-tos

Mac Automation: Looping Workflows

Sometimes when working with Automator, you might want a workflow to loop (or go back to the first step and continue to run through the workflow). Automator includes an easy-to-use "Loop" action, and in this Mac Automation post, I'm going to show you how to use it.

Let's take a previous workflow that I wrote about: iCal to-dos. In this how-to, we got iCal to-dos sent to your mobile device via a simple workflow and e-mail. The method that I wrote about required you to send an email (and rely on mail rules) in order to retrieve your to-dos. However, with the looping action in Automator, you can easily automate this process.

Let's first build out the workflow by placing the following actions together (in the same order):
  • Find Calendars In iCal
  • New Mail Message
  • Send Outgoing Messages
  • Pause
Continue reading to learn more about the loop action.

Continue readingMac Automation: Looping Workflows

Filed under: Features, How-tos

Mac Automation: Creating Watch Me Do workflows

Do you want to use Automator's powerful features, but don't want to worry with "programming" the usefulness each and every time you wish to perform an action? With Automator for Leopard, you have the ability to easily record mouse moves/clicks and keyboard input with a feature called "Watch Me Do."

Initial Setup
Before using this Automator feature, you will need to turn on "Access for assistive devices." So head over to System Preferences > Universal Access. Make sure the checkbox is checked beside "Enable access for assistive devices." This allows Automator to control your mouse and keyboard movements/clicks/key presses. Watch Me Do will not work unless this box is checked.

Recording an Action in Automator
You are now ready to start recording your first Watch Me Do action in Automator. This feature gives Automator additional functionality if a prebuilt action is not readily available. So, before you go creating your own Watch Me Do action, look through the action list to make sure the functionality doesn't already exist.

When you are ready to record, press the "Record" button in the top-right corner of the window. The main Automator window will disappear, and you will see a heads-up display on the screen showing that Automator is recording; this display will also have a stop button -- when you are done recording your actions, you press this to return to the main Automator window. While recording, any mouse movements/clicks and key presses will be captured and added to your workflow.



Managing your recorded events
Each time you click, press a key, or move the mouse, you create an "event." Once you have recorded your Watch Me Do actions, you can reorder the specific events of the action. Just click and drag in the "Events" section. Be careful though, as some rearrangements can render the action workflow useless (i.e. reordering a click of a button before a specific dialog is displayed).

In the Watch Me Do action, you can also select a Timeout in seconds, and set the playback speed. Before changing these settings, note the defaults: Timeout is set to 0 seconds, and Playback Speed is set to 1x.

Read on to learn about running, saving, and get some tips about recording.

Continue readingMac Automation: Creating Watch Me Do workflows

Filed under: Features, How-tos

Mac Automation: Rename multiple files efficiently

With Automator, you can easily streamline common tasks. If you work with many files (i.e. pictures), then you know how easy it is to lose track because of incorrectly named files. With this Automator workflow, you'll never lose your place (or a file) again.

Building the Workflow
To create this workflow, simply add the following Automator actions (in the same order):

  • Get Specified Finder Items
  • Rename Finder Items

When you add the "Rename Finder Items" action to your workflow, Automator will ask if you want to copy the files so you don't mess with the originals. Choose "Don't Add."

Configuring the Workflow
In the "Rename Finder Items" action, you have almost unlimited choices for renaming schemes. To get started, select a scheme from the first drop-down box. You can choose from: Add Date or time, Add Text, Change Case, Make Sequential, Replace Text, Name Single Item.

Once you select your renaming scheme, choose the options you want based on the scheme. For instance, if you wanted the "Make Sequential" scheme, you could choose to use existing naming, or create a new name. You can also select options for where to place the numbers, which number to start counting from, and how to separate the number from the rest of the text.

Running the Workflow
Once you have your naming scheme figured out, it's time to run the workflow, and have Automator do the heavy-lifting. Drag and drop the files you want renamed onto the "Get Specified Finder Items" workflow. They will be added to the list of files to be renamed. You can then click the "Run" button in the top-right corner of the window. Your original files will be renamed, leaving you with perfectly renamed files. You can now save your workflow.

Want more Mac Automation or AppleScript tutorials? Visit TUAW's Mac Automation and AppleScript sections.

Filed under: Features, How-tos

Mac Automation: Get to-dos sent to your mobile from iCal upon request

Say you're out and about and realize that your iPhone doesn't display iCal to-dos. What do you do? You've got two options: (1) Panic, (2) Use this Automator workflow.

With this workflow, you will have access to all of your to-dos, even if you are not at your computer -- you just need access to your main email account. When you send an email to your email account, this script will run, sending you back your ToDo list from iCal.

Creating the Automator Workflow
To create the Automator workflow, you need to find the following Automator actions and drag them into the workflow area of Automator (in the same order):
  1. Find iCal Items
  2. New Mail Message
  3. Send Outgoing Messages
Tweaking the workflow settings
In the "Find iCal Items" action, select "To Dos" from the "Find" drop-down menu. In the "Whose" section, select "Due Date" from the "From" box and "Today" from the second box. You can deviate from the instructions on this step and use the settings that allow you get the most use out of this workflow (for instance, you can select any interval of time you want, etc.).

In the "New Mail Message" action, enter your email address in the "To" field -- this is the address that your ToDo list will be sent to. Fill in a descriptive subject line like "My ToDo Items for Today" or something similar. Be sure to select an email account that your remote Mac can utilize.


Continue reading to learn how to complete this workflow and create the Mail rules.




Continue readingMac Automation: Get to-dos sent to your mobile from iCal upon request

Filed under: Features, How-tos

Mac Automation: Quickly add to-dos/events to iCal

How many times have you been watching TV and wanted to quickly add a to-do or event (maybe both) to iCal? In this Mac Automation post, I'm going to show you how to create both a to-do and an iCal event from within Automator. You will be able to add new items to iCal without ever having to open it. Let's begin.

Creating the Automator Workflow (New iCal Event)
First we need to create an Automator workflow that will add the to-do and event to iCal. To create the workflow, just add the "New iCal Events" action to the workflow area. Before you continue, be sure to click the "Options" button at the bottom of the action and select the "Show this action when the workflow runs" checkbox.

Saving the Automator Workflow
To give you quick and easy access to the creation of iCal events, you can choose the Save As method of your choice.

Running the Workflow
To run the workflow, click the "Run" button in the top-right corner of Automator (or launch it as an application). When you run the workflow, you will be presented with a dialog that will ask you to specify a Name, Date, Time, and other information. When you press "Continue," the workflow will create the event in iCal.



Keep reading to learn how to quickly create to-dos in iCal.

Continue readingMac Automation: Quickly add to-dos/events to iCal

Filed under: Features, How-tos, AppleScript

AppleScript: Creating To-Dos in iCal


Recently, a friend asked me to create an AppleScript that would allow him to automate To-Dos with a Mail.app mail rule. I immediately rose to the occasion because this was a cool idea: Mail.app could run the script when you get an ebill, for instance, for your car payment. The script would then create an iCal To-Do for "Pay your car payment, now!"

The script
set theSumm to "Pay My Bill Soon!"
set dueDate to (current date) + 10 * days
set theUrl to "http://www.paymybillexample.com"
set thepriority to 1

tell application "iCal"
make todo at end of events of (item 1 of every calendar) with properties {summary:theSumm, due date:dueDate, url:theUrl, priority:thepriority}
end tell


Customizing the script
To customize the To-Do's title, fill in the text you want, within the parenthesis on line 1. To Change the due date, change the "10" in line 2 to the number of days until it is due. If you want to change to weeks or months, use the appropriate wordage instead of "days" at the end of line 2. To change the URL, paste a URL in the parenthesis on line 3.

By default, the script will set the newly created To-Do to have a priority of 1, however, you can change this to your priority preference.

Continue reading to learn how to integrate the To-Dos with a Mail.app mail rule.

Continue readingAppleScript: Creating To-Dos in iCal

Filed under: Features, How-tos, AppleScript

AppleScript: Integrating shell scripts


We've talked about AppleScript how-tos before. AppleScript is fun and all, but what if you already know how to write shell scripts? Well, did you know that by integrating shells scripts into AppleScript, you can create simple applications that do useful things? It's true, and I am going to show you how.

Continue reading to learn how to integrate shell scripts into AppleScripts.

Continue readingAppleScript: Integrating shell scripts

Filed under: Features, How-tos

Mac Automation: Burn a backup disc of recent iPhotos

Time Machine is great way to backup your entire Mac, but what if you want to make a single backup of your recently imported photos in iPhoto? Well, Automator for Leopard is here to help with this task. In this how-to, I will show you how to find photos taken in the last 2 months and burn the resulting photos to a disc for safe keeping.

Continue reading to learn how to create this Automator workflow.

Continue readingMac Automation: Burn a backup disc of recent iPhotos

Filed under: Features, How-tos

Mac Automation: Using variables in Automator

Last week I showed you how to use Automator to make a workflow that took photos from your Mac with an iSight and sent them to your Apple TV. That how-to featured one way of using a variable in Automator to let the user name the photo themselves. In this week's Mac Automation post, I want to go into a little more detail on what variables are and what they can do for your Automator workflows.


Continue reading to learn more about using variables in Automator.

Continue readingMac Automation: Using variables in Automator

Filed under: Features, How-tos

Mac Automation: take and sync pictures to Apple TV

Parties can sometimes be boring, but with a Mac with an iSight and an Apple TV, you can liven up any party! In this how-to, I am going to show you how to create an Automator workflow that will take pictures at specified times and sync them over to your Apple TV, all without you ever lifting a finger. This Automator workflow is fantastic when you have people over for a party they can head over to your Mac, take a crazy picture of themselves and have it synced over to the Apple TV in the living room.

Continue reading to learn how to make this Automator workflow.

Continue readingMac Automation: take and sync pictures to Apple TV

Tip of the Day

Reply in the Mail.app with a specific quote.
Select the text you want quoted and then hit the reply button.
Only your selected text will copied to the reply email.


Follow us on Twitter!
 TUAW [Cafepress]

Featured Galleries

DNC Macs
Macworld 2008 Keynote
Macworld 2008 Build-up
Google Earth for iPhone
Podcaster
Storyist 2.0
AT&T Navigator Road Test
Bento for iPhone 1.0
Scrabble for iPhone
Tom Bihn Checkpoint Flyer Briefcase
Apple Vanity Plates
Apple booth Macworld 07
WorldVoice Radio
Quickoffice for iPhone 1.1.1
Daylite 3.9 Review
DiscPainter
Mariner Calc for iPhone
2009CupertinoBus
Crash Bandicoot Nitro Kart 3D
MLB.com At Bat 2009
Macworld Expo 2007 show floor

 

More Apple Analysis

AOL Radio TUAW on Stitcher