rb-appscript

2. API overview

Classes

The main AEM classes are as follows:

Application
Represents a scriptable application, and provides an event method for constructing Apple events.
Event
Represents a ready-to-send Apple event, and provides a send method for sending it. Returned by the Application class's event method.
CommandError
Exception raised to indicate an application or Apple Event Manager error.
Codecs
Provides pack and unpack methods for converting Ruby values to AE types, and vice-versa. Clients usually don't need to access this class directly.
AEType, AEEnum
Represent Apple event type and enumerator values.

In addition, there are a number of classes used to represent application references, although the user does not instantiate these directly.

Methods

The AEM module exports three top-level methods for use in constructing application references:

app
Returns the base object used to construct absolute references.
con
Returns the base object used to construct relative reference to container object (used in by-range specifiers).
its
Returns the base object used to construct relative reference to object being tested (used in by-filter specifiers).

References are constructed from these base objects using chained property/method calls.

Modules

The aem package also exports the following support module:

FindApp
Provides functions for locating applications by name, bundle id or creator code.