Introduction |
|
xii | |
Why AppleScript Studio? |
|
xiii | |
Who Should Read This Book? |
|
xiv | |
What You Need to Begin |
|
xv | |
How This Book Is Organized |
|
xvi | |
Conventions Used in This Book |
|
xix | |
|
Part I INTRODUCING APPLESCRIPT STUDIO |
|
|
1 | (106) |
|
AppleScript Studio Basics |
|
|
3 | (28) |
|
Project Preview: The Knock-Knock Application |
|
|
4 | (2) |
|
Introducing AppleScript Studio |
|
|
6 | (2) |
|
A Little AppleScript Studio History |
|
|
6 | (1) |
|
A Quick Overview of AppleScript Studio Components |
|
|
6 | (2) |
|
A Few Words About Object-Oriented Programming |
|
|
8 | (1) |
|
AppleScript: AppleScript Studio's Programming Language |
|
|
9 | (8) |
|
When to Write AppleScript |
|
|
11 | (1) |
|
When to Develop AppleScript Studio Applications |
|
|
11 | (1) |
|
Working with the Script Editor |
|
|
12 | (3) |
|
Accessing Application Dictionaries |
|
|
15 | (2) |
|
Back to the Knock-Knock Application |
|
|
17 | (13) |
|
|
18 | (1) |
|
Step 1: Creating a New AppleScript Studio Application |
|
|
19 | (2) |
|
Step 2: Creating a Graphical User Interface |
|
|
21 | (4) |
|
Step 3: Modifying Control Attributes and Attaching Controls to Event Handlers |
|
|
25 | (3) |
|
Step 4: Editing Your AppleScript |
|
|
28 | (2) |
|
Step 5: Building and Running Your Mac OS X Application |
|
|
30 | (1) |
|
|
30 | (1) |
|
The AppleScript Studio Application Development Environment |
|
|
31 | (28) |
|
Project Preview: The AppleScript Studio Fortune Teller Game |
|
|
32 | (1) |
|
|
33 | (3) |
|
Setting Xcode Preferences |
|
|
36 | (1) |
|
Working with the Xcode Project Window |
|
|
37 | (11) |
|
The Project Window Toolbar |
|
|
38 | (1) |
|
|
38 | (2) |
|
The Project Windows Detail View |
|
|
40 | (1) |
|
|
41 | (5) |
|
|
46 | (2) |
|
Integration with the Interface Builder |
|
|
48 | (1) |
|
|
48 | (1) |
|
|
49 | (1) |
|
The Apple Developer Reference Library |
|
|
50 | (1) |
|
Back to the AppleScript Studio Fortune Teller Game |
|
|
51 | (7) |
|
Designing the AppleScript Studio Fortune Teller Game |
|
|
51 | (1) |
|
Step 1: Creating a New Project |
|
|
52 | (1) |
|
Step 2: Creating the User Interface |
|
|
52 | (3) |
|
Step 3: Attaching Controls to Event Handlers |
|
|
55 | (1) |
|
Step 4: Adding a Little Programming Logic |
|
|
56 | (1) |
|
Step 5: Testing the Execution of the AppleScript Studio Fortune Teller Application |
|
|
57 | (1) |
|
|
58 | (1) |
|
Building a Graphical User Interface |
|
|
59 | (48) |
|
Project Preview: The Typo-Matic Typing Test Game |
|
|
60 | (3) |
|
Create Graphical User Interfaces |
|
|
63 | (5) |
|
|
65 | (2) |
|
|
67 | (1) |
|
|
67 | (1) |
|
|
68 | (1) |
|
|
68 | (27) |
|
|
68 | (6) |
|
Cocoa Controls and Indicators |
|
|
74 | (6) |
|
|
80 | (3) |
|
|
83 | (10) |
|
|
93 | (1) |
|
|
94 | (1) |
|
Back to the Typo-Matic Typing Test Game |
|
|
95 | (10) |
|
|
95 | (1) |
|
Step 1: Creating a New Project |
|
|
96 | (1) |
|
Step 2: Creating the User Interface |
|
|
96 | (1) |
|
Step 3: Customizing Menus and Control Attributes, and Associating Controls with Event Handlers |
|
|
97 | (3) |
|
Step 4: Adding a Little Programming Logic |
|
|
100 | (4) |
|
Step 5: Testing the Execution of the Typo-matic Typing Test Game Application |
|
|
104 | (1) |
|
|
105 | (2) |
|
Part II LEARNING HOW TO WRITE APPLESCRIPTS |
|
|
107 | (116) |
|
Working with Values, Variables, and Classes |
|
|
109 | (36) |
|
Project Preview: The Star Trek Trivia Game |
|
|
109 | (3) |
|
AppleScript--The Technology |
|
|
112 | (1) |
|
AppleScript--The Scripting Language |
|
|
112 | (4) |
|
|
112 | (1) |
|
|
113 | (3) |
|
Managing Data Using Variables |
|
|
116 | (2) |
|
Storing Values in Variables |
|
|
116 | (1) |
|
Retrieving Variable Values |
|
|
117 | (1) |
|
|
118 | (3) |
|
|
119 | (1) |
|
|
120 | (1) |
|
Working with Different Variable Classes |
|
|
121 | (3) |
|
|
121 | (1) |
|
|
121 | (1) |
|
|
121 | (1) |
|
|
122 | (2) |
|
|
124 | (1) |
|
Back to the Star Trek Trivia Game |
|
|
124 | (18) |
|
|
124 | (1) |
|
Step 1: Creating a New Project |
|
|
125 | (1) |
|
Step 2: Creating the User Interface |
|
|
125 | (3) |
|
Step 3: Customizing Control Properties |
|
|
128 | (1) |
|
Step 4: Adding a Little Programming Logic |
|
|
129 | (9) |
|
Step 5: Testing the Execution of the Star Trek Trivia Game |
|
|
138 | (1) |
|
|
139 | (3) |
|
|
142 | (3) |
|
Applying Conditional Logic and Building Loops |
|
|
145 | (28) |
|
Project Preview: The Guess a Number Game |
|
|
146 | (3) |
|
Implementing Conditional Logic |
|
|
149 | (4) |
|
|
149 | (1) |
|
|
150 | (1) |
|
The if...else if Statement |
|
|
151 | (1) |
|
|
152 | (1) |
|
Different Types of Comparisons |
|
|
153 | (1) |
|
|
154 | (1) |
|
|
155 | (5) |
|
|
156 | (1) |
|
Iterating a Set Number of Times |
|
|
157 | (1) |
|
Looping While a Condition Proves true |
|
|
157 | (1) |
|
Looping Until a Condition Proves false |
|
|
158 | (1) |
|
Controlling Loop Execution with a Counter |
|
|
159 | (1) |
|
|
159 | (1) |
|
Back to the Guess a Number Game |
|
|
160 | (11) |
|
Step 1: Creating a New Project |
|
|
160 | (1) |
|
Step 2: Creating the User Interface |
|
|
161 | (2) |
|
Step 3: Customizing Control Properties |
|
|
163 | (2) |
|
Step 4: Adding a Little Programming Logic |
|
|
165 | (6) |
|
Step 5: Testing the Execution of the Guess a Number Game |
|
|
171 | (1) |
|
|
171 | (2) |
|
Working with Strings, Lists, and Records |
|
|
173 | (24) |
|
Project Preview: Alexander's Tall Tale |
|
|
174 | (2) |
|
|
176 | (5) |
|
Assigning Strings to Variables |
|
|
176 | (1) |
|
Getting Information About a String |
|
|
176 | (1) |
|
|
177 | (1) |
|
Controlling String Format |
|
|
177 | (1) |
|
|
178 | (2) |
|
Working with Characters, Words, and Paragraphs |
|
|
180 | (1) |
|
Defining and Accessing Lists |
|
|
181 | (3) |
|
|
181 | (1) |
|
Retrieving Elements from a List |
|
|
182 | (1) |
|
|
183 | (1) |
|
Storing and Retrieving Data Using Records |
|
|
184 | (2) |
|
Creating and Accessing Records |
|
|
184 | (1) |
|
Modifying Record Property Values |
|
|
185 | (1) |
|
Working with a List of Records |
|
|
185 | (1) |
|
Back to Alexander's Tall Tale |
|
|
186 | (9) |
|
Step 1: Creating a New Project |
|
|
187 | (1) |
|
Step 2: Creating the User Interface |
|
|
187 | (1) |
|
Step 3: Customizing Control Properties |
|
|
188 | (3) |
|
Step 4: Adding a Little Program Code |
|
|
191 | (4) |
|
Step 5: Testing the Execution of Alexander's Tall Tale Game |
|
|
195 | (1) |
|
|
195 | (2) |
|
Organizing Scripts with Handlers |
|
|
197 | (26) |
|
Project Preview: The Rock, Paper, Scissors Game |
|
|
198 | (2) |
|
Working with Event Handlers |
|
|
200 | (5) |
|
Creating Custom Event Handlers |
|
|
201 | (1) |
|
Defining and Calling Handlers |
|
|
201 | (1) |
|
Passing Arguments to Handlers |
|
|
202 | (2) |
|
Returning a Result from an Event Handler |
|
|
204 | (1) |
|
|
205 | (3) |
|
|
205 | (1) |
|
|
206 | (2) |
|
Back to the Rock, Paper, Scissors Game |
|
|
208 | (13) |
|
Step 1: Creating a New Project |
|
|
209 | (1) |
|
Step 2: Creating the User Interface |
|
|
209 | (2) |
|
Step 3: Customizing Control Properties |
|
|
211 | (1) |
|
Step 4: Adding a Little Programming Logic |
|
|
212 | (8) |
|
Step 5: Testing the Execution of the Rock, Paper, Scissors Game |
|
|
220 | (1) |
|
|
221 | (2) |
|
|
223 | (100) |
|
Working with Files and Folders |
|
|
225 | (30) |
|
Project Preview: The Slot Machine Game |
|
|
225 | (3) |
|
|
228 | (2) |
|
|
230 | (1) |
|
Establishing a File Reference |
|
|
231 | (2) |
|
|
233 | (5) |
|
Accessing Files and Folders |
|
|
233 | (1) |
|
Reading from and Writing to Files |
|
|
234 | (4) |
|
Creating Small Database Files |
|
|
238 | (4) |
|
Creating and Saving the Database File |
|
|
238 | (1) |
|
Retrieving and Accessing Database Records |
|
|
239 | (3) |
|
Back to the Slot Machine Game |
|
|
242 | (11) |
|
Step 1: Creating a New Project |
|
|
243 | (1) |
|
Step 2: Creating the User Interface |
|
|
243 | (1) |
|
Step 3: Customizing Control Properties |
|
|
244 | (1) |
|
Step 4: Adding a Little Programming Logic |
|
|
245 | (8) |
|
Step 5: Testing the Execution of the Slot Machine Game |
|
|
253 | (1) |
|
|
253 | (2) |
|
Controlling Other Applications |
|
|
255 | (30) |
|
Project Preview: The Tic-Tac-Toe Game |
|
|
256 | (2) |
|
Automating Mac OS X Applications |
|
|
258 | (1) |
|
Accessing Application Terminology |
|
|
258 | (3) |
|
|
259 | (2) |
|
Using tell to Direct Messages to Application Targets |
|
|
261 | (1) |
|
Automating Mac OS X Applications |
|
|
261 | (7) |
|
|
261 | (2) |
|
|
263 | (1) |
|
|
263 | (1) |
|
|
264 | (1) |
|
|
264 | (1) |
|
|
265 | (1) |
|
|
265 | (1) |
|
|
266 | (1) |
|
|
266 | (1) |
|
|
267 | (1) |
|
Back to the Tic-Tac-Toe Game |
|
|
268 | (15) |
|
Step 1: Creating a New Project |
|
|
268 | (1) |
|
Step 2: Creating the User Interface |
|
|
268 | (1) |
|
Step 3: Customizing Control Properties |
|
|
269 | (4) |
|
Step 4: Adding a Little Programming Logic |
|
|
273 | (10) |
|
Step 5: Testing the Execution of the Tic-Tac-Toe Game |
|
|
283 | (1) |
|
|
283 | (2) |
|
Debugging and Error Handling |
|
|
285 | (38) |
|
Project Preview: The Poker Dice Game |
|
|
286 | (3) |
|
Finding Ways of Handling Errors |
|
|
289 | (1) |
|
Different Types of Errors |
|
|
290 | (2) |
|
|
290 | (1) |
|
|
291 | (1) |
|
|
291 | (1) |
|
|
292 | (4) |
|
Using the try Statement to Catch Errors |
|
|
292 | (3) |
|
Catching Specific Types of Errors |
|
|
295 | (1) |
|
Keeping a Watchful Eye on Your AppleScript Studio Applications |
|
|
296 | (4) |
|
Writing Output to the Log |
|
|
296 | (1) |
|
Displaying Useful Information in Popup Dialogs |
|
|
297 | (1) |
|
Using Sound to Indicate When Key Events Occur |
|
|
298 | (1) |
|
|
298 | (2) |
|
Debugging Your AppleScript Studio Applications |
|
|
300 | (4) |
|
Running Your AppleScript Studio Applications in the Debugger |
|
|
300 | (2) |
|
|
302 | (1) |
|
Controlling Statement Execution |
|
|
303 | (1) |
|
Back to the Poker Dice Game |
|
|
304 | (17) |
|
Step 1: Creating a New Project |
|
|
304 | (1) |
|
Step 2: Creating the Game's Windows |
|
|
304 | (3) |
|
Step 3: Customizing Control Properties |
|
|
307 | (4) |
|
Step 4: Adding a Little Programming Logic |
|
|
311 | (10) |
|
Step 5: Testing the Execution of the Poker Dice Game |
|
|
321 | (1) |
|
|
321 | (2) |
|
|
323 | (2) |
|
Appendix A What's on the Companion Website? |
|
|
325 | (2) |
|
|
326 | (1) |
|
|
327 | (14) |
|
|
327 | (2) |
|
Locating AppleScript Studio Resources Online |
|
|
329 | (4) |
|
Apple's AppleScript Studio Web Pages |
|
|
329 | (1) |
|
Apple's AppleScript Web Pages |
|
|
330 | (1) |
|
|
331 | (1) |
|
|
332 | (1) |
|
AppleScript Studio Mailing Lists |
|
|
333 | (8) |
|
Apple's Applescript-Studio Mailing List |
|
|
333 | (1) |
|
Apple's Applescript-implementors Mailing List |
|
|
334 | (1) |
|
Apple's Applescript-users Mailing List |
|
|
335 | (1) |
|
MacScripter's AppleScript Studio and Xcode Mailing List |
|
|
336 | (1) |
|
Yahoo! Groups: AppleScript Mailing List |
|
|
337 | (1) |
|
The AppleScript Studio -- How to Mailing List |
|
|
338 | (3) |
Glossary |
|
341 | (10) |
Index |
|
351 | |