• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

What Is AppleScript?

AppleScript is a language that lets you tell existing applications what to do through a series of high-level commands. AppleScript works by providing access to the objects and methods inside your Mac OS X applications and the system itself. AppleScript relies on Apple events, introduced with System 7, which provide an open, object-oriented model for communication between different applications. Prior to System 7, double-clicking on an icon in the Finder explicitly called a routine that executed that application. With System 7, this same behavior was generalized into an object-oriented mechanism, where double-clicking on an icon sent an “open” message to the application associated with that icon, and the application then performed the appropriate action. Enabling applications to exchange messages allows applications to notify each other that certain events have occurred, and to react appropriately. To formalize this approach to application interaction, Apple introduced its Open Scripting Architecture (OSA), which defined a standard Application Programming Interface (API) for creating scriptable applications and implementing scripting languages. The OSA also provided the Apple Event Manager, a system-level component that enables applications to respond to events issued by scripting languages. With System 7.5, Apple introduced AppleScript, its own scripting language, which has undergone continual improvement and integration since.

The easiest way to clarify the differences between writing an application in programming and scripting languages is to show an example of each. Here’s a minimal example of the code necessary to create a folder with “Backup” in the C programming language:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint