Automator

From Mac Guides

Jump to: navigation, search
Automator is an application bundled with the operating system designed to allow the user to easily make custom programming to automate their actions.

Automator was introduced in Mac OS X, version 10.4, Tiger.

Automator is still being supported by Apple as a part of Mac OS X, version 10.8, Mountain Lion.

Contents

How Automator works

Enlarge

Within Automator, one creates what are called "workflows". These Workflows are a sequence of actions where each action is a single step of the workflow. These workflows are simple, step-by-step instructions to the Mac as to what to do.

Examples of Workflows

Workflow 1: Move Selected Items to a Chosen Location...

This workflow implements a Service which can be used as a plugin in the Finder to allow the user to select and move a group of files and folders.

  1. Accept as input all selected files and folders in the Finder
  2. Ask the user for a folder to move the selected items into
  3. Ask the Finder to move the files and folders to the selected folder

Workflow 2: Convert Selected Text to a Web Page

This workflow implements a Service that can be used to convert text that is selected in any application into a web page and view the web page in Safari.

  1. Copy the text that is selected
  2. Convert the text to a web page
  3. Display the web page in Safari

Strengths of Workflows

Automator workflows are good at doing a simple sequence of actions.

Apple provides hundreds of actions that the user can use and each action does quite a lot compared to having to write code oneself.

It is possible to build hierarchies of workflows with the action "Run Workflow" with which one workflow can run other workflows.

Workflows can be saved as one of a number of different kinds of software:

  1. Mac Application
  2. Service used in the "Services" menu of applicable applications when the applicable kind of data is selected.
  3. Folder Actions which are triggered automatically for configured folders when items are added or removed, etc
  4. Calendar Alarms which are triggered at a given date and time
  5. Workflow which can be run inside of Automator and later saved as another type of Automator workflow
  6. Print plugin available when printing in virtually any application. (This kind of workflow receives a PDF document as its input.
  7. Image capture plugin to receive images from cameras and mobile devices

Once saved in any format, a workflow can be re-opened in Automator, modified and saved again either in the same format or as a different kind of workflow.

Automator makes it easy to produce many different types of software.

Limitations of Workflows

Automator workflows don't have a conditional statement. Actions can have conditions, but not workflows.

Although a workflow can loop, the loop has to start over at the beginning.

Using Programming Languages With Automator

Apple provides the following actions to allow users of Automator to have customized actions.

  • Run Shell Script Action, using any of the following languages that come preinstalled with OS X.
    • bash
    • python
    • ruby
    • perl
  • Run AppleScript Action
  • Run Application Action

Third-Party Automator Actions

Developers can make their own actions and distribute them as either a part of their applications or on the Mac App Store.

Links