- Locating Actions to Do What You Want
- Inserting Actions into a Workflow
- Viewing an Action's Description
- Action Settings
- Action Options
- Deleting Actions
- Disabling Actions
- Moving Actions
- Copying Actions
- Renaming Actions
- Collapsing Actions
- Working with Input and Output Values
- Viewing Action Results as a Workflow Runs
Working with Input and Output Values
Actions can talk to each other. As you learned in Chapter 1, "Getting Started," most actions can receive information (called input) from a previous action, and they can pass information (called output) to the next action in a workflow sequence. This process allows actions to work together like an assembly line, passing information along from one action to the next.
Matching action input and output values
Some actions can receive any kind of input and can live anywhere in a workflow. Many actions, however, need a specific kind of input to work properly. These actions must be placed into a workflow immediately following an action that provides the right kind of output. For example, an action that takes files and folders as input must come after an action that produces files and folders as output.
An action's description indicates the kind of input it needs as well as the kind of output (result) it generates (Figure 4.49).
Figure 4.49 Viewing the input and result types for the Create Archive action.
When actions are placed together in a workflow, Automator checks if their input and output information matches. If it does, Automator links the actions visually (Figure 4.50). If the actions don't match, they appear separated (Figure 4.51). These visual clues can help you determine whether information will pass through your workflow as expected.
Figure 4.50 Two properly matched actions within a workflow, passing Files/Folders between one another.
Figure 4.51 Two improperly matched actions within a workflow.
Ignoring an action's input
There may be times when you don't want an action to do anything with the input it receives. For example, Figure 4.52 shows a workflow that retrieves URLs from a current webpage in Safari, downloads those URLs, and then sends out an email notice. This workflow consists of four actions:
Figure 4.52 An example workflow, which downloads URLs from the current webpage in Safari and sends out an email notice when complete.
- Get Current Webpage from Safari
- Get Link URLs from Webpages
- Download URLs
- New Mail Message
In this workflow, the Download URLs action passes downloaded files as input to the New Mail Message action. The New Mail Message action then adds those files as attachments to the Mail message that it creates. Although that's a nice feature, you may just want to send a notice that the files have been downloaded without actually attaching the downloaded files. To do this, you can tell the New Mail Message action to ignore its input.
To tell an action to ignore its input:
In the workflow area, select the action whose input you'd like to ignore and choose Action > Ignore Input (Figure 4.53).
Figure 4.53 Telling the selected action in a workflow to ignore its input.
While holding down the key, click the action's title bar to display the contextual menu and choose Ignore Input (Figure 4.54).
Figure 4.54 Telling the New Mail Message action to ignore its input from the action's contextual menu.
The action becomes visually separated from the preceding action in the workflow, indicating that the action no longer accepts input (Figure 4.55).
Figure 4.55 The New Mail Message action is configured to ignore its input in a workflow.
After you disable an action's input, you can turn it back on again should the need arise.
To tell an action to accept its input:
Select the action in the workflow area and choose Action > Accept Input (Figure 4.57).
Figure 4.57 Telling the selected action in a workflow to accept its input.
While holding down the key, click the action's title bar to display the contextual menu and choose Accept Input (Figure 4.58).
Figure 4.58 Telling the New Mail Message action to accept its input from the action's contextual menu.
Automator links the action to the preceding action in the workflow again, visually indicating that it now accepts input again (Figure 4.59).
Figure 4.59 The New Mail Message action is configured to accept its input.