
166
5
Interapplication Communication with Scripts
The Adobe scripting environment provides an interapplication messaging framework, a way for to send
and receive information and scripts from one Adobe application to another. An application that supports
the messaging framework is said to be message enabled.
Code samples that demonstrate various techniques are provided with the Adobe ExtendScript SDK, and
referenced by name in the relevant sections.
Communications overview
Scripts written for any message-enabled application can communicate with other message-enabled
applications in two ways; through directly calling functions defined in a remote application, and by
sending messages and receiving responses from a remote application. A specific syntax is provided for
identifying applications unambiguously.
Remote function calls
A limited set of basic functions (the cross-DOM) are common across all message-enabled applications, and
allow your script to, for example, open or print files in other applications, simply by calling the
open or
print function for that application.
X “Cross-DOM functions” on page 167 describes the usage of this feature.
X “Cross-DOM API reference” on page 168 provides reference details for the functions of the basic
cross-DOM.
Each message-enabled application can also export a set of functions to provide a selected set of
application-specific functionality; see “
Application-specific exported functions” on page 167. For example,
an Adobe Bridge script can request a photo merge in Photoshop by calling
photoshop.photomerge(files). The set of functions available for each application varies widely.
Messaging framework
The interapplication messaging framework is a JavaScript application programming interface (API) that
allows extensive control over communication between applications. The API allows you to send messages
to other applications and receive results, and to receive messages sent by other applications and return
results. Typically the data passed between applications are JavaScript scripts. However, the messaging
framework is extensible. It allows you to define different types of data to send between applications, and
to specify how they are handled.
X “Communicating through messages” on page 170 describes the usage of this feature.
X “Messaging framework API reference” on page 179 provides complete reference details.
Comentarios a estos manuales