Section 11. Automate a Recurring Task


11. Automate a Recurring Task

BEFORE YOU BEGIN

1 Install an Application from Disc or Download

2 Find, Launch, and Quit an Application


11. Automate a Recurring Task


Mac OS X Tiger contains a new application called Automator . This tool is designed to simplify your work by giving you an easy way to script the operation of any applications you use frequently. You can set up an automated workflow that runs through a predefined procedure, driving your various applications, any time you need to do so. For example, if you frequently need to apply a set of processing operations to groups of image files, you can use Automator to create a workflow that performs these operations automatically without any interaction from you.

1.
Open Automator

Automator is found in the Applications folder at the top level of the hard disk. Double-click its icon to launch the application.

2.
Select an Application from the Library Column

The Automator application consists of two columns of hierarchical tasks on the left, grouped by the application to which they pertain, and a pane on the right where you visually set up the workflow by linking together a series of component tasks .

First, select the application or saved workflow you want to use from the Library column. For example, if you want Automator to apply a series of image processes to a selected group of picture files, start by selecting Finder from the list (because you will need to use the Finder to select the image files in question).

3.
Select an Automated Task to Perform

The Action column shows all available actions associated with your selected application or saved workflow from the Library . For our example, locate the Choose Files action and drag it to the workflow pane.

4.
Set Task Properties

The action expands into a visual workflow element with several properties that you can set. In this case, the Ask for Finder Items action begins with a Type option (to specify what kind of items the task can accept as input), Start at (the folder in which the file selector will begin), the text for a prompt (used in the title bar of the file selector), and the option to allow selection of multiple items. Set these items according to your needs. For instance, in this example we need to get a group of image files, so select the check box for multiple selection of files.

5.
Organize Workflow Elements

Next, repeat the process thus far to choose the next task in the workflow. A label at the bottom of the workflow element shows what kind of results to expect from the action. In our case, the Ask for Finder Items action gives us files or folders. Other kinds of actions might return images, web URLs (addresses), Mail messages, or just about anything else. Make sure that the next action that you choose can take the same kind of input that matches the output of the previous action. If two consecutive tasks are not compatible, the first is treated as the end of the procedure that passes data from one task to another, and the next begins another series of tasks.

TIP

You can see what kind of input, output, and options are available for each action by selecting the action and then viewing its description in the pane in the lower left.

Drag as many actions into the workflow as you need in order to complete the procedure. If you need to change the order of the workflow elements, you can click and drag them by their title bars up or down. To remove a workflow element, click the X in the upper right.

NOTE

Automator helpfully suggests tasks that you might wish to add for convenience or safety. For example, if you add a task that performs image operations on a group of selected files, it asks you whether to add a Copy Files task to create duplicates of the original items, to make sure you don't overwrite them with your procedure.

6.
Run the Automated Workflow

You can run the procedure from within Automator by clicking the Run button in the upper right (a "Play" triangle). Each task shows a "progress" spinner as it runs, which changes to a green circle when it's complete. Use this method to test your workflow as you build it. If you detect a problem, or you don't want the workflow to continue all the way through, click the Stop button to interrupt it.

7.
Save the Workflow for Future Use

After the workflow is complete, you can save it in one of two formats (select File, Save ). Saved as a Workflow , the procedure becomes a WFLOW file, which reopens Automator if you double-click it, letting you then run the workflow using the Run button. However, for the most streamlined product, choose the Application format when saving. This converts your workflow into a self-contained application with its own icon (featuring the little Automator robot, known as Otto); when you double-click this new icon, the workflow immediately executes, without needing to open Automator. This is the best way to create a procedure that you'll use a lot in the future.

NOTE

You can transfer an Automator-created application to another Mac to use there; however, that machine must be running Tiger or a later operating system version for it to work.


Automator is an application large and intricate enough to merit a book of its own; there are vast possibilities for how to create workflows, define new tasks, save workflows as "plug-ins" for certain applications, and extend the capabilities of your most frequently used applications beyond their original design. This brief tour should be enough to get you started, though; feel free to experiment and explore what's possible!



MAC OS X Tiger in a Snap
Mac OS X Tiger in a Snap
ISBN: 0672327066
EAN: 2147483647
Year: 2001
Pages: 212
Authors: Brian Tiemann

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net