appleEvent

Typemessage
DictionaryLCS
LibraryLiveCode Script
Syntax
appleEvent <pClass>, <pID>, <pSender>
Associationscard
Summary

the current card whenever the application receives an Apple event.

Introduced1.0
OSmac
Platformsdesktop
Parameters
NameTypeDescription
pClass

The class and ID together identify the exact Apple event that was received.The class parameter is the event class: possible classes include aevt (for required Apple Events such as "open document" and "print" ), misc (for miscellaneous events such as "do script" ), and others.

pID

The ID parameter is the name of the specific Apple event.

pSender

The sender parameter is the address of the process that sent the Apple event.

Example
on appleEvent theClass,theID
-- execute a set of statements in a text file
  if theClass is "misc" and theID is "dosc" then
    request appleEvent data -- get the content of the AppleEvent
    do URL ("file:" & it)
  end if
  pass appleEvent
end appleEvent
RelatedCommand: send to program
Function: flushEvents
Glossary: application, current card, Apple Event, command, message
Description

Handle the appleEvent message to respond to a custom Apple event, or one that you want to handle specially.

Use the request appleEvent command to obtain the data associated with an Apple event.

For more information about Apple events, refer to the section entitled "Apple Events Sent by the Mac OS" in the technical documentation located on Apple's website