Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
AppleScript in a Nutshell
A Note Regarding Supplemental Files
Preface
Organization of This Book
Part I
Chapter 1
Chapter 2
Part II
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Part III
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Chapter 14
Chapter 15
Chapter 16
Chapter 17
Chapter 18
Part IV
Chapter 19
Chapter 20
Chapter 21
Chapter 22
Chapter 23
Chapter 24
Chapter 25
Chapter 26
Chapter 27
Chapter 28
Chapter 29
Chapter 30
Chapter 31
Part V
Chapter 32
Chapter 33
Chapter 34
Chapter 35
Part VI
Appendix A
Appendix B
Conventions Used in This Book
How to Contact Us
Acknowledgments
I. Introduction to AppleScript
1. AppleScript: An Introduction
How Is AppleScript Used?
Automation
Attachability/Recordability
Scripting Additions
Apple Events
OSA
Apple Event Registry
Client/Server
Inside an Apple Event
Apple Event Parameters
Apple Event Classes and Objects
Elements and Properties
Application Class
Using Script Runner with OS X
Using OSA Menu with OS 9
Checking Your AppleScript Version
Diving In
Case Sensitivity
Statement Termination
Line Continuation Character
Naming Identifiers or Variables and Functions
Variable Declaration
Comments
Data Types
Operators and Reference Forms
Flow-Control Statements
Subroutines
Script Objects
2. Using Script Editor with OS 9 and OS X
Script Editor Controls/Commands
Dictionaries
Special Edit Menu Items
Script Saving Options
Script text file
Compiled script file
Classic applet
MacOS X applets
Applets versus droplets
Debugging with Event Log and Result Windows
Event Log
Result window
Scripting the Script Editor
II. AppleScript Language Reference
3. Data Types
alias
boolean
class
constant
data
date
file specification
integer
international text
list
number
real
record
reference
RGB color
string
Styled Clipboard Text
Styled Text
text
Unicode Text
Unit of Measurement Classes
4. Operators
&
( )
*
+
-
/ ÷ div
<
≤ <=
=
>
≥ >=
^
[a] reference to
and
as
begin[s] with
contains
does not contain
does not equal
ends with
is contained by
is not contained by
mod
not
or
5. Reference Forms
after
back
before
beginning
first, second, third, fourth, etc.
every
every ... from ... to ...
id
last
middle
name
some
whose
6. Variables and Constants
Variables
Variable Scope
Properties
Constants and Predefined Variables
all caps
all lowercase
anything
application responses
ask
bold
case
condensed
current application
date and time constants
diacriticals
expanded
expansion
false
hidden
hyphens
it
italic
me
missing value
my
no
outline
pi
plain
punctuation
result
return
shadow
small caps
space
strikethrough
subscript
superscript
tab
true
underline
version
white space
yes
7. Flow-Control Statements
considering [but ignoring] end [considering]
continue
error
exit [repeat]
if simple statement
if [then] [else if] [else] end [if]
ignoring [but considering] end [ignoring]
repeat end [repeat]
repeat until end [repeat]
repeat while end [repeat]
repeat with {loop variable} from {integer} to {integer}[by stepVal] end [repeat]
repeat with {loop variable} in {list} end [repeat]
repeat {integer} times end [repeat]
return [return value]
tell simple statement
tell end [tell]
try [on error] [number | from | partial result | to] end[error | try]
using terms from end [using terms from]
with timeout [of] {integer} second[s] end [timeout]
with transaction [session object] end [transaction]
8. Subroutines
Subroutines with Positional Parameters
Subroutines with Labeled Parameters
idle handler
open handler
reopen handler
quit handler
run handler
9. Script Objects and Libraries
Script Objects
Libraries
III. Scripting Mac OS 9 Applications
10. Apple Guide and Help Viewer
Apple Guide
Help Viewer
11. Apple System Profiler
Apple System Profiler
12. Keychain Scripting and Apple Verifier
Keychain Scripting
Apple Verifier
13. Desktop Printer Manager
Desktop Print Manager
14. Mac OS 9 Finder Commands
Example Finder Scripts
Finding Out the Operating System Version
Displaying the File and Creator Types of Files
Finding and Deleting Only Certain File Types
Displaying the Free Space of Each Disk
Displaying the Running Processes in a list Box and Optionally Closing Some of Them
Finder Commands
15. Mac OS 9 Finder Classes
Finder Classes
16. Network Setup Scripting
Network Setup Scripting
17. Scripting Sherlock 2
Sherlock 2
18. URL Access Scripting
URL Access Scripting
IV. Scripting Mac OS 9 Control Panels and Extensions
19. Appearance Control Panel
Appearance Control Panel
20. Apple Data Detectors Extension
Apple Data Detectors
21. Apple Menu Options Control Panel
Apple Menu Options
22. Application Switcher Extension
Application Switcher
23. ColorSync Extension
ColorSync
24. File Exchange Control Panel
File Exchange
25. File Sharing Control Panel
File Sharing
26. Folder Actions Extension
Folder Actions
27. FontSync Control Panel and Extension
FontSync Control Panel
FontSync Extension
28. Location Manager Control Panel
Location Manager
29. Memory and Mouse Control Panels
Memory Control Panel
Mouse Control Panel
30. Speech Listener and SpeakableItems Extension
Speech Listener Application
SpeakableItems Extension
Embedded Speech Commands
31. Web Sharing Control Panel
V. Scripting the Mac OS X System
32. Scripting the OS X Desktop
Working with Files, Folders, Disks, and Windows in OS X
Making New Files and Folders
Working with Finder and Inspector Windows
A Work in Progress
33. Scripting Mail
Setting Up an Email Message
Exploring the Mail Application Object
Getting Information about an Email Account
34. Executing Scripts with the Terminal App
osacompile
osalang
osascript
35. Scripting TextEdit
TextEdit
VI. Appendixes
A. Standard Scripting Additions
Standard Additions
Standard Additions
B. AppleScript Resources
Apple Computer AppleScript URLs
AppleScript FAQs, Mailing Lists, and Tutorials
Macintosh Scripting Sites
Commercial AppleScript Development Environments
Freeware AppleScript Development Environments
Index
About the Author
Colophon
Copyright
← Prev
Back
Next →
← Prev
Back
Next →