PDF Ebook Automator Programming Guide

Submitted by antoq on Thu, 07/23/2009 - 06:29

Automator is an application from Apple that automates repetitive procedures performed on a computer. With Automator users can construct arbitrarily complex workflows from modular units called actions. An action performs a discrete task, such as opening a file, cropping an image, or sending a message. A workflow is a number of actions in a particular sequence; when the workflow executes, data is piped from one action to the next until the desired result is achieved.

Apple includes a suite of ready-made actions with Automator, but developers are encouraged to contribute their own actions. You can create actions which are implemented as loadable bundles using either AppleScript, Objective-C, or a combination of the two languages. You can also create actions using shell scripts or other scripting languages such as Perl and Python.

Automator was introduced in Mac OS X version 10.4. It does not run on earlier systems. The development features of Automator were introduced with Xcode 2.0. Additional development features have been added in Xcode 2.1. This document notes these newer features when it mentions them.

Contents
Introduction to Automator Programming Guide

    Who Should Read This Document
    Organization of This Document
    See Also

Automator and the Developer

    Constructing Workflows With Automator
    Workflow Scenarios
    Developing for Automator
    Automator Actions as Universal Binaries

How Automator Works

    The Development Components of Automator
    Loadable Bundle Architecture
    A New Workflow
    An Unarchived Workflow
    Programming Implications of Loadable Bundles
    Threading Architecture
    The Automator Classes

Design Guidelines for Actions

    What Makes a Good Action?
    Action Input and Output
    Naming an Action
    The User Interface of an Action

Developing an Action

    Creating an Automator Action Project
    Constructing the User Interface
    Using the Cocoa-Automator Palette
    Establishing Bindings
    Specifying Action Properties
    Using the Automator Property Inspector
    Writing the Action Description
    Writing the Action Code
    Internationalizing the Action
    Localized Strings
    Localizing the Automator Properties
    Internationalizing Resource Files
    Testing, Debugging, and Installing the Action
    Testing and Debugging Strategies
    Installing Actions
    Frequently Asked Questions About Debugging Automator Actions

Show When Run

    The “Show Action When Run” Option
    Refining Show When Run
    Specifying Properties for Show When Run
    Grouping User-Interface Objects

Implementing an AppleScript Action

    The Structure of the on run Command Handler
    Other AppleScript Scripts
    Hybrid Actions
    Updating Non-bound Parameters

Implementing an Objective-C Action

    Specifying Cocoa Type Identifiers
    Implementing runWithInput:fromAction:error:
    Updating Action Parameters
    Loading and Executing Scripts

Creating Shell Script Actions

    The Run Shell Script Action
    Custom Shell Script Actions
    Creating the Shell Script Action Project
    Composing the Action View
    Automator Properties for Shell Script Actions
    Writing the Script
    Debugging and Testing Shell Script Actions

Creating a Conversion Action
Defining Your Own Data Types

    When to Define a Data Type
    Creating the Definition Bundle
    Specifying Defined Types
    Adding a Localization

Automator Action Property Reference

    Property Keys and Values
    Type Identifiers

Document Revision History

Download
PDF Ebook Automator Programming Guide


Posted in :