Contents

AEDecodeMessage(_:_:_:)

Decodes a Mach message and converts it into an Apple event and its related reply.

Declaration

func AEDecodeMessage(_ header: UnsafeMutablePointer<mach_msg_header_t>!, _ event: UnsafeMutablePointer<AppleEvent>!, _ reply: UnsafeMutablePointer<AppleEvent>!) -> OSStatus

Parameters

  • header:

    A pointer to a Mach message header for the event to be decoded.

  • event:

    A pointer to a null Apple event descriptor (one with descriptor type typeNull). On successful completion, contains the decoded Apple event. If the function returns successfully, your application should call the 1444208 Aedisposedesc function to dispose of the resulting descriptor after it has finished using it.

  • reply:

    A pointer to a null Apple event descriptor. On successful completion, contains the reply event from the decoded Apple event. To send the reply, you use the following:

    AESendMessage(reply, NULL, kAENoReply, kAEDefaultTimeout);

Return Value

A result code. See Result Codes.

Discussion

The Apple Event Manager provides the following functions (in macOS only) for working with Apple events at a lower level: AEGetRegisteredMachPort(), AEDecodeMessage, AESendMessage(_:_:_:_:), and AEProcessMessage(_:). See the descriptions for those functions for more information on when you might use them.

See Also

Working With Lower Level Apple Event Functions