Name: request appleEvent

Type: command

Syntax: request appleEvent {class|ID|sender|returnID|data [with keyword <aeKey>]}

Summary: Gets data about an <Apple event> that was sent to LiveCode.

Synonyms: request ae

Introduced: 1.0

OS: mac

Platforms: desktop

Example:
request appleEvent class

Example:
request appleEvent data

Example:
request appleEvent data with keyword "timo"

Parameters:
aeKey: An Apple event keyword. If you do not specify an aeKey (or any of the specific forms of the command), the request appleEvent command gets the data attached to the Apple event.

It: The information returned by the <request appleEvent> <command> is placed in the <it> <variable>.

Description:
Use the <request appleEvent> <command> from within an <appleEvent> <handler> to extract information about a pending <Apple event>.

When a program sends an Apple event, it includes several different pieces of information. Each piece corresponds to an Apple event keyword. Use the request appleEvent data with aeKey form of this command to specify which pieces you want to get.

* The form request appleEvent class is equivalent to request appleEvent data with keyword "evcl". It gets the four-character class the Apple event belongs to (for example, misc or aevt).

* The form request appleEvent ID is equivalent to request appleEvent data with keyword "evid". It gets the four-character name of the specific Apple event (for example, dosc or eval).

* The form request appleEvent sender is equivalent to request appleEvent data with keyword "addr". It gets the AppleTalk address of the program that sent the Apple event to LiveCode.

* The form request appleEvent returnID is equivalent to request appleEvent data with keyword "rtid". It gets the Apple event's return ID number.

* The form request appleEvent data gets the data associated with the Apple event. The meaning of this data depends on which kind of Apple event is being handled. For example, the odoc (open document) event sends the file path of the document being opened as the Apple event data.

For more information about Apple events, see Apple Computer's technical documentation, Inside Macintosh: Interapplication Communication, located at http://developer.apple.com/techpubs/mac/IAC/IAC-2.html.

References: it (keyword), appleEvent (message), send to program (command), handler (glossary), Apple Event (glossary), variable (glossary), command (glossary)

Tags: networking
