AppleScript Studio is special because it makes it easier to create Mac OS X applications with complex user interfaces that can communicate with and control other applications. The following sections describe additional features that help make AppleScript Studio one of a kind.
AppleScript
Integrated Development Environment
Application Framework
Strengths and Limitations
AppleScript provides the powerful ability to control multiple applications, including many parts of the Mac OS itself. That allows scripters to set up workflow solutions with a combined power that exceeds that of any individual application.
In addition to the ability to control multiple applications, AppleScript’s strengths include:
an English-like language that makes scripts easier to write and understand
powerful language features, including list and record manipulation, as well as script objects that provide features such as inheritance and encapsulation; script objects are described in “Additional Handlers and Scripts in Mail Search”
the ability to target applications on remote machines
with the addition of support for SOAP (simple object access protocol) and XML-RPC (a simple protocol for making remote procedure requests to Internet-based servers) in Mac OS X version 10.1, the ability to target Internet servers with remote procedure calls
With AppleScript Studio, script developers can take advantage of all these features, while quickly creating applications that include complex user interfaces. For example, Figure 1-1 shows Drawer, one of many sample applications distributed with AppleScript Studio. Drawer demonstrates how to use a number of interface classes, including buttons, text fields, radio buttons, steppers, and even its namesake, a drawer. Other sample applications display file and folder information in windows similar to the Finder’s column and list view. See “AppleScript Studio Sample Applications” for a complete list of sample applications.
Because it is integrated with Apple’s development environment, AppleScript Studio can take advantage of powerful features provided by Xcode and Interface Builder. These include:
use of Cocoa’s rich set of user interface classes; layout tools include built-in support for Aqua interface guidelines
tools that simplify building and maintaining complex projects with multiple targets and build steps
easy customization of application menus, icons, and About windows
AppleScript Studio supports a number of scripting features that are also available in the Script Editor application distributed with Mac OS X version 10.3, but were not available in previous versions of the Script Editor. These include:
creation of arbitrarily large scripts
search and replace in scripts
easy access to handlers and properties in scripts (through a pop-up menu)
a flexible dictionary viewer for working with application scripting terminologies
For more information, see “Xcode Features for AppleScript Studio” and “Interface Builder Features for AppleScript Studio.”
Because AppleScript Studio applications are Cocoa applications, they benefit from Cocoa’s full-featured application framework. As a result, an AppleScript Studio application can perform many operations automatically, without any additional Objective-C code from the developer. Built-in features allow users to open multiple windows, resize and minimize windows, display an About window, enter text in text fields, and even shuffle column positions in a table view.
Note: Objective-C is Cocoa’s native programming language, but you can use other kinds of code within an AppleScript Studio application. For more information, see the section “Accessing Code From AppleScript Studio Scripts” and the description of the Multi-Language application in “AppleScript Studio Sample Applications.”
To experiment with the features you get in the simplest document-based AppleScript Studio application, even before adding any code or scripts, see the steps in “Create a Project.”
Users with previous Cocoa experience will also find a lot to like in AppleScript Studio, including the ability to
use AppleScript to control other applications
do quick prototyping, with scripts taking the place of unimplemented methods
perform simple automated testing, using AppleScript Studio’s ability to script Cocoa user interface objects (not available in Cocoa alone); for more information, see “Scripting AppleScript Studio Applications”
Note: AppleScript Studio also supports calling code directly from scripts. For more information, see “Accessing Code From AppleScript Studio Scripts.”
Although you can create applications that perform virtually all of their operations by executing AppleScript scripts, you are free to include additional Cocoa code in applications. You may find it useful to learn more about the Cocoa code working behind the scenes—to do so, see the information provided in “Cocoa Framework Overview,” as well as the Cocoa documentation described in “See Also.”
AppleScript Studio offers a number of powerful features. However, for scripting tasks that don’t require a complex user interface, such as adjusting your workspace or automating repetitive tasks, the Script Editor (distributed with the Mac OS) or a third-party scripting application is usually a more appropriate tool. You’ll have access to AppleScript’s key features without the overhead that comes with AppleScript Studio’s additional power.
AppleScript Studio shows its strength for tasks that require:
a complex user interface
manipulation of information associated with user interface elements
display of information provided or manipulated by other processes (including information gathered from databases)
the ability to take advantage of features written in standard programming languages (which you can access from AppleScript Studio scripts, as shown in the Multi-Language sample application, described in “AppleScript Studio Sample Applications”)
a fully functional build environment
AppleScript Studio is less appropriate for tasks that require:
display of large amounts of data (such as massive tables)
intensive computation or manipulation of large amounts of data in AppleScript Studio scripts
intensive interaction with a file system (such as displaying large numbers of files; you can try the Browser sample application, described in “AppleScript Studio Sample Applications,” to experiment with the performance of an application that browses the file system)
simple scripting operations, especially those with little or no user interface
You may notice that AppleScript Studio performs poorly when you use AppleScript scripts to perform computation-intensive operations. This reflects the limits of the processing power of the AppleScript language, which was not designed for those kinds of tasks. One way to work around these issues is to have your scripts call into C, C++, Objective-C, or Java code to perform computation-intensive operations. The Multi-Language sample application, distributed with AppleScript Studio, demonstrates how to access code written in various languages from an AppleScript Studio application.
AppleScript Studio does not support building non-Cocoa applications, or applications that must run in Mac OS 9, or in versions of Mac OS X before version 10.1.2.
AppleScript Studio applications, like other Cocoa applications, can access frameworks and libraries outside the Cocoa framework, including the Carbon framework, although detailed steps for doing so are not described in this document.
Last updated: 2006-04-04