Using Workflows

Workflows are groups of actions that are combined to help you accomplish a task. When you run a workflow, the actions in it are carried out in sequential order until the last action has been performed. The results, or output, of the first action become the input for the next action, and so on, until the workflow is completed.

Designing a workflow

Building a workflow from scratch is much simpler than you may think. To help you get started with Automator, I’ve created a new workflow and walk you through its creation step by step. First, here’s what I want to do with my new workflow:

bullet.tif I want to rename images that I’ve saved from my camera to a folder on my desktop called New Pics using Image Capture. My camera automatically adds IMG to the beginning of every file and then numbers them sequentially. I want to name the files a little more descriptively, and Automator is the perfect tool to accomplish this task.

bullet.tif Once renamed, I want to open my files in Preview so that I can check them out.

bullet.tif I want my images to automatically print so that I can have a hard copy of each.

bullet.tif I want to e-mail my new pictures to friends and family.

As I mentioned, my camera automatically saves files with an IMG prefix, so that’s the convention I use in this short tutorial. You may want to adjust the variable in Step 3 of the following list to match the default naming conventions of your camera.

Follow these steps to begin building the workflow:

1. Tell Automator which files you want to interact with. Select Files & Folders from the Library column, and then drag and drop Find Finder Items into the Workflow pane, as shown in Figure 14.3.

2. Choose Other from the Search drop-down menu and select Desktop on the left side of the resulting window. Click New Folder, name the folder New Pics, click Create, and then click Choose.

9781118463932-fg1403.eps

14.3 Adding actions to my new workflow in Automator.

3. In the criteria section, leave the All pop-up menu alone, change the Any content pop-up menu to Name, leave the contains pop-up menu alone, and finally type IMG in the text field. This tells Automator that you are looking for files with names that start with IMG.

4. Tell Automator that you want to rename the items in the New Pics folder. Select Files & Folders from the Library column, and then drag and drop Rename Finder Items into the Workflow pane beneath the Find Finder Items action. A caution window appears; click Don’t Add to proceed.

5. Choose Make Sequential from the first drop-down menu, select the new name radio button in the Add number to option, and type the name with which you want to begin each of your files in the text field. I use dwightpix at the beginning of my picture files, as shown in Figure 14.4. This action causes Automator to replace the prefix IMG on all files with dwightpix, followed by a sequential number. However, I’m not quite finished renaming.

6. Add the date the files were imported to my Mac to the end of the filenames. Select Files & Folders from the Library column, and then drag and drop Rename Finder Items into the Workflow pane beneath the previous Rename Finder Items action. Click Don’t Add to proceed as before. The default criteria, as shown in Figure 14.4, are appropriate for the needs of this example, so nothing needs to be changed.

9781118463932-fg1404.eps

14.4 Renaming and adding the date to my files in Automator.

7. I want my renamed images to open in Preview so that I can see how they look. Select Photos from the Library column, and then drag and drop Open Images in Preview to the Workflow pane beneath the second Rename Finder Items action. This causes Automator to start Preview (if it’s not already running) and automatically display the new images.

note.eps

You may notice as you drag new actions into the Workflow pane that those already there move down a bit until the one you are dragging is beneath them. You can easily reposition actions in a workflow by simply dragging and dropping them into the order you need.

8. Have Automator print hard copies of the photos automatically. Select Photos from the Library column, and then drag and drop Print Images to the Workflow pane beneath the Open Images in Preview action. Make any additional adjustments that you deem necessary; for example, I chose to center and scale my images to fit the page, as shown in Figure 14.5.

9. Have Automator open Mail and create a new message, automatically attaching the new images so that all you have to do is type the recipients’ addresses and click Send. Select Mail from the Library column, and then drag and drop New Mail Message to the Workflow pane beneath the Print Images action. Type any items that you want automatically added to your new e-mail, such as the e-mail address or a subject, as shown in Figure 14.5.

10. Click Run (see Figure 14.5) in the upper-right corner to run the workflow. Automator performs the actions and warns you if there are any problems.

9781118463932-fg1405.eps

14.5 Automator automatically prints and creates a new Mail message containing the new images.

Saving a workflow

You will certainly want to save your workflows so that you don’t have to create them every time you need them — that kind of defeats the purpose of Automator. You can save your workflows as workflows or applications. Table 14.2 gives a brief explanation of each.

tb1402

To save your workflow as a new workflow or application, follow these steps:

1. Press maccmd+S.

2. Give the workflow a descriptive name and choose where to save it.

3. Select a format from the File Format pop-up menu.

4. Click Save.

To save an existing workflow that you are modifying, press maccmd+S.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset