05.01.2013 Views

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

402<br />

CHAPTER 23 MAC <strong>OS</strong> X AUTOMATION WITH AUTOMATOR AND APPLESCRIPT<br />

Figure 23-2. Creating a new Automator workflow<br />

Workflows<br />

A program written in Automator is called a workflow. A workflow is a step-by-step list of simple<br />

instructions, called actions. Workflows can also contain small bits of reusable data, called<br />

variables, but we’ll return to that. Actions resemble windows in that they contain a title bar, a<br />

content view, and a tabbed details view.<br />

The title bar, which has the action’s name and icon, has a disclosure triangle on the left that<br />

will collapse and expand the action. Double-clicking the title bar has the same effect. On<br />

the right side of the title bar is an X icon. Clicking this icon will remove the action from the<br />

workflow.<br />

CAUTION Clicking the X icon removes the action without warning or confirmation. You can<br />

undo this by selecting Undo from the Edit menu or by pressing Cmd+Z.<br />

The action’s content view will typically contain preferences or other configuration options<br />

in the form of drop-down boxes, text fields, table views, and so forth. Your workflow contains a<br />

single action, Ask for Text, as shown in Figure 23-3. This action will prompt the user to enter<br />

some text. Set the question text to “What keyword shall I search for?” Leave Default Answer<br />

empty, but check the “Require an answer” box. Leave the buttons labeled as Cancel and OK.<br />

To run this simple workflow, click the Run button in the toolbar. You’ll be presented with<br />

the dialog you designed, as shown in Figure 23-4. Automator will pause execution of your workflow<br />

and wait for you to deal with the dialog. Enter a search term, and click the OK button.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!