Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Apple event
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Message-based interprocess communication mechanism in Mac OS}} {{About|Apple's software messaging system|their media events|List of Apple Inc. media events}} '''Apple events''' are the message-based [[interprocess communication]] mechanism in [[Mac OS]], first making an appearance in [[System 7 (Macintosh)|System 7]] and supported by every version of the [[classic Mac OS]] since then and by [[macOS]]. Apple events describe "high-level" events such as "open document" or "print file", whereas earlier OSs had supported much more basic events, namely "click" and "keypress". Apple events form the basis of the Mac OS scripting system, the [[Open Scripting Architecture]] (the primary language of such being [[AppleScript]]). The starting point is a dynamically-typed, extensible descriptor format called an '''AEDesc''', which is just an [[OSType]] code specifying the data type, together with a block of type-dependent data. For instance, the OSType code <code>inte</code> indicates that the data was a four-byte signed integer in [[Endianness|big-endian]] format. Besides predefined type codes for various common simple types, there are two predefined structured descriptor types: an '''AERecord''', which has data type <code>reco</code> (record), and '''AEList''' with type <code>list</code> (list or array). The internal structure of these contain recursively-nested AEDescs, while the AERecord also associates each element with a unique record field ID, which is an OSType. The Apple Event Manager provides [[Application programming interface|API]] calls to construct these structures, as well as extract their contents and query the type of contents they hold. The Apple Event Manager also supports ''coercions'', which converts AEDescs from one data type to another. In addition to standard coercions, for instance between integer and real types, applications can install their own coercion handler [[callback (computer science)|callbacks]], which handle conversions to and from custom data types. An '''Apple event''' proper is an AERecord with fields that depended on the purpose of the event. In addition, it has ''attributes'' (which are distinct from record fields, which are now called the ''parameters'' of the event) from a set predefined by the Apple Event Manager. These specify what the event is supposed to do (through ''event class'' and ''event ID''), the target address to which the event is to be sent (which could be a process on the local or a remote machine), and various other options for handling it. Remote machines initially had to be connected via [[AppleTalk]], but [[Mac OS 9]] added the option for connections via [[TCP/IP]]. After sending an Apple event to its target process, the sending process can elect to receive a reply to an Apple event. This can contain various bits of information returned from the target about the processing of the original event, including an error code indicating success/failure, any information requested by the original event, and/or other appropriate information. Apple events are the foundation of the [[AppleEvent Object Model]], which in turn is the foundation of the [[Open Scripting Architecture|OSA]] and [[AppleScript]]. {{As of|2016}}, the official implementation of the Apple Event Manager API is available in [[C (programming language)|C]] and its descendants, including [[C++]]. Official bindings are also provided for [[Objective-C]] and [[Swift (programming language)|Swift]] through the [[Cocoa (API)|Cocoa API]]. Unofficial bindings also exist for other languages (with varying degrees of limitation), including [[Perl]], [[UserLand Software#Frontier|UserTalk]], [[Ruby (programming language)|Ruby]] and [[Python (programming language)|Python]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)