Contents

Introduction to Cocoa Scripting Guide

Explains how to create scriptable Cocoa applications that use the scripting definition (sdef) format.

Who Should Read This Document

This document is intended for developers who want to make their Cocoa applications scriptable or who need to know more about how Cocoa applications interact with AppleScript and Apple events. It assumes you have some familiarity with Cocoa, Objective-C, and AppleScript. However, if you are unfamiliar with AppleScript, you should start by reading <!--a target="_self" -->Getting Started with AppleScript<!--/a--> and AppleScript Overview . Many of the terms scripters use are defined in AppleScript Language Guide .

Organization of This Document

The following chapters describe how to design, implement, and debug a scriptable Cocoa application:

Overview of Cocoa Support for Scriptable Applications provides a brief overview of AppleScript and scriptable applications, and describes the scripting support provided by the Cocoa application framework. This chapter is a prerequisite for the chapters that follow.

Designing for Scriptability provides high-level checklists for designing a new scriptable Cocoa application and making an existing application scriptable.

Implementing a Scriptable Application lists the key steps for implementing a scriptable Cocoa application, with links to more detailed information where necessary.

Preparing a Scripting Definition File describes the structure of scripting definition, or sdef, files. It also shows how to create an sdef for a scriptable Cocoa application and how to add scriptability information to it.

Getting and Setting Properties and Elements describes how to work with Cocoa scripting to get and set the values of properties and elements in your scriptable application. It also provides examples of basic, KVC-compliant accessor methods.

Object Specifiers explains the mechanism for locating a scriptable object in the context of its container and provides sample object specifier methods.

Script Commands provides additional detail about the script command mechanism Cocoa uses to respond to Apple events and describes how to implement script commands.

Testing, Debugging, and Performance provides tips for building up your test plan debugging the scriptability in your Cocoa application, and spotting possible performance issues.

The following chapters provide additional information about Cocoa scripting support:

How Cocoa Applications Handle Apple Events describes the default support for handling Apple events in Cocoa applications and how your application interacts with it.

Cocoa Scripting Classes and Categories provides brief descriptions of the main classes that make up Cocoa scripting support, including those that you use in creating scriptable applications.

Evolution of Cocoa Scriptability Information describes changes to Cocoa scriptability information over time. It includes information about when to use various types of scriptability information and how to convert between them.

The following chapter describes how to specify scriptability information using an earlier format:

Script Suite and Script Terminology Files describes another way to provide terminology information and describes the structure of script suite and script terminology files.

See Also

For more information on the basic design patterns used by Cocoa scripting support, see Key-Value Coding Programming Guide .

Next

Copyright © 2008 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2008-03-11