Creating Your Own Workflows


Any type of programming, which is what you are doing when you use the Automator, requires that you follow a logical path (well, logical to your Mac anyway) that ends up in the result you want. This isn't always easy to do. For best results, you should tackle any automation project by performing a series of steps, as you will learn about in the following sections.

Designing a Workflow

The first step when creating any workflow is to determine the tasks you want to automate. You need to identify the applications those tasks involve and the specific steps that are required. For best results, you should manually perform each step that is required to complete these tasks and document what you do during each one. Create a list of specific applications the tasks involve and the specific steps performed in that application (see Figure 10.5). This might seem tedious, but creating a workflow that actually does what you expect will be much easier if you take the time to design it before you jump into the Automator and start dragging steps into a workflow.

Figure 10.5. This document details the steps required to find files modified recently, place them into a disk image, and put the disk image on a CD (you'll see the resulting workflow later in this chapter).


NOTE

After you have listed the steps in your workflow, you need to make sure that Automator supports both the applications and actions you need to perform to accomplish those tasks. If it doesn't, you'll need to use a different automation tool.


To learn about some other automation tools, p. 296.


Creating and Saving a Workflow

After you have designed a workflow, you are ready to jump into the Automator to create and save it. At this stage, you should save the workflow in the Workflow format so you can continue to work with it.

When you save a workflow, you will give it a name. Usually, you'll want its name to describe what it does so you can remember it later.

Building a Workflow

To build your workflow, perform the following general steps:

1.

Use your design document to identify the first step that needs to be done.

2.

In the Library pane, select the application you use to perform that step. Then, in the action pane, select the specific action that should occur during the step.

3.

Drag the action into the Workflow area.

4.

Configure the action for the workflow.

5.

Refer to the next step in your workflow design document.

6.

Repeat step 2.

7.

Drag the action into the Workflow area. The output of the previous step will be become the input of the step you just placed in the workflow.

8.

Check the output/input connection to ensure they match. For example, if the previous step outputs a file or folder, the input of the next step should be a file or folder.

9.

Repeat steps 58 to systematically create the workflow to match your design.

10.

Save the workflow.

Testing and Editing a Workflow

After you have created the workflow, you should go through a testing process to ensure that the workflow works as you expect it to. It is typical that it won't work quite right at first, so plan on needing to edit it a few times before you get it working properly. The general steps to test and edit a workflow are the following:

1.

Click the Run button. The workflow will execute and perform the steps you have designed.

2.

Check the results of the workflow. If they are what you intended, you are done (this isn't likely the first time through unless you are working with a very simple workflow). If not, edit the workflow by proceeding to step 3.

NOTE

Some workflows won't complete because one or more steps fail. In that case, you'll usually see an error message that should help you figure out what went wrong.

3.

Identify the specific step (action) that is not working properly. Sometimes, this will be the last step executed, but at other times, it might be a step earlier in the workflow. This process can take some detective work; your clues will be the results of the workflow, error messages, and so on.

4.

Edit the workflow by reconfiguring an action that is not working properly, adding new actions, reordering the actions in the workflow, and so on.

5.

Run the workflow again. If it works properly, you are done.

6.

If the workflow doesn't result in what you expect, repeat steps 35 until it does.

You should expect to spend some time testing and editing a workflow until it does just want you want it to. You can increase the odds of your workflow working right the first time by designing it in a good amount of detail before you start creating it. Generally, the more prep work you do designing and documenting your workflow, the less time you will have to spend testing and editing it.

Saving a Workflow As an Application

After your workflow does what you want it to, you can save it as an application. You can then run the workflow by launching the application, which you do just like other applications on your Mac, such as by double-clicking it, putting it on the Dock and clicking its icon, adding it to your Login Items so it runs when you log in, and so on.



Special Edition Using MAC OS X Tiger
Special Edition Using Mac OS X Tiger
ISBN: 0789733919
EAN: 2147483647
Year: 2003
Pages: 317
Authors: Brad Miser

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