AppleScript Studio Programming Guide
PDF
Introduction
About AppleScript Studio
What Is AppleScript Studio?
What Makes AppleScript Studio Special?
AppleScript
Integrated Development Environment
Application Framework
Strengths and Limitations
How AppleScript Studio Works
AppleScript Studio’s Components
AppleScript Studio Applications
Connecting Actions to Scripts
Putting It All Together
Creating a Hello World Application
AppleScript Studio Sample Applications
AppleScript Studio Components
AppleScript Overview
How AppleScript Is Implemented
Scripting in AppleScript Studio
Terms for Classes and Objects
Xcode Features for AppleScript Studio
AppleScript Studio Application Templates
AppleScript Studio Xcode Plug-in Template
Default Project Contents
AppleScript Application Template
Document-based Application Template
AppleScript Droplet Template
The Targets Group
Source Code Editor
Debugging Features
Terminology Browser
Interface Builder Features for AppleScript Studio
Interface Creation
Interface Connections
Cocoa Framework Overview
Cocoa Scripting Support
Cocoa User Interface Objects
Cocoa Application Framework
AppleScriptKit Framework Overview
Programming With AppleScript Studio
Additional Information on AppleScript Studio
Organizing an AppleScript Studio Project
Deciding How Many Script Files to Use
Deciding How Many Nib Files to Use
Naming Conventions for Methods and Handlers
Accessing Code From AppleScript Studio Scripts
Persistent Script Properties
Accessing Script Globals
Overridden Scripting Additions
How Xcode Formats Scripts
Switching Between AppleScript Studio and Script Editor
Scripting AppleScript Studio Applications
Using Script Editor to Test AppleScript Studio Terminology
AppleScript Studio Terminology
Overview
General Sources of Scripting Terminology
Terminology From the AppleScriptKit Framework
Terms From Cocoa’s Built-in Suites
Terms from The AppleScriptKit Framework
Finding Terminology Information
Examine Scripting Dictionaries
Investigate the Sample Applications
Experiment With Script Editor to Find Terminology
Programming Tips
Targeting an AppleScript Studio Application
Using Make, Not Create, to Create New Objects in Scripts
Using the Log Command to Track Your Scripts
Basic Tips and Reminders
Comment AppleScript Studio Handlers
Save Your Work
Occasionally Do a Clean Rebuild
Give All Important Objects an AppleScript Name
Troubleshooting
My Script Statements Aren’t Working
Several Windows in My Application Have ID 0
I Can’t Script My UI to Do QA Testing
AppleScript Studio Cookbook
Performing User Interface Actions
Specifying Minimum Requirements for an Application
Adding AppleScript Studio Support to Your Cocoa Application
Setting the Keyboard Focus
Obtaining the Path to the Current Application
Currency Converter Tutorial
Design the Application
Create a Project
Build the Interface
Launch Interface Builder
Adjust the Title, Size, and Other Attributes of the Currency Converter Window
Add Text Input Fields and Labels
Add a Result Field and Label
Add Number Formatters to the Input and Result Fields
Add a Convert Button
Add a Horizontal Separator
Finalize the Layout
Connect the Interface
Write Event Handlers
Build and Run the Application
Where To Go From Here
Mail Search Tutorial: Design the Application
Before You Start This Tutorial
Identify a Goal for the Application
Examine Mail’s Scripting Dictionary
Specify Operations for Mail Search
Design the Interface
Identify Objects for the User Interface
Arrange the User Interface
Plan the Code
Event Handlers in Mail Search
Additional Handlers and Scripts in Mail Search
The Controller Script
The Status Dialog Script
Mail Search Tutorial: Create the Interface
Create a Project
Add an Image File to the Project
Build the Interface
Examine the Default Menus
Create the Message Window
Create a Nib File
Add the Message Window to the Nib File
Set Up Interface Objects in the Message Window
Create a Status Dialog
Adjust the Size and Attributes of the Status Dialog
Set Up a Progress Bar
Set Up a Text Field
Create the Search Window
Set Up a Popup Button
Set Up a Text Field
Set Up a Button
Set Up an Outline View
Set Up a Table View
Group the Outline View and Table View in a Split View
Mail Search Tutorial: Connect the Interface
Connect the Interface
Connect the Application Object
Connect Interface Items in the Search Window
Connect the Search Window
Connect the Text Field
Connect the Find Button
Connect the Search Results View
Provide a Data Source Object for the Mailboxes View
Examining an Object Hierarchy in the Nib View
Provide a Data Source Object for the Search Results View
Mail Search Tutorial: Write the Code
Obtaining the Code for the Mail Search Tutorial
Define Global Variables and Properties
Write Event Handlers for the Interface
Application Object Handler
Search Window Handlers
Text Field Handler
Find Button Handler
Search Results Table View Handler
Write Scripts and Additional Handlers
Write the Controller Script
Controller Script Properties and Initialization
Finding and Displaying Accounts and Mailboxes
Finding and Displaying Messages
Opening Message Windows
Write Handlers for Working With Controllers
Write Handlers for Working With the Status Dialog
Write Handlers for Working With Message Windows
Write Utility Handlers
Mail Search Tutorial: Build and Test the Application
Build and Run Mail Search
Check for Syntax Errors
Mail Search Tutorial: Customize the Application
Customize Menus
Rename Menus and Menu Items
Set Menu Attributes
Remove Menus and Menu Items
Customize the About Window
Customize Version and Copyright Information
Customize Icons
Add an Icon Resource File to the Project
Supply a Creator Code
Appendix A: AppleScript Studio System Requirements and Version Information
Appendix B: Mail Search Tutorial, Full Script Listing
Mail Search Copyright Notice
Glossary
Revision History