Update cookies preferences

E-book: AppleScript

  • Format: PDF+DRM
  • Series: Developer Reference
  • Pub. Date: 15-Apr-2010
  • Publisher: John Wiley & Sons Ltd
  • Language: eng
  • ISBN-13: 9780470769966
  • Format - PDF+DRM
  • Price: 33,14 €*
  • * the price is final i.e. no additional discount will apply
  • Add to basket
  • Add to Wishlist
  • This ebook is for personal use only. E-Books are non-refundable.
  • Format: PDF+DRM
  • Series: Developer Reference
  • Pub. Date: 15-Apr-2010
  • Publisher: John Wiley & Sons Ltd
  • Language: eng
  • ISBN-13: 9780470769966

DRM restrictions

  • Copying (copy/paste):

    not allowed

  • Printing:

    not allowed

  • Usage:

    Digital Rights Management (DRM)
    The publisher has supplied this book in encrypted form, which means that you need to install free software in order to unlock and read it.  To read this e-book you have to create Adobe ID More info here. Ebook can be read and downloaded up to 6 devices (single user with the same Adobe ID).

    Required software
    To read this ebook on a mobile device (phone or tablet) you'll need to install this free app: PocketBook Reader (iOS / Android)

    To download and read this eBook on a PC or Mac you need Adobe Digital Editions (This is a free app specially developed for eBooks. It's not the same as Adobe Reader, which you probably already have on your computer.)

    You can't read this ebook with Amazon Kindle

Developers will advance their AppleScript skills easily with this guide

Part of the Developer Reference series, this book is packed with professional secrets for designing and building automated solutions with AppleScript, the powerful, system-level scripting language built into every Mac. Programmers will discover new ways to increase their professional efficiency and become more valuable in their jobs.

With up to date coverage of Mac OS X 10.6 Snow Leopard and loaded with real-world tips and techniques, this guide includes best practices and conventions along with informative lessons. You'll advance your scripting skills to the next level under the direction of a long-time veteran of the AppleScript community.

  • Provides step-by-step lessons for designing and building automated solutions with AppleScript
  • Written by a well-respected veteran of the AppleScript community
  • Part of the Developer Reference series that focuses on enhancing the skills of professional Apple developers
  • Filled with professional secrets, tips and techniques to help programmers increase their professional value
  • Includes best practices, naming conventions, and much more

With the information you'll get from AppleScript,you'll become a better and more effective developer.

Note: CD-ROM/DVD and other supplementary materials are not included as part of eBook file.

Foreword xxi
Acknowledgments xxiii
Introduction xxv
Part I AppleScript: The Power of Automation
1(80)
Chapter 1 Introduction to AppleScript Programming
3(18)
A Brief History of AppleScript
5(2)
Finding AppleScript Resources
7(3)
Applications
8(1)
Scripting additions
9(1)
Components
9(1)
Understanding the Unique Characteristics of AppleScript
10(4)
English-like syntax
10(3)
Universally open-ended
13(1)
Deep level of access
13(1)
Consistency maintained between updates
14(1)
Exploring the Uses and Users of AppleScript
14(4)
Uses for AppleScript
15(3)
Users of AppleScript
18(1)
Respecting the Power of AppleScript
18(1)
Summary
19(2)
Chapter 2 Workflow Automation with AppleScript
21(10)
Defining Workflow Automation
22(4)
Busting some myths about automation
22(3)
Exploring reasons to automate a workflow
25(1)
Using AppleScript for Workflow Automation
26(4)
Understanding the scalability of AppleScript
27(2)
Quantifying the return on investment potential of AppleScript
29(1)
Summary
30(1)
Chapter 3 AppleScript Deployment Options
31(28)
Exploring AppleScript Formats
31(8)
Saving scripts as files
32(4)
Saving scripts as applications
36(3)
Exploring Script Deployment Locations
39(17)
Mac OS X installation locations
39(8)
Mac OS X usage locations
47(6)
Third-party application locations
53(3)
Choosing a Format and Location
56(2)
Summary
58(1)
Chapter 4 Making the Case for Standardization
59(22)
Understanding the Benefits of Standards
59(2)
Consistency
60(1)
Repurposing
60(1)
Enhanced efficiency
60(1)
Improved quality
60(1)
Collaboration
61(1)
Automation
61(1)
Professionalism
61(1)
Exploring the Flexibility of Standards
61(1)
Applying standards within a context
61(1)
Setting your own standards
62(1)
Defining AppleScript Naming Standards
62(9)
The goals of naming standards
62(3)
Naming variables
65(2)
Naming subroutines
67(4)
Defining AppleScript Usage Standards
71(9)
The goals of usage standards
71(1)
AppleScript usage standards
72(8)
Summary
80(1)
Part II Learning the AppleScript Language
81(230)
Chapter 5 Exploring AppleScript Basics
83(28)
Understanding AppleScript Terminology
83(17)
Commands
84(1)
Literals
84(1)
Keywords
85(2)
Operators
87(2)
Object classes
89(6)
Variables
95(2)
Statements
97(2)
Subroutines
99(1)
Scripts
99(1)
Looking at AppleScript Comments
100(7)
Commenting methods
100(1)
Uses for comments
101(3)
Frequency of comments
104(1)
Commenting usage conventions
105(2)
Planning Scripts
107(3)
Pre-coding steps
107(2)
Coding steps
109(1)
Summary
110(1)
Chapter 6 Getting Started with the AppleScript Editor
111(26)
Exploring the AppleScript Editor User Interface
112(20)
The script document window
112(4)
Contextual menus
116(1)
Menus
116(6)
Preferences
122(5)
Library window
127(2)
Event Log History window
129(3)
Building the "Hello World" Script
132(4)
Creating the script
132(2)
Expanding the script
134(2)
Summary
136(1)
Chapter 7 Working with Text Objects
137(22)
Introduction to Text Objects
137(3)
Text object properties
137(3)
Special consideration for quotes
140(1)
Analyzing Text
140(10)
Counting text
140(2)
Searching text
142(3)
Comparing text
145(2)
Considering and ignoring text
147(3)
Manipulating Text
150(7)
Merging text
150(1)
Splitting text
150(1)
Extracting text
151(3)
Converting text to other data types
154(1)
Using text item delimiters
155(2)
Summary
157(2)
Chapter 8 Working with Numbers and Unit Types
159(12)
Introduction to Number Objects
159(3)
Looking at types of numbers
159(1)
Putting a number into a variable
160(1)
Comparing numbers
161(1)
Manipulating Numbers
162(5)
Performing calculations
162(3)
Converting numbers
165(2)
Working with Measurement Unit Types
167(2)
Using measurement types
168(1)
Converting within the type group
168(1)
Converting to other data types
168(1)
Summary
169(2)
Chapter 9 Working with Dates and Times
171(10)
Introduction to Date Objects
171(4)
Date object properties
172(3)
Manipulating Date and Time
175(4)
Comparing dates
175(2)
Performing calculations with dates and times
177(2)
Summary
179(2)
Chapter 10 Other AppleScript Data Classes
181(8)
Working with Booleans
181(1)
Working with RGB Colors
182(1)
Working with Aliases
183(2)
Working with Files
185(1)
Working with References
186(2)
Summary
188(1)
Chapter 11 Working with Lists
189(16)
Introduction to Lists
189(3)
Looking at list properties
190(1)
Looking at specialty lists
191(1)
Analyzing Lists
192(5)
Counting list items
192(1)
Comparing lists
193(3)
Considering and ignoring text properties
196(1)
Searching in lists
197(1)
Manipulating Lists
197(6)
Converting lists to other data types
198(1)
Extracting list items
198(3)
Adding Items to a list
201(1)
Replacing items in a list
202(1)
Removing items from a list
202(1)
Summary
203(2)
Chapter 12 Working with Records
205(8)
Introduction to Records
205(2)
Comparing an AppleScript record to a database record
206(1)
Looking at record properties
206(1)
Creating a Record
207(1)
Analyzing Records
208(2)
Counting records
208(1)
Comparing records
208(2)
Considering and ignoring text properties
210(1)
Manipulating Records
210(2)
Converting records to other data types
210(1)
Extracting data from a record
210(1)
Adding something to a record
211(1)
Replacing a value in a record
211(1)
Removing a value from a record
212(1)
Summary
212(1)
Chapter 13 Logical Branching
213(14)
Looking at the Anatomy of an If-then Statement
213(4)
Building a conditional "Hello World" dialog
214(1)
Expanding the equation
215(2)
Creating a Multiple Condition Statement
217(2)
Adding Additional Conditions
219(2)
Using Nested Statements
221(1)
Understanding Common Mistakes
222(3)
Missing parenthesis
223(1)
Missing conditions
223(1)
Condltionally undefined variables
224(1)
Summary
225(2)
Chapter 14 Looping
227(18)
Looking at the Anatomy of a Repeat Statement
228(1)
Defining the Types of Repeat Loops
229(4)
Repeat (until exit)
229(1)
Repeat x times
230(1)
Repeat while
230(1)
Repeat until
231(1)
Repeat with a from x to y {by z}
231(2)
Repeat with a In list
233(1)
Nesting Repeat Loops
233(2)
Using Repeat Loops
235(8)
Creating with repeat loops
235(1)
Modifying with repeat loops
236(4)
Extracting with repeat loops
240(2)
Processing files with repeat loops
242(1)
Summary
243(2)
Chapter 15 Dealing with Script Errors
245(22)
Introduction to Script Errors
245(6)
Defining programming errors
246(3)
Defining situational errors
249(2)
Exploring Error Management
251(10)
Looking at the anatomy of a try command
252(6)
Handling multiple errors
258(1)
Generating your own errors
259(1)
Understanding cascading errors
260(1)
Recording Errors Into a Log File
261(2)
Writing Information to the event log
261(1)
Writing errors to text files
262(1)
Looking at the AppleScript and Mac OS X Errors
263(2)
Summary
265(2)
Chapter 16 Getting Started with Scripting Additions
267(44)
Finding Scripting Additions
267(1)
System Library folder
267(1)
Library folder
268(1)
User's Home Library folder
268(1)
Embedding Scripting Additions
268(1)
Working with Standard Additions
269(41)
User Interaction
270(15)
File Commands
285(4)
String Commands
289(2)
Clipboard Commands
291(2)
File Read/Write
293(4)
Scripting Commands
297(3)
Miscellaneous Commands
300(4)
Folder Actions
304(5)
Internet
309(1)
Summary
310(1)
Part III Using Scripts to Control Applications
311(98)
Chapter 17 Controlling Applications with Scripts
313(26)
Introduction to Application Automation
313(9)
Looking at the "tell application" statement
314(1)
Managing timeouts
314(2)
Ignoring an application response
316(1)
Respecting hierarchy when nesting disparate control commands
317(1)
Defining different types of AppleScript support
318(4)
Exploring an Application's Dictionary
322(6)
Opening a dictionary
322(1)
Exploring the dictionary interface
323(1)
Exploring an application's dictionary content
324(4)
Using AppleScript to Control Applications
328(6)
Activating, launching, and quitting applications
328(1)
Manipulating the Finder with scripts
329(5)
Controlling Inter-Application Communication
334(1)
Controlling Remote Applications
335(3)
Configuring Remote Apple Events
335(1)
Understanding eppc computer specifiers
336(1)
Sending commands to a remote application
337(1)
Compiling a script using terms from a local application
337(1)
Summary
338(1)
Chapter 18 Working with Image Events
339(22)
Introduction to Image Events
339(15)
Getting started with basic functionality
340(5)
Reading properties of an image file
345(3)
Manipulating an image
348(6)
Creating an Image Batch Processor
354(5)
Summary
359(2)
Chapter 19 Working with Database Events
361(24)
Introduction to Database Events
361(11)
Getting started with basic functionality
362(4)
Working with database records
366(2)
Working with fields
368(4)
Searching a Database
372(7)
Searching for text values
372(3)
Searching for numeric values
375(1)
Searching for date values
376(2)
Searching for multiple values
378(1)
Importing Records from Tab-Separated Files
379(5)
Summary
384(1)
Chapter 20 Working with System Events
385(24)
Introduction to System Events
385(8)
Getting started with basic functionality
386(1)
Exploring the suites of commands
387(6)
Controlling Non-Scriptable Applications
393(14)
Enabling User Interface Scripting
393(2)
Activating and targeting applications
395(1)
Referencing objects in an application's interface
396(4)
Accessing information from an interface
400(4)
Performing User Interface Scripting actions
404(3)
Creating a Zipped Archive File with System Events
407(1)
Summary
408(1)
Part IV Using Subroutines and Open-Ended Programming
409(92)
Chapter 21 Using Subroutines for Non-Linear Programming
411(22)
Working with Subroutines
413(12)
Calling a subroutine from a tell application statement
414(1)
Exchanging data with subroutines
415(6)
Identifying command handler subroutines
421(3)
Commenting subroutines
424(1)
Exploring the Benefits of Subroutines
425(5)
Easing developer tasks
425(3)
Reusing code
428(1)
Allowing advanced script design
429(1)
Resolving variable names conflicts
429(1)
Designing a Non-Linear Script
430(2)
Understanding when to delimit a script Into subroutines
430(1)
Looking at the methods of delimiting a script
431(1)
Summary
432(1)
Chapter 22 Introduction to Open-Ended Programming
433(36)
Understanding the Benefits of Open-Ended Code
434(1)
Makes recycling code easy
434(1)
Improves script quality
434(1)
Encourages consistency
435(1)
Justifies smaller scripts
435(1)
Creating Open-Ended Code
435(10)
Use repeat loops to remove duplicate code
437(1)
Use the Finder selection
438(1)
Provide for an empty selection
439(1)
Allow folders to be processed
440(1)
Dynamically count the name's length
440(1)
Use text Item delimiters
441(1)
Use variables or script properties
442(1)
Query user input
443(1)
Use subroutines
443(2)
Creating Open-Ended Subroutines
445(6)
Divide code with logical groupings
445(1)
Make smaller subroutines
446(1)
Name subroutines, parameters, and variables generically
447(1)
Avoid branch-style openness
448(1)
Use subroutine parameters for variable input
449(1)
Use records for future parameter expansion
450(1)
Keep subroutines as portable as possible
451(1)
Creating an Open-Ended Image Batch Processor
451(17)
Allow a user to select folders
451(1)
Enable two additional selection methods
452(2)
Choose manipulations
454(1)
Select a custom scale percentage
455(3)
Allow the user to choose an output format
458(1)
Allow the selection of multiple output formats
459(2)
Make a drop application
461(3)
Use subroutines
464(1)
Bring it all together
464(4)
Summary
468(1)
Chapter 23 Designing a Hierarchical Subroutine Structure
469(32)
Defining the Goals of Subroutine Hierarchy
472(1)
Produce a flexible and expandable script
473(1)
Maximize reusable code
473(1)
Create portable code
473(1)
Achieve a separation of data from function
473(1)
Facilitate a multi-module solution ideology
473(1)
Identifying the Primary Levels of Hierarchy
473(2)
Maintaining flexibility within levels
475(1)
Following proper inter-level communication
475(1)
Identifying Hierarchy-Related Issues
475(8)
Project-specific elements
476(2)
Open-ended elements
478(5)
Creating a Image Batch Processor with a Hierarchical Subroutine Structure
483(16)
Outlining the new subroutine structure
487(1)
Rebuilding the script
488(11)
Summary
499(2)
Part V Organizing Code into Modules and Libraries for Multi-Module Solutions
501(62)
Chapter 24 Introduction to Multi-Module Solutions
503(32)
Understanding the Benefits of Multi-Module Solutions
504(1)
Eases developer tasks
504(1)
Allows advanced script design
504(1)
Designing a Multi-Module Solution
505(12)
Defining types of script files
505(2)
Exploring file structure options for complex solutions
507(5)
Understanding inter-script communication
512(5)
Overcoming the Complexities of Multi-Module Solutions
517(5)
Employing good development habits
517(2)
Using logs for tracking
519(3)
Building a Multi-Module Image Batch Processor
522(12)
Designing the new solution
522(1)
Building the Logging Module file
523(5)
Building the Finder Library file
528(1)
Building the Image Events Library file
529(1)
Building the main Image Batch Processor file
530(4)
Summary
534(1)
Chapter 25 Designing Open-Ended, Multi-Module Solutions
535(28)
Planning for Change
535(12)
Anticipating business changes
535(7)
Anticipating development changes
542(5)
Upgrading the Image Batch Processor to an Open-Ended, Multi-Module Solution
547(15)
Creating the new module template
547(3)
Setting up the Scale module
550(1)
Setting up the Flip module
551(1)
Modifying the Image batch processor module
552(8)
Creating a new Rotate module
560(2)
Further expansion and inspiration
562(1)
Summary
562(1)
Appendix: AppleScript Web Resources
563(4)
Apple's Developer Resources
563(1)
Developer Connection main page
563(1)
AppleScript documentation and resource main page
563(1)
Introduction to AppleScript overview page
564(1)
AppleScript language guide
564(1)
AppleScript release notes
564(1)
Mailing Lists
564(1)
Apple's AppleScript Users
564(1)
Mac Scripting Systems (MACSCRPT)
564(1)
Alternative Script Editor Software
565(1)
Script Debugger
565(1)
Smile
565(1)
Additional Scripting-Related Sites
565(2)
MacScripter
565(1)
Ul Browser
565(1)
MacTech's Visual Basic to AppleScript guide
565(1)
Write Track Media
566(1)
Index 567
Mark Conway Munro is a professional programmer who has used AppleScript, AppleScript Studio, and FileMaker Pro on a daily basis since 1992. He has designed and deployed numerous complex custom solutions for clients such as Adobe Systems, The Associated Press, BMG, KraftMaid Cabinetry, Sony Music Distribution, and many more.