Language Guide

CHAPTER 1
AppleScript, Scripts, and Scriptable Applications
What Can You Do With Scripts? 7
Integrating Applications 1
Scripts are ideal for performing tasks that involve more than one application.
A script can send instructions to one application, get the resulting data, and
then pass the data on to one or more additional applications. For example, a
script can collect information from a database application and copy it to a
spreadsheet application. Figure 1-3 shows a simple script that gets a value
from the Count cell of an inventory database and copies it to the Inventory
column of a spreadsheet.
In the same way, a script can use one application to perform an action on data
from another application. For example, suppose a word-processing application
includes a spelling checker and also supports an AppleScript command to
check spelling. You can check the spelling of a block of text from any other
application by writing a script that sends the AppleScript command and the
text to be checked to the word-processing application, which returns the results
to the application that runs the script.
If an action performed by an application can be controlled by a script, that
action can be also performed from the Script Editor or from any other
application that can run scripts. Every scriptable application is potentially a
toolkit of useful utilities that can be selectively combined with utilities from
other scriptable applications to perform highly specialized tasks.
Customizing Applications 1
Scripts can add new features to applications. To customize an application, you
add a script that is triggered by a particular action within the application, such
as choosing a menu item or clicking a button. Whether you can add scripts to
applications is up to each application, as are the ways you associate scripts
with specific actions.