Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Interapplication Communication /
Chapter 4 - Responding to Apple Events


Handling Apple Events

You do not need to implement all Apple events at once. If you want to begin by supporting only the required Apple events, you must

The following sections explain how to perform these tasks: "Accepting an Apple Event," which begins on page 4-5, "Installing Entries in the Apple Event Dispatch Tables," which begins on page 4-7, and "Handling the Required Apple Events," which begins on page 4-11.

To respond to the Apple events sent by the Edition Manager in addition to the required events, you must install entries for the Section Read, Section Write, Section Scroll, and Create Publisher events in your application's Apple event dispatch table and write the corresponding handlers, as described in "Handling Apple Events Sent by the Edition Manager" on page 4-20.

To respond to core and functional-area Apple events, you must install entries and write handlers for those events. You must also make sure that your application can locate Apple event objects with the aid of the Apple Event Manager routines described in the chapter "Resolving and Creating Object Specifier Records." These routines are currently available as the Object Support Library (OSL), which you must link with your application when you build it.

The Apple Event Manager (excluding the OSL) is available only in System 7 and later versions of system software. Use the Gestalt function with the gestaltAppleEventsAttr selector to determine whether the Apple Event Manager is available. In the response parameter, the bit defined by the constant gestaltAppleEventsPresent is set if the Apple Event Manager is available.

CONST gestaltAppleEventsAttr  = 'evnt';   {Gestalt selector}
      gestaltAppleEventsPresent = 0;      {if this bit is set, } 
                                          { then the Apple Event }
                                          { Manager is available}
To find out which version of the Apple Event Manager is available, you can use the AEManagerInfo function; for more information, see page 4-104.


Subtopics
Accepting an Apple Event
Installing Entries in the Apple Event Dispatch Tables
Handling the Required Apple Events
Handling Apple Events Sent by the Edition Manager
Getting Data Out of an Apple Event
Writing Apple Event Handlers
Replying to an Apple Event
Disposing of Apple Event Data Structures
Writing and Installing Coercion Handlers

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996