NSAppleEventManager
A mechanism for registering handler routines for specific types of Apple events and dispatching events to those handlers.
Declaration
class NSAppleEventManagerOverview
Cocoa provides built-in scriptability support that uses scriptability information supplied by an application to automatically convert Apple events into script command objects that perform the desired operation. However, some applications may want to perform more basic Apple event handling, in which an application registers handlers for the Apple events it can process, then calls on the Apple Event Manager to dispatch received Apple events to the appropriate handler. NSAppleEventManager supports these mechanisms by providing methods to register and remove handlers and to dispatch Apple events to the appropriate handler, if one exists. For related information, see How Cocoa Applications Handle Apple Events
Each application has at most one instance of NSAppleEventManager. To obtain a reference to it, you call the class method shared(), which creates the instance if it doesn’t already exist.
For information about the Apple Event Manager, see Apple Event Manager and Apple Events Programming Guide.
Topics
Getting an event manager
Working with event handlers
removeEventHandler(forEventClass:andEventID:)setEventHandler(_:andSelector:forEventClass:andEventID:)
Working with events
Suspending and resuming Apple events
appleEvent(forSuspensionID:)currentAppleEventcurrentReplyAppleEventreplyAppleEvent(forSuspensionID:)resume(withSuspensionID:)setCurrentAppleEventAndReplyEventWithSuspensionID(_:)suspendCurrentAppleEvent()NSAppleEventManager.SuspensionID