Returns the Mach port (in the form of a
mach) that was registered with the bootstrap server for this process.
- macOS 10.0+
- Core Services
Returns a Mach message port header.
Apple events in macOS are implemented in terms of Mach messages. If your application links with the Carbon umbrella framework, it includes the HIToolbox framework, which initializes a Mach port and registers it with the run loop for the application. That port is considered public, and is used for sending and receiving Apple events.
Linking with the HIToolbox also requires that the application have a connection to the window server. To facilitate writing server processes that can send and receive Apple events, the Apple Event Manager provides the following functions (in macOS only):
AEProcess. Daemons and other processes with no user interface can take advantage of these functions, while typical high-level applications will have no need for them.
If your code doesn’t link with the HIToolbox or doesn’t have a run loop, it can call
AEGet to register a port directly, then listen on that port for Apple events. It can use the other low-level functions to process incoming Apple events on the port and to send Apple events through it.