Mac OS X Power User’s Guide
This page intentionally left blank
Mac OS X Brian Proffitt William von Hagen
Power User’s Guide
A Division of Premier Press
© 2002 by Premier Press. All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system without written permission from Premier Press, except for the inclusion of brief quotations in a review. The Premier Press logo, top edge printing, and related trade dress is a trademark of Premier Press, Inc. and may not be used without written permission. All other trademarks are the property of their respective owners.
Publisher: Stacy L. Hiquet Marketing Manager: Heather Buzzingham Managing Editor: Sandy Doell Acquisitions Editor: Kevin Harreld
Apple, Mac, and Macintosh are registered trademarks of Apple Computer, Inc. Netscape is a registered trademark of Netscape Communications Corporation in the U.S. and other countries.
Project Editor: Amy Pettinella
All other trademarks are the property of their respective owners.
Editorial Assistant: Margaret Bauer
Important: Premier Press cannot provide software support. Please contact the appropriate software manufacturer’s technical support line or Web site for assistance.
Technical Reviewer: Kevin Spencer
Premier Press and the author have attempted throughout this book to distinguish proprietary trademarks from descriptive terms by following the capitalization style used by the manufacturer. Information contained in this book has been obtained by Premier Press from sources believed to be reliable. However, because of the possibility of human or mechanical error by our sources, Premier Press, or others, the Publisher does not guarantee the accuracy, adequacy, or completeness of any information and is not responsible for any errors or omissions or the results obtained from use of such information. Readers should be particularly aware of the fact that the Internet is an ever-changing entity. Some facts may have changed since this book went to press.
ISBN: 1-931841-44-6 Library of Congress Catalog Card Number: 2001099847 Printed in the United States of America 02 03 04 05 RI 10 9 8 7 6 5 4 3 2 1
Interior Layout: Bill Hartman Cover Design: Mike Tanamachi Indexer: Johnna Van Dinse Proofreader: Lisa Neal Shaw
In memory of my grandfather, who taught me to fish, mow lawns, and never give up on anything. Ever. To Dorothy, as always, and to Connie, Barry, Luke, and Elise Platz with love. Thanks for being yourselves and a part of my life.
Acknowledgments I can never get over the reaction I get when I tell people that I write computer books. I typically get a weird look and a statement, such as “Ooo, you must be really smart,” and they edge away from me, for fear that I am about to lay some heavy technical jargon upon them until they pass out. Nothing, I fear, could be further from the truth. Writing books does not mean you are smart. It may mean you are a masochist, but that is another subject. Writing a computer book means you should have more than passing knowledge of a given technology and a modicum of ability to write down what you know. The key to this process is the editorial team behind the book. It is this group that really makes the book come together, and it is this group I must thank profusely for taking my words and turning them into something meaningful. So to Amy Pettinella, Kevin Harreld, and Kevin Spencer, thank you for all your tireless efforts. I must also extend great thanks to my co-author Bill von Hagen, who stepped up to the plate when a new job left me with little time to finish this book. Bill graciously stepped in to complete the rest of this volume, and I know this work is better for it. Our mutual agent, Marta Justak, deserves big thanks for not ripping my head off when the new job arrived. And, as always, infinite thanks to my wife and family, who put up with so much nonsense when I am in the throes of book writing. I can never repay them for their love and support, but I plan on spending the rest of my life trying. Bill would like to thank Luke Platz for his help with the iTunes section, and would especially like to thank his niece Alice Platz for her special smile. Bill would also like to thank Brian for the opportunity to work with him, and Marta for making this book and many others possible. Finally, he’d like to send a second round of thanks to the folks at Premier Press for making it fun to work on this book.
About the Author Brian Proffitt is a known OS geek who works well with OS X, Linux, and Windows and has written works on all three of these operating systems. His real joy is working with Linux, and he is the Managing Editor of the popular Linux Today and LinuxPlanet Web sites. A private pilot, Brian enjoys working at home and spending time with his lovely wife and two hyper-smart daughters. Bill von Hagen is a long-time Unix, Mac, and Linux lover who has previously written books on Linux, SGML, and Filesystems. A Unix sysadmin for over 20 years and a Mac lover since 1984, he prays that Apple will port Mac OS X to the x86 platform, ending the GNOME versus KDE debate forever. In his spare time, Bill collects workstations and microcomputers and owns over 200 systems. You can reach Bill at
[email protected].
Contents at a Glance Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
Part I
Basic Mac OS X . . . . . . . . . . . . . . . . . . . . . . . 1 1 2 3 4 5 6 7 8
Part II
Printing, Graphics, and Multimedia . . . . . . . . 219 9 10 11
Part III
Upgrading to Mac OS X. . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Exploring the Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Setting Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Connecting with OS X . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Exploring the New Finder. . . . . . . . . . . . . . . . . . . . . . . . 123 What’s under the Hood? . . . . . . . . . . . . . . . . . . . . . . . . . 155 Working with Applications . . . . . . . . . . . . . . . . . . . . . . . 173 Sherlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Fonts and Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 Multimedia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 The Mac Sound Machine . . . . . . . . . . . . . . . . . . . . . . . . 281
Networks and Internet . . . . . . . . . . . . . . . . . 315 12 13 14 15 16
File Sharing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317 Network Administration . . . . . . . . . . . . . . . . . . . . . . . . . 341 E-mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369 The Personal Web Server . . . . . . . . . . . . . . . . . . . . . . . . 395 The Internet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Contents at a Glance
Part IV
Looking More Deeply at Mac OS X . . . . . . . . 453 17 18 19
Part V
Mobile Computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455 Automating Your Mac with AppleScript . . . . . . . . . . . . . 475 Working with Unix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
Appendixes . . . . . . . . . . . . . . . . . . . . . . . . . 529 A B
This Is a Mac—What Could Go Wrong? . . . . . . . . . . . . 531 Where to Go for More Information . . . . . . . . . . . . . . . . 571 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
ix
Contents Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
PART I
BASIC MAC OS X . . . . . . . . . . . . . . . . . . . . 1
Chapter 1
Upgrading to Mac OS X . . . . . . . . . . . . . . . . . . 3 Upgrade or Trade Up? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Software Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Backing Up Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Hard Drive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Internet Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Prepping Your Hard Drive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Installing Mac OS X version 10.1 . . . . . . . . . . . . . . . . . . . . . . . . 22 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Chapter 2
Exploring the Desktop . . . . . . . . . . . . . . . . . . 29 The Classic Finder Is Now the Desktop . . . . . . . . . . . . . . . . . . . 30 The Dock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Managing Applications . . . . . . . . . . . . . . . . . . . . . 32 Customizing Dock Contents . . . . . . . . . . . . . . . . . 38 Customizing Dock Appearance . . . . . . . . . . . . . . . 43 The Menu Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 The Apple Menu . . . . . . . . . . . . . . . . . . . . . . . . . . 48 System Status Menus . . . . . . . . . . . . . . . . . . . . . . . 51 Working with Windows . . . . . . . . . . . . . . . . . . . . . . . . . 54 Working with Icons . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Ejecting Disks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Start Up and Shut Down . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Contents
Chapter 3
Setting Preferences. . . . . . . . . . . . . . . . . . . . 67 Desktop Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Setting Up Your Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Making a Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Color by Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 The Geometry of a Monitor . . . . . . . . . . . . . . . . . . . . . 77 Setting Up Sounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Personal System Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Você Fala O Português? . . . . . . . . . . . . . . . . . . . . . . . . . 83 QWERTY Isn’t the Only Keyboard . . . . . . . . . . . . . . . . 85 Getting the Date and Time . . . . . . . . . . . . . . . . . . . . . . 87 Managing Numbers and Currency . . . . . . . . . . . . . . . . . 94 Setting Desktop Appearance . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Saving Energy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Chapter 4
Connecting with OS X . . . . . . . . . . . . . . . . . 107 User Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Creating a New User Account . . . . . . . . . . . . . . . . . . . 110 Updating a User Account . . . . . . . . . . . . . . . . . . . . . . . 113 Password Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Setting Up a Keychain . . . . . . . . . . . . . . . . . . . . . . . . . 116 Editing a Keychain . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Chapter 5
Exploring the New Finder . . . . . . . . . . . . . . . 123 The New File-Storage Concept . . . . . . . . . . . . . . . . . . . . . . . . 124 Applications Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 Library Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 System Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 Users Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
xi
xii
Contents
Working with the Finder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 Icon, List, and Column Views . . . . . . . . . . . . . . . . . . . 139 Working with the Finder’s List View . . . . . . . . . . 142 Working with the Finder’s Column View . . . . . . . 145 Using the Finder’s Toolbar . . . . . . . . . . . . . . . . . . . . . . 147 Common Finder Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Chapter 6
What’s under the Hood?. . . . . . . . . . . . . . . . 155 From Past to Present . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 The Core: Darwin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 FreeBSD and Mach . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 Open Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 What Darwin Can Do . . . . . . . . . . . . . . . . . . . . . . . . . 163 Multitasking and Multiprocessing . . . . . . . . . . . . 163 Memory Management . . . . . . . . . . . . . . . . . . . . . 164 Interprocess Communications . . . . . . . . . . . . . . . 165 A Picture is Worth… . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 Quartz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 OpenGL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 QuickTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 The API Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 Mac Classic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 Compromising with Carbon . . . . . . . . . . . . . . . . . . . . . 170 Cocoa: The Native X Environment . . . . . . . . . . . . . . . 170 Java: Applications to Go . . . . . . . . . . . . . . . . . . . . . . . . 171 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Chapter 7
Working with Applications . . . . . . . . . . . . . . 173 Package or Bundle? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 Installing and Removing Applications . . . . . . . . . . . . . . . . . . . . 175 Using Software Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Contents
Classic and Carbon Applications . . . . . . . . . . . . . . . . . . . . . . . 187 The Application Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 Using Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 Setting Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 Force-Quitting Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Chapter 8
Sherlock . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 Performing Searches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 Searching Locally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 Searching the Internet . . . . . . . . . . . . . . . . . . . . . . . . . 210 Configuring Sherlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 Saving Search Criteria . . . . . . . . . . . . . . . . . . . . . . . . . 214 Adding Plug-Ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 Editing Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
PART II
PRINTING, GRAPHICS, AND MULTIMEDIA . 219
Chapter 9
Fonts and Printing . . . . . . . . . . . . . . . . . . . . 221 A Short History of Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 Working with Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 Managing Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 Obtaining and Viewing Fonts . . . . . . . . . . . . . . . . . . . 230 Printing Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 Using the Print Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 Printing a Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 Changing Print Settings . . . . . . . . . . . . . . . . . . . . . . . . 236 Printing to a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 Previewing a Print Job . . . . . . . . . . . . . . . . . . . . . . . . . 238 Setting Printer Preferences . . . . . . . . . . . . . . . . . . . . . . 239 Mobile Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
xiii
xiv
Contents
Chapter 10 Multimedia . . . . . . . . . . . . . . . . . . . . . . . . . 241 What is QuickTime? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 Using QuickTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 QuickTime TV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 QuickTime VR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 Configuring QuickTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 Using Preview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 Creating Digital Movies with iMovie 2 . . . . . . . . . . . . . . . . . . . 262 Working with FireWire and Digital Cameras . . . . . . . . 263 Importing a Movie . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 Editing Your Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 Presenting Your Work . . . . . . . . . . . . . . . . . . . . . . . . . 276 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Chapter 11 The Mac Sound Machine . . . . . . . . . . . . . . . 281 A Sound Primer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 Sound Hardware and Mac OS X . . . . . . . . . . . . . . . . . . . . . . . 287 Easy Expandability Using USB . . . . . . . . . . . . . . . . . . 287 MIDI Hardware and OS X . . . . . . . . . . . . . . . . . . . . . 288 MP3 and the Mac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 Introducing iTunes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 Starting iTunes for the First Time . . . . . . . . . . . . . . . . 292 Playing CDs Using iTunes . . . . . . . . . . . . . . . . . . . . . . 296 Recording from CDs Using iTunes . . . . . . . . . . . . . . . . 298 Creating Playlists in iTunes . . . . . . . . . . . . . . . . . . . . . 300 Adding Existing MP3 Files to Your Library . . . . . . . . . 302 Creating CDs in iTunes . . . . . . . . . . . . . . . . . . . . . . . . 304 Playing Internet Radio in iTunes . . . . . . . . . . . . . . . . . 307 Playing Music From an Internet Audio Source . . . . . . . 307 Saving Internet Audio Sources . . . . . . . . . . . . . . . . . . . 309
Contents
Talking Things Over with Your System . . . . . . . . . . . . . . . . . . 310 Letting OS X Read to You . . . . . . . . . . . . . . . . . . . . . . 310 Speaking to OS X . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
PART III
NETWORKS AND INTERNET . . . . . . . . . . . 315
Chapter 12 File Sharing . . . . . . . . . . . . . . . . . . . . . . . . . 317 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 Wiring Everything Together . . . . . . . . . . . . . . . . . . . . 319 Protocols and Cabling—What’s the Difference? . . . . . . 322 What about AppleTalk? . . . . . . . . . . . . . . . . . . . . . . . . 323 Background: Peer-to-Peer and Client/Server File Sharing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 Connecting to Networked File Servers . . . . . . . . . . . . . . . . . . . 325 Connecting to Unix Servers . . . . . . . . . . . . . . . . . . . . . 326 Connecting to Windows Servers . . . . . . . . . . . . . . . . . 328 Connecting to AppleShare Servers . . . . . . . . . . . . . . . . 329 Connecting to WebDAV Servers . . . . . . . . . . . . . . . . . 332 Unmounting Shared Volumes and Directories . . . . . . . 334 Sharing Files, Folders, and Volumes . . . . . . . . . . . . . . . . . . . . . 335 Sharing Data versus Sharing Documents . . . . . . . . . . . 335 Activating File Sharing . . . . . . . . . . . . . . . . . . . . . . . . 336 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Chapter 13 Network Administration . . . . . . . . . . . . . . . . 341 Using NetInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342 How NetInfo Is Organized . . . . . . . . . . . . . . . . . . . . . 343 Graphical Tools for Managing NetInfo . . . . . . . . . . . . . 346 Command-Line NetInfo Utilities . . . . . . . . . . . . . . . . . 356 Connecting to Mac OS X over the Network . . . . . . . . . . . . . . . 357 Activating and Using SSH . . . . . . . . . . . . . . . . . . . . . . 358 Setting Up and Using Telnet . . . . . . . . . . . . . . . . . . . . 361
xv
xvi
Contents
Running the Apache Web Server . . . . . . . . . . . . . . . . . . . . . . . 363 Apache Configuration Files . . . . . . . . . . . . . . . . . . . . . 365 Apache Log Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366 The Apache Server’s “Home Directory” . . . . . . . . . . . . 366 Personal Web Site Folders . . . . . . . . . . . . . . . . . . . . . . 367 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
Chapter 14 E-mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369 Setting Up Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371 Starting OS X Mail for the First Time . . . . . . . . . . . . . 371 Importing Existing E-mail into OS X Mail . . . . . . . . . 375 Customizing or Creating E-mail Accounts . . . . . . . . . . 377 Composing a Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 Attaching a File to a Message . . . . . . . . . . . . . . . . . . . . . . . . . . 386 Managing Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 Managing E-mail Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 Creating a New Card . . . . . . . . . . . . . . . . . . . . . . . . . . 390 Editing Existing Cards . . . . . . . . . . . . . . . . . . . . . . . . . 392 Importing Cards from Other Programs . . . . . . . . 393 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Chapter 15 The Personal Web Server . . . . . . . . . . . . . . . 395 Setting Up Personal Web Sharing . . . . . . . . . . . . . . . . . . . . . . . 396 Activating Personal Web Sharing . . . . . . . . . . . . . . . . . 397 Working with Domain Name Services . . . . . . . . . . . . . 399 Serving Web Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402 Creating Shared Folders . . . . . . . . . . . . . . . . . . . . . . . . 403 Creating Protected Folders . . . . . . . . . . . . . . . . . . . . . . 406 Upward Mobility with the Apache Web Server . . . . . . . . . . . . . 413 Using iDisk to Share Files and Web Pages . . . . . . . . . . . . . . . . 416 iDisk and WebDAV Overview . . . . . . . . . . . . . . . . . . . 416 Accessing Your iDisk . . . . . . . . . . . . . . . . . . . . . . . . . . 417 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
Contents
Chapter 16 The Internet . . . . . . . . . . . . . . . . . . . . . . . . . 421 Underlying Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422 What Is TCP/IP? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423 How AppleShare IP Works . . . . . . . . . . . . . . . . . . . . . 426 What Is PPP? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427 Configuring the Mac for the Internet . . . . . . . . . . . . . . . . . . . . 428 Using the Network System Preferences Panel . . . . . . . . 429 Using the Internet Panel . . . . . . . . . . . . . . . . . . . . . . . 437 Browsers for Mac OS X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442 iCab for Mac OS X . . . . . . . . . . . . . . . . . . . . . . . . . . . 443 Microsoft Internet Explorer . . . . . . . . . . . . . . . . . . . . . 444 Mozilla . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444 Netscape Communicator . . . . . . . . . . . . . . . . . . . . . . . 445 OmniWeb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446 Opera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447 Exploring Internet Services . . . . . . . . . . . . . . . . . . . . . . . . . . . 447 The World Wide Web . . . . . . . . . . . . . . . . . . . . . . . . . 448 Chat Rooms and IRC . . . . . . . . . . . . . . . . . . . . . . . . . 449 Usenet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450 FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451 Telnet and SSH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
PART IV
LOOKING MORE DEEPLY AT MAC OS X. . . 453
Chapter 17 Mobile Computing . . . . . . . . . . . . . . . . . . . . 455 Using PowerBook and iBook Hardware . . . . . . . . . . . . . . . . . . 456 Battery Life and Power Management . . . . . . . . . . . . . . 458 Tips for Travelers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460 Using Software on Laptops . . . . . . . . . . . . . . . . . . . . . . . . . . . 461 Memory Management on Laptops . . . . . . . . . . . . . . . . 462 Managing Screen Space on Laptops . . . . . . . . . . . . . . . 463 Launching and Managing Applications . . . . . . . . . . . . 463
xvii
xviii
Contents
Working with PDAs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464 Communicating with Other Computers . . . . . . . . . . . . . . . . . . 470 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
Chapter 18 Automating Your Mac with AppleScript . . . . 475 What Is AppleScript? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476 Scripting Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480 Using the Script Editor . . . . . . . . . . . . . . . . . . . . . . . . 481 Generating a Script . . . . . . . . . . . . . . . . . . . . . . . . . . . 482 Saving and Compiling Your Script . . . . . . . . . . . . . . . . 484 Writing a Sample AppleScript . . . . . . . . . . . . . . . . . . . 486 Debugging AppleScript Applications . . . . . . . . . . . . . . 494 AppleScript Language Basics . . . . . . . . . . . . . . . . . . . . . . . . . . 495 Extending the Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497 Advanced Tools and Scripting Resources . . . . . . . . . . . . . . . . . 499 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
Chapter 19 Working with Unix . . . . . . . . . . . . . . . . . . . . 503 Unix and Macs: A Match Made in Heaven? . . . . . . . . . . . . . . . 504 The Philosophy of Unix: Small, Specialized Utilities . . . 505 Interacting with Unix . . . . . . . . . . . . . . . . . . . . . . . . . . 507 Accessing the Command-Line Interface . . . . . . . . . . . . . . . . . . 508 Using Unix Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509 Using the tcsh Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . 509 Listing Files and Directories . . . . . . . . . . . . . . . . . . . . 512 Creating and Using Directories . . . . . . . . . . . . . . . . . . 517 Editing Text Under Unix . . . . . . . . . . . . . . . . . . . . . . . 518 Getting Information about Unix Commands . . . . . . . . 521 Installing Other Unix Software . . . . . . . . . . . . . . . . . . . . . . . . . 523 Compatibility Issues with Other Unix Software . . . . . . 523 Mac OS X and Open Source Software . . . . . . . . . . . . . 525 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
Contents
PART V
APPENDIXES . . . . . . . . . . . . . . . . . . . . . 529
Appendix A This Is a Mac—What Could Go Wrong? . . . . . 531 Counting the Ways . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532 Pilot Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533 Bugs! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534 Configuration Errors . . . . . . . . . . . . . . . . . . . . . . . . . . 534 Viruses and Worms . . . . . . . . . . . . . . . . . . . . . . . . . . . 535 Hardware Failure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537 Diagnostic Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538 Using the Apple System Profiler . . . . . . . . . . . . . . . . . . 538 Anti-Virus Software for Mac OS X . . . . . . . . . . . . . . . 544 Disk Repair/Recovery Utilities for Mac OS X . . . . . . . 545 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548 Troubleshooting Internet Connections . . . . . . . . . . . . . 549 Analyzing PPP problems . . . . . . . . . . . . . . . . . . . 549 Analyzing Network Connectivity Problems . . . . . 556 Resolving Application Problems . . . . . . . . . . . . . . . . . . 560 Terminating Applications . . . . . . . . . . . . . . . . . . . 562 Mapping Files to Applications . . . . . . . . . . . . . . . 564 Deleting Locked Files . . . . . . . . . . . . . . . . . . . . . 565 Restarting Applications After They Crash . . . . . . 567 Mac OS X Compatibility Issues . . . . . . . . . . . . . . . . . . 568
Appendix B Where to Go for More Information . . . . . . . . 571 Mac OS X General Information Sites . . . . . . . . . . . . . . . . . . . . 572 Mac OS X Applications, Tips, and Support Sites . . . . . . . . . . . 573 Mac OS X Developer Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574 Unix and Linux Utilities for Mac OS X . . . . . . . . . . . . . . . . . . 575
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
xix
Introduction So what is the big deal about a new operating system from Apple? Just those very words: new, operating, system, and Apple are enough to get the blood of every Mac geek on the planet boiling with anticipation. But why should the rest of us care? Having specialized in the Linux operating system for several years, I thought it was going to be quite a leap for me to jump back to the Mac system and produce a book about the latest and greatest from Apple. I had followed along the progression of Mac OS, of course, from its humble beginnings with System One to the sophisticated OS 9. I learned computers on a Mac. Mac was my first graphic user interface and it would shape my expectations for all operating systems for years to come. But my presumptions regarding how hard it would be were wrong. OS X, it seems, has more similarities to the Linux operating system than anything that has ever come out of the Apple corporate offices. The more I researched the coming operating system, the more excited I got. The jump from OS 9 to OS X in terms of computer architecture is akin to the leap from the piston engine on an airplane to a turbine engine. Both engines will make a plane fly, but the turbine engine will make the plane fly a heck of a lot faster. Exaggeration? Hardly. And the beauty of OS X is not that it has become more complex. Rather, it has become more simple. Complexity has been weeded out of the architecture, as the developers of OS X realized that the simple structures are the most stable. In this book, we will take a close look at this underlying architecture of OS X, so you can see first-hand what all the fuss is about. But more importantly, we’re going to show you how to use OS X to accomplish all the things you want to do with your computer: install new software, record music CDs, edit digital movies, and more. We’ll also show you how to do these tasks efficiently by putting pertinent information in Notes, Tips, and Cautions. What is the big deal about a new operating system from Apple? It’s an operating system made to be used by all kinds of users—from geeks to newbies. It’s an operating system built for you.
PART 1 Upgrading to Mac OS X 2 Exploring the Desktop 3 Setting Preferences 4 Connecting with OS X 5 Exploring the New Finder 6 What’s under the Hood? 7 Working with Applications 8 Sherlock
I
Basic Mac OS X
This page intentionally left blank
Chapter 1 Upgrading to Mac OS X
4
Part I
Basic Mac OS X
t is the American success story that we’ve all heard before: two guys in a Los Gatos, California, garage put their heads and talents together to build and market what has been called the world’s first desktop personal computer.
I
“…So, I never went back to work for Lieutenant Dan. Though he did take care of my Bubba-Gump money. He got me invested in some kind of fruit company. And so then I got a call from him saying we don’t have to worry about money no more. And I said, ‘That’s good. One less thing.’“
This event was the beginning of the information revolution, although —Forrest Gump on Apple Computer, Inc. few realized it at the time. The introduction of inexpensive, easyto-use personal computers meant that the general public would finally have access to the computing power previously reserved for large businesses. Of course, the road to the revolution was not exactly paved with gold. There were several potholes along the way for this fledgling company called Apple Computer. But even in its failures, Apple was able to break new ground and accomplish new things that no other company had accomplished before. That’s the marketing version of the beginnings of Apple, which most Macintosh users have at least some inkling of. The story of Steve Wozniak’s and Steve Jobs’s work in that Los Gatos garage (just down the road from Apple’s present Cupertino world headquarters) has reached near-mythical levels for anyone interested in Macintosh computers. I won’t rehash the story here; this is not a biography. But it is important to note that by trying new things, whether they were successful or not, Apple has broken a lot of new ground. Lisa, the predecessor to the Macintosh, was the world’s first PC with a graphical user interface (GUI). The LisaOS, with its windows and menus, was based on design work performed at the Xerox Palo Alto Research Center, but it was Apple that put the interface out to consumers. Lisa ultimately failed, done in by a high sticker price and the release of Macintosh, but even in its failure it showed the world something more than a command-line interface. Nearly 10 years later, in 1993, Apple released the world’s first PDA (personal digital assistant): the Newton. Although it was a dismal commercial failure, Newton paved the way for more successful PDAs, such as the Palm Pilot.
Upgrading to Mac OS X
Chapter 1
Not every Apple venture was a failure, of course. You already know the success of the most famous Apple product: the Macintosh. Having entered the market at the right price and performance level, this little beige box introduced a GUI computer to the masses far more effectively than its predecessor, Lisa, did. Macintoshes have always been unique in the computer industry, even after Microsoft Windows came along and “borrowed” the concept of the Mac OS GUI for its own interface. That’s because Apple was in the unique position of being able to build both the hardware and the software, which made the operating system and the hardware more compatible Windows-based systems. But there was a catch: Macs were tied to the Mac OS. Updates to the Mac OS added new features, but neither the interface nor the underlying technology (which was linked to the Motorola 68000-series CISC processors that Macs used) changed significantly. Changes in hardware altered the Mac OS technology forever. In 1994, Apple was moving toward the PowerPC (PPC) architecture, which was replacing CISC processors. But the first PPC devices still ran the original Mac OS (which was up to System 7 by then). For the older software to run on a PPC, the PPC processor, now based on RISC technology, had to expend many resources emulating an older CISC processor. So, unless users were working with software specifically created for the PPC, they would not get the full value of the PPC processors. Consumers noticed the problem. Apple created a new operating system, codenamed Copland, that broke away from the traditional Mac OS architecture, but maintained compatibility (to the highest degree possible) with older Mac software. It also brought protected memory and preemptive multitasking to the Mac, two features that the Mac OS desperately needed to compete with other operating systems. Copland proved too difficult to accomplish, leading Apple to dump the project and salvage some of the new technologies for the next release of Mac OS 8. Another effort would be made for a new operating system—codenamed Rhapsody. Rhapsody would not be created solely by Apple’s in-house developers. Apple’s executives decided that it would take an old hand to guide the company in a new direction. In 1996, Apple announced the acquisition of NeXT, Inc.—the makers of the OpenStep operating system—founded and led by Steve Jobs. By borrowing architectural elements from OpenStep, Apple could more easily incorporate protected memory and preemptive multitasking in Rhapsody—something Apple
5
6
Part I
Basic Mac OS X
thought would have to wait until a later version of Mac OS, codenamed Gershwin. The Apple/NeXT union also allowed for the inclusion of a “Blue Box”—a separate environment that would run older versions of Mac software with ease. All of this was promised in 1996, with a target completion date of 1998. Rhapsody was not delivered on time, because merging the disparate technologies proved harder than predicted. Apple released interim versions of its original operating system, with OS 8 coming out in July 1997, and OS 9 launching in October 1999. Mac OS 8 and 9 were valuable updates, and they introduced many new features to take better advantage of the PPC technology. But they were no Rhapsody, the core technologies of which were eventually rolled into the Mac OS X project. Rhapsody, just to add to the confusion, became the codename for Mac OS X Server 1.0. The X in Mac OS X stands for 10, but why did Apple use the Roman numeral rather than the Arabic numeral? The X is a reminder that the architecture of Mac OS X is a very similar architecture to UNIX, BSD, and Linux—command-line interfaces. For the first time in the Macintosh line, Apple has introduced what is essentially a command-line operating system. This move may seem like a step backwards, but as you will learn from this book, the new architecture of Mac OS X enables the operating system to be more powerful and more flexible than any previous Mac OS.
NOTE For more detailed information on the architecture of Mac OS X, see Chapter 6, “What’s under the Hood?”
All of this is exciting to the geeks among us, but what does it mean for someone who just wants to run a Mac? It means some significant changes in the way you use your Mac. For example, OS X has an interface unlike anything a Mac (or Windows) user has ever seen. The payoff for moving over to Mac OS X far exceeds the amount of effort you put into learning it. The new OS offers faster speeds for your daily operations because the operating system can take full
Upgrading to Mac OS X
Chapter 1
advantage of the processor. It also offers more stable applications, thanks to the new multitasking capabilities. You’ll get more out of your Mac than ever before. Presumably, if you’ve come this far, you’re more than a little interested in getting Mac OS X on your system, so you don’t need the sales pitch. You are likely more interested in figuring out how much of a rigmarole you’re going to have to endure to get Mac OS X on your system. For the remainder of this chapter, you’ll examine the options you have when you begin using Mac OS X, and you’ll walk through the steps you must take to get your system ready to install Mac OS X.
Upgrade or Trade Up? Whenever it’s time to upgrade to a new operating system, every user decides whether to upgrade what he has or to buy something new. For non-Mac users, this has always been a concern because new operating systems are much more memory- and processor-intensive than their predecessors. Mac users typically do not have this problem, because all of the versions of Mac OS are geared to perform with all of the products that shipped after the release of a particular OS. Typically, this OS is 8.0, which began shipping in the fall of 1997. A product released with an earlier version of Mac OS might not be compatible with Mac OS X, even if it has been upgraded to OS 9.2.1, which is what OS X needs to run its Classic environment. Mac OS X requires any Mac with an Appleinstalled G3 or faster processor and 128MB of RAM. That means the original Power Macintosh G3 (Fall 1997) and later systems can accommodate Mac OS X, but nothing earlier. Unfortunately, there is always an exception to the rule. If you have an original PowerBook G3, which was released in November 1997, you cannot run Mac OS X. This is because, unlike the PowerBook G3s that came out in March 1998, the first PowerBook G3 was closely related to its predecessor, the PowerBook 3400. The 1998 version of the PowerBook G3 was completely redesigned and resembled the 1997 version in name only. The 1998 version of the PowerBook is compatible with Mac OS X. Table 1.1 lists all the Apple computer models that are compatible with Mac OS X version 10.1. This table includes the initial release and manufacturing termination dates of the computers to help you identify computers with similar model names.
7
8
Part I
Basic Mac OS X
Table 1.1 Mac OS X 10.1 Compatible Computers Computer
Market Release Date
Termination Date
Power Mac G3
November 1997
January 1999
Power Mac G3 All-in-One
March 1998
September 1998
Server G3
March 1998
January 1999
PowerBook G3 Series
May 1998
August 1998
iMac
August 1998
January 1999
PowerBook G3 Series (Rev. 2)
August 1998
May 1999
iMac (Rev. C)
January 1999
April 1999
Power Mac G3 (Blue & White)
January 1999
September 1999
iMac (Rev. D)
April 1999
October 1999
PowerBook G3 Series (Bronze Keyboard)
May 1999
February 2000
iBook
September 1999
September 2000
Power Mac G4 (AGP)
September 1999
July 2000
Power Mac G4 (PCI)
September 1999
December 1999
iMac (Slot Loading)
October 1999
July 2000
iMac DV/SE
October 1999
July 2000
iBook SE
February 2000
September 2000
PowerBook (FireWire)
February 2000
January 2001
iMac DV (Summer 2000)
July 2000
February 2001
iMac DV SE (Summer 2000)
July 2000
February 2001
iMac DV+
July 2000
February 2001
Power Mac G4 (Gigabit Ethernet)
August 2000
January 2001
Power Mac G4 Cube
August 2000
July 2001
iBook/SE (FireWire)
September 2000
May 2001
iMac (Summer 2000)
September 2000
February 2001
PowerBook G4
January 2001
October 2001
Power Mac G4 (Digital Audio)
January 2001
July 2001
iMac (Early 2001)
February 2001
July 2001
Upgrading to Mac OS X
Chapter 1
Table 1.1 Mac OS X 10.1 Compatible Computers (continued) Computer
Market Release Date
Termination Date
iMac SE
February 2001
July 2001
iBook (Dual USB)
May 2001
October 2001
iMac (Summer 2001)
July 2001
Still in production
Power Mac G4 (Quicksilver)
July 2001
January 2002
iBook (Late 2001)
October 2001
Still in production
PowerBook G4 (Gigabit Ethernet)
October 2001
Still in production
Power Mac G4 (Quicksilver 2002)
January 2002
Still in production
iBook (14.1”)
January 2002
Still in production
iMac (Flat Panel)
January 2002
Still in production
Any equipment listed in Table 1.1 must have started out as that equipment. Many Power Mac machines left the factory as something else and were upgraded for Power Mac G3 or G4 capabilities with new processor cards. As with the first PowerBook G3, only the new processor resembles the G3 and G4 series—the rest of the computer still has an older configuration that Mac OS X will not handle. You must also consider the supported platforms for Mac OS X. Although Mac OS X may work on Mac clones made by other manufacturers, Apple will not offer technical support if you want to use Mac OS X on one of those machines. Another area to focus on is how individual components within your Mac will interact with OS X. Even if your system as a whole is compatible, you still have to make some choices if you have certain kinds of hardware. For instance, some users may have installed third-party video cards in their machines (particularly in Power Macs). OS X has problems with many of these third-party video cards. Currently, only ATI and NVIDIA produce video cards that function with OS X, and not all of their products do. (The defunct iXMicro also produced compatible video cards.) Visit the Web sites of your hardware manufacturers before you upgrade to OS X. Give yourself time to plan for any changes.
TIP An excellent source for links to third-party hardware vendors is the OSX compatibility list at MacAddict (http://www.macaddict.com/osx/mlist.html).
9
10
Part I
Basic Mac OS X
The only other potential hardware bugaboo is the 128MB of RAM recommended to run Mac OS X. If you don’t have that much RAM on your computer, you must upgrade your system. You can run Mac OS X with just 64MB, but if you need to run older applications in the Mac Classic environment, that minimal memory configuration will not work. As you will learn in Chapter 7, “Working with Applications,” running applications in Classic mode (the end result of the Blue Box technology gained in the Apple/NeXT union) requires a lot of memory. Few OS X-specific applications are available, which means that 128MB of RAM is a recommendation you should take as a requirement. With all of this information in hand, you can see that most Apple computer owners with machines made later than November 1997 don’t need to fully replace their machines. This is good news for the pocketbook, but bad news for the techno-geek that wanted to use this operating system as an excuse to buy a new computer.
Software Compatibility New operating systems are like new houses: they all have the same kind of rooms—bedrooms, kitchens, bathrooms—to hold all of your furniture. However, what worked in one house may not exactly work in the next. Maybe the new family room’s ceiling is too low to handle your 100-inch home theater system or maybe the green gingham pattern that worked in the old bathroom doesn’t quite mesh with the burnt orange walls in the new bathroom. Although most houses work on (basically) the same design principles, moving from one house to another is not always a smooth transition. The same premise holds true for a new operating system. All operating systems have one main task: to facilitate communication between human users and the hardware that comprises their computer systems. The operating system uses the computer’s hardware, which speaks a language all its own, to accomplish tasks. For example, when you click on an application icon to start a program, the operating system interprets that command and relays it to your computer’s hardware components. Those components find the stored application on your hard drive, launch the program, and display the results on your screen. Although all operating systems perform these tasks, the way that they perform them differs. Different operating-system designers have different ideas of how to get things done, and their products reflect that. Even different versions of the
Upgrading to Mac OS X
Chapter 1
same operating system have varied methods of handling the same tasks. This is a very simplified view of why there are operating-system inconsistencies, even among different versions of the same OS. It demonstrates why you must make sure that the software and hardware on your machine will still run after you install Mac OS X. The simple truth is that Mac OS X is quite different from Mac OS 9. Mac OS X has a completely different architecture running underneath all of its snazzy new windows and menus. If you were to try to run a pre-OS X application directly on OS X, it would not work. You would have better luck running an older UNIX application on an OS X machine. To get around this, Apple includes a Classic environment within which older applications can run. Classic is any Mac OS 9 installation on your hard drive that Mac OS X can launch. When you open a Mac OS 9 application while running OS X, it will activate your Mac OS 9 installation as the Classic environment. Once Classic has started up, the Mac OS 9 program you double-clicked will open. This raises the number of older applications that run within OS X from zero to something like 15,000. The best place to check whether your software will run with OS X is the Classic Compatibility List at http://guide.apple.com/macosx/index.lasso (see Figure 1.1).
Figure 1.1 Checking for Classic compatibility
11
12
Part I
Basic Mac OS X
Here, you can enter the names of your applications and check whether they meet Apple’s standards for Classic compatibility. If your application does not appear here, that does not mean it won’t run on Mac OS X. Maybe the application is so new that it is not on the list yet, or, the application is old enough that is no longer maintained in Apple’s databases. Any Mac OS 9 applications that directly access the Macintosh’s hardware (such as third-party hardware products like video cards or TV tuners) will not work in the Classic environment. Mac OS X isolates Classic to prevent this from happening because it was a big reason for some OS 9 system incompatibilities.
TIP Apple keeps a small list of discontinued software applications on which it has performed rudimentary Classic testing. You can view this list at http://guide.apple.com/ macosx/discontinued.lasso.
Upgrading to OS X should be relatively painless as far as the software is concerned. There will be glitches, however—particularly with older applications—so check with the software developers of any of your critical applications to see if there are any outstanding OS X issues.
Backing Up Data You’re about to make some significant changes to your computer. Quick: what’s the one thing you should do before installing OS X on your machine? If you said, “back up my data,” you are correct. Backing up your data is one of the most critical (and often overlooked) safety precautions you can perform on any computer. But many users ignore advice about backing up their systems until something really bad happens and prevents them from accessing their files. “My computer never crashes,” and “backups take too long,” are common excuses. (Never mind that the costs in time and stress are huge if data is lost.) Whenever you perform a major task, such as upgrading your operating system, put aside any hesitation about backing up the information on your computer. Although most upgrades of this sort are ultimately beneficial to the computer, there are never any guarantees in life. It’s up to you to cover all the bases when performing significant system changes on your computer.
Upgrading to Mac OS X
Chapter 1
Hard Drive Backups are difficult to manage, and the lack of backup media available is a real concern. Many users don’t have tape backup drives or access to networks where they can store their backed-up files, so they don’t think they can perform a backup. However, if you have access to the Internet, you have access to off-site storage space. How much you should back up depends on how much storage space you have. If you have a tape drive or network drive, your limitations are only the amount of tape or the amount of free space available on the network drive. Using compression, you can probably perform a full system backup. Another popular backup method is to use a CD-R drive to burn your data onto CDs. This is a good method, but unless your backup software can bridge a single backup file onto multiple CDs, your backup file size will be limited to 650–700MB. This is still a pretty good size, however. Backing up an entire system on CDs is not practical, but you can back up your irreplaceable personal data files and documents on CDs. If your hard drive were ever to die, you could reinstall the applications from the original disks. This is time-consuming but relatively straightforward. Personal documents and data, however, could be lost forever. A third storage technique is to use the Apple iDisk. The iDisk is a free 40-MB Internet storage area and is part of the Apple iTools set, which is a free set of online tools for Mac OS 9 and OS X users. You can purchase additional storage space for your iDisk—up to 1 GB. This offsite storage location is an excellent location for small backup files. For further discussion of iTools and iDisk, turn to Chapter 15, “The Personal Web Server.” Now you need a tool that performs the backup. Apple does not include a backup application in its standard utilities. Fortunately, there are plenty of very good commercial applications to handle the load (many such applications are delivered with specialized backup hardware, such as tape drives). More importantly, there are some good shareware applications to handle backups. One such application is Tri-Backup from the French software development company Tri-EDRE (http://www.tri-edre.com/) Tri-Backup is an excellent program that sells for only $49.00 US, and it has a 30-day free trial period. The following Task shows you how to perform a one-time backup of your most important files.
13
14
Part I
Basic Mac OS X
Tri-Backup has a lot of nifty features, including automated incremental backups that will start whenever you need them to. You won’t need this to prepare your system for upgrade, however. All you need to do is perform a one-time backup of your most important personal files, as shown in the following Task.
Task: Using Tri-BACKUP to Perform a Backup 1. Double-click the Tri-Backup 3 folder on your desktop or hard-drive folder. 2. Double-click the Tri-Backup 3 US application icon to open the TriBackup program (see Figure 1.2).
Figure 1.2 The main Tri-Backup window
3. To begin a full system backup, click the Create button to open the New Action dialog box (see Figure 1.3). 4. Type a new name for the backup session in the Name of this Action field. 5. Confirm that the Mirror Backup option is selected, then click the Items tab to open the Items page (see Figure 1.4). 6. Click on the “+” icon to open the Open dialog box. 7. Select the hard drive(s) to back up, then click Choose to close the Open dialog box and place the selection in the Backup field.
Upgrading to Mac OS X
Chapter 1
TIP You can also drag and drop the desired drives and folders into the Backup field.
Figure 1.3 Choosing the type of backup you need
Figure 1.4 Deciding what to back up
15
16
Part I
Basic Mac OS X
8. Click anywhere in the In field to open the Open dialog box once more. 9. Select the destination folder for the backup file, click Choose to close the Open dialog box, and place the selection in the In field.
TIP You can also drag and drop the desired folder into the In field.
10. Choose either the All Files or Documents Only option.
NOTE All Files will grab all files, like the name implies, whereas Document Only will select only user-created files for backup.
11. Click the Options tab to open the Options page (see Figure 1.5).
Figure 1.5 Finalizing backup options
Upgrading to Mac OS X
Chapter 1
12. Choose the options that will benefit you the most. ◆ For systems with limited storage capacity, make sure you select the Compress Files option. ◆ If you plan to use CD-Rs to store your backup files, select the Partition the Backup option, and make the maximum size of each partition no more than the maximum capacity of your CD-Rs. 13. Click on Save to close the System Backup dialog box. 14. In the main Tri-Backup window, select the System Backup action and click Run. Now start the backup (see Figure 1.6).
Figure 1.6 Running the backup
Internet Settings If IT help desk personnel could point to the most common user problems, they would be, “I forgot my password,” and “I forgot my login name.” Help desk personnel are no doubt numb to login and password requests, but you can make things easier for yourself and them by keeping track of this information.
17
18
Part I
Basic Mac OS X
When you upgrade to OS X, your current settings for connecting to the Internet will probably be carried over to the new operating system, particularly if you connect to the Internet through a network. OS X changes or loses the information during the installation process, particularly if you have chosen to do a clean install of OS X or use a dial-up service to connect to the Internet. No matter how you connect to the Internet, you will have at least one configuration set to secure after the upgrade: your e-mail account settings. If you connect to the Internet via a modem, you will have to configure the settings, logins, and passwords for that account. Instead of scrambling around to all of your Internet client applications to make notes of all of the settings and configurations, just visit the Internet Control Panel and gather all the information from one place, as shown in the next Task.
Task: Gathering Internet Connection Settings 1. Select Apple, Control Panels, Internet to open the Internet Control Panel window (see Figure 1.7). 2. Click on each successive tab in the window, jotting down all of the information you need.
Figure 1.7 The home of Internet settings
Upgrading to Mac OS X
Chapter 1
3. Select File, Quit to close the window.
TIP If you have a safe or other fire-protected box, store your Internet information there. If not, place your information in a resealable plastic bag and put the bag in your freezer. The freezer is more fire-protected than any other place in the house.
Prepping Your Hard Drive Because it is a very good idea to install OS X to run alongside OS 9, you may be wondering about the best way to set up your hard drive. In other systems, you may need to place each OS on a different hard-drive partition. This used to be the case with the Mac OS, too. In the past, each version of a Mac OS needed its own partition (or volume). Users chose which operating system to engage by using the Startup Disk utility to select which partition (and therefore which operating system) would boot up. Doing so is not necessary when using OS X alongside an earlier Mac OS. It is now possible to load two System Folders (where most of the operating system’s code resides) onto the same hard drive. OS X uses a new utility called System Disk, which lets users choose which OS to load on startup. It is possible to partition your drive. But you should do this only if you use a lot of Classic applications and do not want to see a performance hit on your OS X applications by running them on the same drive. A very strong word of warning: if you have only one drive to partition, make sure that everything on your drive is backed up! Also, because OS X needs at least 1.5GB of drive space, don’t bother partitioning if your hard drive is less than 12GB. Before setting up that new partition, check your disk for any directory-structure issues that might trip you up during the upgrade. Disk First Aid is a simple and effective way to check the directory structure of the drives and partitions on a preOS X system, as you will see in the next Task.
19
20
Part I
Basic Mac OS X
Task: Checking Your Hard Drive 1. Using Finder, click to open the Main Hard Drive\Applications\Utilities folder. 2. Double-click the Disk First Aid icon to open the application (see Figure 1.8).
Figure 1.8 Opening Disk First Aid
3. Click on the volume or drive you want to check. 4. Click on Verify to begin the checking process. 5. If any errors appear, make your repair decision and click on Repair if you agree. 6. Select File, Quit to close the application. After everything on your hard drive has been checked and repaired, you can partition the drive to your specifications. If the volume you want to repartition is also your startup disk, you can’t do anything to your volume. Making a significant change from the drive you want to boot to isn’t possible because your computer is currently using the operating system installed on it. It would be like fixing a car engine while it’s still running. If you don’t need or want to partition, move on to the “Installing Mac OS X version 10.1” section later in this chapter.
Upgrading to Mac OS X
Chapter 1
TIP If there is some damage to your disk that Disk First Aid cannot repair, try using Norton Utilities or Micromat TechTool Pro.
Fortunately, you can use the Software Restore CD-ROM that came with your Mac to start the application to partition your drive’s volumes, as illustrated in the next Task.
Task: Setting Up New Volumes on Your Mac Hard Drive WARNING I cannot emphasize this enough: perform this procedure only if you have backed up everything on the drive you plan to repartition! Also, be sure you have upgraded to at least Mac OS 9.1.
1. Insert the System Restore CD-ROM that came with your Mac. 2. Select Special, Restart to turn off the Mac. 3. While the system restarts, press and hold the C key to force the system to boot to the operating system on the CD-ROM. When booting is complete, you see a special CD desktop with the main folder for the CD opened. 4. In the open Finder window containing the CD’s contents, open the Utilities folder. 5. Double-click the Drive Setup icon to start the application. 6. Click on the drive partition to select it. 7. Click the Initialize button to open the Initialize dialog box. (Don’t worry about the warnings; that’s why you backed up your system.) 8. Click the Custom Setup button to open the Custom Setup dialog box. 9. In the Partitioning Scheme field, select the 2 Partitions option. 10. Click on the Mac OS Extended option to select it.
21
22
Part I
Basic Mac OS X
11. Click on OK to close the Custom Setup dialog box. 12. Click on Initialize. The entire drive will be initialized with the two partitions in place. Now you have two empty partitions on your computer. Rename them something descriptive to avoid any confusion. This is why you used your Software Restore CD-ROM to perform this operation. In the main folder of the Software Restore disk, double-click the Restore icon to start the process for getting your system back to its original configuration (although now there are two drive volumes to work with).
NOTE Although on most Macs it does not matter which partition you restore the older operating system to, on Power Mac G3s (Beige), non-USB PowerBook G3s, and iMacs (revs. A-D), the Mac OS X partition must be on the first 8 GB of the hard drive.
When the system’s software is restored, you can quickly reinstall your backup software and then restore your personal files and applications. If you have all your backups, none of this is especially problematic; it’s just time consuming. When all is said and done, you should have all of your current files and applications on the volume named “Macintosh HD,” and the other named “untitled 2.” It might make sense to name those volumes something more descriptive. To do so, simply click once on the drive icon to select the label, then type in the new name. That’s all there is to it!
Installing Mac OS X version 10.1 Finally, after loads of preparation, you are ready to install OS X. Although the preparation may have seemed like overkill, you will appreciate it if anything goes awry. To achieve the best results with your installation of OS X, you need at least OS 9.2.1 installed on your system. Fortunately, OS X includes an OS 9.1 or higher installation CD in the box. For OS X v. 10.1, OS 9.2.1 is included. If you already
Upgrading to Mac OS X
Chapter 1
have OS 9.1, you really should upgrade to OS 9.2.1., but in the next Task, you will learn to upgrade to Mac OS 9.2.1.
Task: Upgrading to Mac OS 9.2.1 NOTE If you have Mac OS 8.1 or lower on your system, start the system with the Mac OS 9.2.1 CD. Proceed with the installation as directed.
1. Insert the Mac OS 9 CD that came with your OS X software to open the main folder of the CD. 2. Double-click the Mac OS Install icon to open the Installation program (see Figure 1.9).
Figure 1.9 Starting the upgrade process
3. Click the Continue button to proceed to the next screen. 4. Select a Destination Disk to install the upgraded OS.
NOTE Make sure that the Destination Disk resides on the first 8 GB of your hard drive if you are using an older system. If you created a separate partition for OS X on your hard drive, make sure you install to that partition!
23
24
Part I
Basic Mac OS X
5. Click the Select button to finalize your choice and open the Important Information page. 6. After reading the Before You Install document, click on the Continue button to read the Software License Agreement. 7. After reading the Software License Agreement, click on the Continue button. 8 The Agree/Disagree dialog box appears. Click on Agree to continue to the Install Software page. 9. Click on Start. The restart warning box appears. 10. Click on Continue to close all running applications and begin the upgrade process. 11. When the files are finished copying, click the Restart button to restart the computer.
NOTE You must go through the Setup and Internet Setup Assistants after OS 9.2 starts up again so that any Classic application that uses the Internet will be able to use the Internet again. This is where your Internet settings records come in handy.
When OS 9.2.1 is up and ready to go, it is time to install OS X.
Task: Installing Mac OS X v. 10.1 1. Insert the Mac OS X CD to open the main folder of the CD. 2. Double-click the Install Mac OS X icon to open the Installation program. 3. Click the Restart button to reboot your Mac and begin the installation process. 4. After a lengthy reboot, the Mac OS X splash screen displays status updates, followed by the Installer dialog box. Select the appropriate language option. 5. Click Continue to open the Introduction page of the Install Mac OS X dialog box. 6. Click Continue to open the Read Me page.
Upgrading to Mac OS X
Chapter 1
7. After reading the text, click Continue to open the License Agreement page. 8. After reading the License, click Continue, then click Agree to open the Select Destination page. 9. Click on the drive volume where you want to install OS X. 10. Click Continue to open the Installation Type page.
TIP If you want to save some room on your system, click the Customize button on the Installation Type page and then click on all the options you do not think you will need under Localized Files. If you remove them all, you save about 120MB in the installation process.
11. Click the Install button to begin the installation.
NOTE When you install OS X, don’t believe the times on the Time Remaining status reports. What is initially reported as a two-hour install time is actually closer to 10 minutes, depending on your machine.
12. After the files are copied to your hard drive, the system restarts, and the Welcome screen appears. 13. Select the country in which you reside, and click Continue to open the Keyboard Layout page. 14. Select the appropriate keyboard layout and click Continue to open the Registration Information page. 15. Enter your information in the appropriate fields and click Continue to open the A Few More Questions? page. 16. Select the appropriate information and click Continue to open the Thank You page. 17. Click Continue to open the Create Your Account page.
25
26
Part I
Basic Mac OS X
NOTE In OS X, every user must have his or her own login account. This enhances security and makes multi-user configuration much easier.
18. Enter the appropriate information then click Continue to open the Get Internet Ready page. 19. Click on the option you desire for establishing Internet access then click Continue. 20. On the How Do You Connect page, select the appropriate option then click Continue to open the configuration page for that connection type. 21. Make the appropriate settings on the connection configuration page and click Continue to open the Get iTools page. 22. Click the I’ll Set Up an iTools Account Later option. (For discussion of iTools and iDisk, turn to Chapter 15, “The Personal Web Server.”) 23. Click Continue to open the Now You’re Ready to Connect page. 24. Click Continue to complete the registration process and open the Set Up Mail page. 25. Enter the necessary information and click Continue to open the Select Time Zone page. 26. Using the world map, choose your time zone (a good way to do this is clicking your area on the map, which will quickly reduce the choices of time zones) and click Continue to open the Thank You page. 27. Click Go to close the Setup Assistant screen and start OS X.
Summary After a long journey, you finally have Mac OS X on your computer. And as you can see in Figure 1.10, it looks pretty darn good.
Upgrading to Mac OS X
Chapter 1
Figure 1.10 The opening OS X desktop
Now that you have OS X installed, you’ll want to play with all the nifty features and admire the unique Aqua interface. Try things out, then come back for Chapter 2, “Exploring the Desktop.”
27
This page intentionally left blank
Chapter 2 Exploring the Desktop
30
Part I
Basic Mac OS X
fter you have OS X up and running, you will probably explore the new interface before you even touch the manual. Rather than being daunted by significant change, users often want to explore, and discover what’s new on their own. They are seeking that “aha!” experience. When you finish with your own “aha!” experiences with the OS X desktop, you are ready to learn more about the new desktop components.
A
The Classic Finder Is Now the Desktop Probably the first thing you’ll notice on the OS X desktop is the integration of the Finder into the desktop. Who am I kidding? You’re probably checking out that big Dock on the bottom of the screen. Well, bear with me for a moment; the Dock will be discussed shortly. First, look at the other components of the OS X desktop. They provide different ways to manipulate data on your Mac. The elements of the new OS X desktop are highlighted in Figure 2.1. Some are familiar aspects of the Mac interface, and some, like the Dock at the bottom of the screen, are completely new. Experienced Mac OS users might not be thrown too much be the various elements of the OS X interface. After all, the venerable Apple menu is still present, and, at first glance, the Finder window isn’t that much different. The functionality, however, is revamped. So is the Apple menu, which you might expect to be the same after all these years. The Dock is new, and the application menu has been moved to the other side of the menu bar. The icons and aliases are more robust in appearance, but they have much the same functionality as they did in earlier versions of Mac OS. Early beta versions of OS X had a clear desktop, devoid of all icons. Beta users responded negatively to the clear desktop, so Apple worked the icons back onto the desktop. The minimalist approach is still very much evident, however; only the hard drive icons and one folder alias to the previous OS’s desktop are visible after you install OS X. Apple wanted to encourage users to work with the application and alias icons more in the Dock than on the desktop. Once you see the Dock in action, you’ll see why.
The Dock Superficially, the Dock resembles the Control Strip. Who would fail to notice the similarity between two narrow bars that run along the bottom of the desktop and
Exploring the Desktop
Apple Menu
Menu Bar
Chapter 2
31
Application Menu
Drive Icons
Finder Toolbar Finder Window
Dock Figure 2.1 The desktop components of OS X
contain icons? But that’s about as far as the similarity goes. Although the OS X Dock looks like a one-to-one replacement for the Control Strip in earlier versions of Mac OS, it actually replaces far more than just the Control Strip. The Control Strip, which debuted on PowerBook desktops as a way to maximize efficiency, was later used for all Mac OS desktops. It contained icons that directly accessed applications and basic functions of the Apple Control Panel. The OS X Dock functions more like the old Mac Launcher, because now all the different Control Panel-like functions are accessed through a single System Preferences icon. The Dock also takes over some of the functions of the old Apple menu, which was the primary way to access frequently used applications. Now the Dock manages those applications. The Apple menu is still around but it has a new set of functions, as you will learn in “The Apple Menu” section later in this chapter. The Dock is also capable of switching between open applications. In previous versions of Mac OS, the Application menu handled this, but in OS X, the application menu does not perform this function any longer. Now the Dock stores icons for your favorite applications and for every running application.
32
Part I
Basic Mac OS X
Managing Applications When you install OS X, the Dock appears at the bottom of the desktop. It holds icons representing eight applications, an Internet link, and the Trash can. The icons are divided into two sections in the Dock (see Figure 2.2). These two sections perform different functions.
Application Section
Resizing Bar Alias Section
Figure 2.2 The components of the OS X Dock
On the left side of the Dock is the Application section. Only applications appear here. When you install OS X, there are eight applications on the Dock, though this amount is by no means set in stone. Interface designers thought users would access these applications most often. The following is a list of the handy applications displayed on the Dock. ◆ Finder
◆ iMovies
◆ Mail
◆ Sherlock
◆ Internet Explorer
◆ QuickTime Player
◆ iTunes
◆ System Preferences
Exploring the Desktop
Chapter 2
On the right side of the Dock is the Alias section. Only files, folders, and Internet shortcut icons—not applications icons or folder aliases—reside here. This may seem like a limitation if you like to customize everything, but this organization makes a lot of sense in managing your desktop with the Dock. The icons on the Dock should be clear enough that you can recognize them. If you don’t recognize an icon, you can quickly deduce what it represents, as you will see in the following Task.
Task: Opening Docked Applications 1. Move your cursor over an icon on the Dock. A text label describing the icon’s application is displayed. 2. Click the application you want to open. The icon bounces up and down a few times on the Dock (see Figure 2.3), and the application window opens.
Opening Application
Figure 2.3 A bouncing icon symbolizes an opening application.
33
34
Part I
Basic Mac OS X
You need to click only once. On the desktop and in the Finder windows, however, you need to double-click on all icons to open their applications, folders, and so on. This is because single-clicking desktop and Finder icons allows you to create aliases, rename icons, and make duplicates. You can perform another action, however, by clicking and holding a Docked application icon, and I’ll get to that in a moment. The bouncing application icon denotes that an application is about to open. The icon bounces as long as the application is in the startup process. For some applications, like QuickTime Player, that means the icon will bounce twice. But for something more memory-intensive like iMovie, the icon might bounce several more times. The bouncing animation also serves a more useful purpose. If you have several applications open at the same time, but one of the applications requires your attention, the icon bounces really high until you switch to that application and take action.
NOTE If you don’t like the open-application animation, or you suspect it might be using valuable system resources, you can turn the animation off. You will learn how to do this in the “Customizing the Dock” section later in this chapter.
In earlier versions of Mac OS, when you open an application—whether from the Apple menu or the Finder window—the Finder menu bar is replaced with the application’s menu, and the application’s window(s) appear on the desktop. Repeating this action does the same thing, moving the first application into the background. To switch between applications, you could use one of two methods. First, you could minimize or close the foreground application’s window to reveal the background application’s window. A single click on that window would immediately make that background application active. This method almost always worked, but it was a rather brute-force approach. A much more elegant approach was presented by the Application menu. By listing every open application, the Application menu enabled users to easily switch between open programs. But in OS X, the Application menu no longer exists.
Exploring the Desktop
Chapter 2
Does this mean that you have to use the brute-force method of switching applications after all? Hardly. The function of application-switching has simply been incorporated into the Dock. After you open an application, its icon within the Dock will have a small status indicator underneath it to signify that the application is running. This indicator is subtle (it was clearly designed to be unobtrusive) and is hard to spot upon first glance. As you can see in Figure 2.4, the indicators are small black triangles on the bottom of the Dock.
Application Running Status Icons Figure 2.4 Here, five applications are shown running in the Dock.
Switching between running applications is very simple: just click on any icon that has the Running status icons underneath it in the Dock and the appropriate menu bar and application windows immediately appear on the desktop.
TIP If you have closed all of the windows of a running application, clicking on the Docked application icon opens the default window and the menu bar for that application.
35
36
Part I
Basic Mac OS X
You can also use the Dock to quickly switch between multiple windows of a single application. Although you can do this from within most applications, using the Dock provides a simple and standardized way to switch between windows.
Task: Using the Dock to Switch Between Application Windows 1. Move your mouse cursor over the icon for the application that has multiple windows opened. 2. Click and hold the cursor over the application icon. The window-control menu appears (see Figure 2.5).
Control Menu
Figure 2.5 All of an application’s open windows are listed here.
3. Click on the desired menu option. The appropriate window will appear. The Dock also lets you locate applications, whether they are running or not, in their folder within the Finder. If you have some housekeeping to do, and you don’t want to waste time finding the correct folder within the Finder, you can use this shortcut to get to the application’s folder.
Exploring the Desktop
Chapter 2
Task: Using the Dock to Open an Application’s Folder in the Finder 1. Move your cursor over the icon for any application—running or otherwise—in the Dock. 2. Click and hold the cursor over the icon. The window-control menu appears. 3. Click on the Show in Finder menu option. A Finder window appears, opened to the selected application’s home folder. You can also quit a running application on the Dock. Again, you can do this from the main menu of most applications, but some older applications deviate from the standard Apple scheme. Using the Dock provides a standardized way to quit any application, as you will see in the next Task.
Task: Using the Dock to Quit an Application 1. Move your cursor over the icon of a running application in the Dock. 2. Click and hold the cursor over the icon. The window-control menu appears. 3. Click on Quit. The application immediately begins its quit process and disappears from the screen.
NOTE Every application quits differently.You may be prompted, for example, to save your work before quitting an application. Follow the usual procedures for closing the application.
TIP The Quit option is not available for the Finder icon because it is an essential element for running the desktop and can’t be turned off by normal means. Instead, you can use the Restart or Shut Down commands to turn off the Finder, which, of course, will shut down your Mac as well.
37
38
Part I
Basic Mac OS X
Now you know the various tasks you can perform with the Dock. But there is more to this handy little tool than opening and closing the default Dock applications. In the next section, you will learn to change the contents of both sections of the Dock to suit your needs.
Customizing Dock Contents Customizing applications with the Dock is easy, especially in contrast to how users had to customize the Apple menu in the past. To customize the Apple menu, you had to open the System Folder and then the Apple Menu Items folder within. In OS X, the Apple menu is no longer the best tool to open applications because it no longer can be modified like it could be in earlier Mac versions. This duty now falls to the Dock, the desktop, and the Finder, because these tools can be modified. Before examining how to customize the Dock contents, quickly review how to open an application with the Finder or from a desktop icon.
Task: Opening an Application without Using the Dock 1. In the Finder or on the desktop, locate the icon that either represents or points to the application you want to open. 2. Double-click the icon. The icon will appear at the right end of the Application section of the Dock and bounce to signify the opening process. The application’s default window will appear. Once the application is opened, its icon remains in the Application section of the Dock for as long as the application is running. When you quit the application, the icon for that program disappears. Making that application a more permanent fixture of the Dock is very easy, as shown in the next Task.
Task: Adding an Opened Application to the Dock 1. Click and hold the mouse pointer on the icon that you want to keep in the Dock. The window-control menu appears (see Figure 2.7). 2. Click the Keep in Dock menu option. The application icon will remain in the Dock in its present position after you quit the application.
Exploring the Desktop
Chapter 2
Newly Opened Application
Figure 2.6 Applications opened from the Finder or the desktop appear on the
right end of the Dock’s Application section.
Figure 2.7 You can elect to permanently keep an icon in the Dock.
39
40
Part I
Basic Mac OS X
Alternatively, you can follow these steps: 1. Click and hold the mouse pointer on the icon you want to keep in the Dock. 2. While holding the mouse button, drag the icon along the Dock to the desired position (see Figure 2.8).
Repositioned Icon Figure 2.8 After you move an application’s icon to a new position, it becomes a
permanent part of the Dock.
3. Release the mouse button. The application icon will remain in the Dock in its new position after you quit the application.
TIP You can also click and drag any of the Dock icons to reposition them within the same section of the Dock.
Exploring the Desktop
Chapter 2
You can also add icons to the Dock without opening an application. From the desktop or Finder, click and drag any application icon or alias to the Application section of the Dock. Once you position the icon and release the mouse button, a copy of that icon automatically appears in the Dock—without having to create an alias first to retain the application’s folder position on your Mac. This is a very useful feature, because foregoing the alias step for the Dock saves a lot of time and potential confusion. You can customize the Alias section of the Dock in much the same manner. You can easily click and drag icons for drives, folders, and documents from the Finder or desktop. You can also insert Internet shortcuts on this side of the Dock, as you will see in the next Task.
NOTE For more information on establishing Internet connectivity, see in Chapter 3, “Setting Preferences.”
Task: Adding an Internet Shortcut to the Dock 1. In Internet Explorer, navigate to a Web page you’d like to add to the Dock. 2. In the Address Bar of Internet Explorer, click and drag the URL icon down to the Alias section of the Dock. 3. Release the mouse button. The URL icon for the shortcut appears in the Dock (see Figure 2.9). Eventually, you may want to remove an icon from the Dock. The following technique works for any icon in the Dock, except for the Finder and Trash icons.
41
42
Part I
Basic Mac OS X
Figure 2.9 The URL icon represents a shortcut to a favorite Web page.
Task: Removing an Icon from the Dock NOTE You cannot remove an application icon from the Dock when the application is running.
1. In the Dock, click and drag the unwanted icon away from the Dock. 2. Release the mouse button. The icon will be removed from the Dock (see Figure 2.10).
TIP Removing an application icon from the Dock does not delete the application—it just removes another alias to that application. Also, don’t get too carried away with customization of the Dock. It would not be a great idea, for instance, to remove the System Preferences icon from the Dock because it’s a vital tool.
Exploring the Desktop
Chapter 2
Figure 2.10 When you remove an icon from the Dock, a puff of smoke appears
onscreen.
Once you have gotten all your Dock content squared away, you can modify the Dock itself.
Customizing Dock Appearance As you open more applications in a single session, the Dock shrinks in height and increases in length to accommodate all of the open-application icons. As you can see in Figure 2.11, it can get rather small. You can also resize the Dock yourself. Like many aspects of OS X, you can do this a couple of ways. The first and perhaps the simplest method is to use the resizing bar between the two sections of the Dock. To use this bar, position your cursor over the bar until the cursor changes to a resizing cursor (as shown in Figure 2.12). Now, click and drag the cursor to resize the Dock. The second method of resizing the Dock involves the Dock Preferences tool. You’ll get a closer look at this tool in the next Task.
43
44
Part I
Basic Mac OS X
Figure 2.11 The Dock automatically adjusts its size to accommodate addi-
tional icons.
Resizing cursor
Figure 2.12 You can size the Dock to fit your needs.
Exploring the Desktop
Chapter 2
Task: Customizing the Dock with the Dock Preferences Tool 1. Click the System Preferences icon in the Dock to open the System Preferences window (see Figure 2.13).
TIP You can also select the Apple, System Preferences menu command to open the System Preferences window.
Figure 2.13 System preferences control many aspects of your OS X machine.
2. Click the Dock icon. The Dock preferences panel appears (see Figure 2.14).
TIP You can also select the Apple, Dock, Dock Preferences menu command to start the Dock preferences panel.
45
46
Part I
Basic Mac OS X
Figure 2.14 The Dock has several preferences for you to set.
3. To resize the Dock, click and drag the Dock Size slider. The Dock is resized in real time. 4. To turn on icon magnification, click the Magnification check box. 5. Click and drag the Magnification slider to adjust the magnification settings. Hold the mouse pointer over the Dock to view the effect (see Figure 2.15). 6. To have the Dock hidden when not in use, click the Automatically Hide and Show the Dock check box. 7. To reposition the Dock to another area of the desktop, select one of the Position on Screen options. 8. If you want to turn off the animation for opening icons, click the Animate Opening Applications check box to clear it.
NOTE These are not all of the preferences that you can set for the Dock. I address the Minimization effect in the “Working with Windows” section later in this chapter.
Exploring the Desktop
Chapter 2
Figure 2.15 The funky Magnification effect
Because the Dock is an integral part of the desktop experience, you can easily customize it from the Apple menu, too. Found on the Apple, Dock menu (see Figure 2.16), these commands activate magnification and hiding and can reposition your Dock to another border of the screen.
TIP To activate Dock hiding, press Option+Å+D.
As you have seen, the Apple menu and all the other menus in the menu bar have undergone serious makeovers for OS X. In the next section, you’ll learn more about those changes and find out just how these revamped menus can maximize your efficiency.
The Menu Bar One of the unique features of the Mac operating system is that no matter what you have running on your machine, there is always a single menu. Instead of a
47
48
Part I
Basic Mac OS X
Figure 2.16 The menu-driven Dock configuration commands
Windows or Linux approach to menus, which delivers a separate menu for each open application, Mac OS has always displayed the one menu bar along the top of the desktop. Each time you open an application, the menu changes to reflect the appropriate tools for that application. Each application’s menu is unique, and it will not benefit you to try to step through each different menu command here. As you examine individual applications in more detail, you will have a chance to review menus. In all of the menus displayed in Mac OS, two menu options remain constant: the Apple menu and the System menu. No matter what application you are working in, these menu options are present. Because of this, they deserve a closer look.
The Apple Menu The Apple menu has been around since the very beginning of the Mac operating system. It has become more robust over the years, but its primary task has remained essentially the same: to provide a place for users to start their applications. With OS X, that’s all changed. Although the Apple menu is still in the same place, its contents have changed dramatically. Looking at the Apple menu in
Exploring the Desktop
Chapter 2
Figure 2.17, you can see that there is no longer a grand list of installed applications. Instead, utilitarian functions have been incorporated into the Apple menu.
Figure 2.17 The new Apple menu
The first command on the Apple menu is the simplest to use. The About This Mac menu option activates a small message box that informs you what version of Mac OS X you have running, what type of processor is being used on your machine, and how much RAM you have onboard. Nothing terribly complicated here. The next menu option is Get Mac OS X Software, which is just an Internet shortcut to http://www.apple.com/downloads/macosx/. Visit this site occasionally to pick up updates to OS X-ready applications and to get some free software. The next three menu options, System Preferences, Dock, and Location, are gateways to various preference-setting tools in OS X. System Preferences, which replaces the original Mac OS Control Panels, takes you to its namesake, the granddaddy of all configuration tools in OS X. The Dock submenu, as you learned earlier, lets you customize some of your Dock settings and access the Dock Preferences panel. Location refers to the location of your computer on the network, which you can change from here. You can also access the Network Preferences panel.
49
50
Part I
Basic Mac OS X
NOTE For more information on Network Preferences, see Chapter 3, “Setting Preferences.”
The Recent Items submenu lets you view recently opened documents and applications, as you can see in Figure 2.18. By default, you can view the last five applications started on your machine, as well as the last five documents opened. By clicking on any of these listed items, you can immediately start that application again or open the selected document in the correct application. This is reminiscent of the old menu-launching function of the Apple menu, and it’s about as close as this new version is going to come.
Figure 2.18 Recently opened documents and applications are just a click away.
The next option, Force Quit, is a new menu function to Mac OS. It lets you firmly shut down an application that has gone awry. The Force Quit option is discussed in more detail in Chapter 7, “Working with Applications.”
Exploring the Desktop
Chapter 2
The next three options on the Apple menu will look very familiar to long-time Mac users. These are the all-important Sleep, Restart, and Shut Down commands. In earlier versions of Mac OS, these commands were on the Special menu. The Special menu doesn’t exist in OS X, so these functions have been relocated to the Apple menu. Finally, there is the Log Out command, which might be new to most Mac users. Because OS X is a multiuser operating system, you can easily have more than one user assigned to the same machine. Each user has his or her own login account and custom settings for the desktop. For more discussion on user accounts, turn to Chapter 3, “Setting Preferences.” For now, just note that the Log Out command is at the bottom of the Apple menu.
TIP You can also log out by pressing Shift+Å+Q.
The Apple menu has been radically altered, but now you know that the changes are not terribly hard to master. The reworking of the Apple menu provides users with a better set of utilities to configure and manage their systems. Another change to the menu bar is the addition of the System Menu. This handy component of the OS X desktop enables you to access important configuration settings for your computer with just a click of the mouse.
System Status Menus The System Status menus on the menu bar are a bit different from the average Mac menus. The name implies that there is a menu with the label “System Status.” This is not the case. The System Status menus are icons found in a separate area on the menu bar where you can place handy little utilities to manage your hardware settings. When you first install and run OS X, there are already two System Status menus: the Date and Time control, and the Volume control. Using these controls is simple, as you will see in the next Task.
51
52
Part I
Basic Mac OS X
Task: Adjusting System Volume from the Volume Control 1. Click the Volume System Status icon. The Volume slider appears (see Figure 2.19).
Figure 2.19 Use this slider to get the sound right.
2. Click and drag the slider. 3. Release the mouse button. You’ll hear a test sound approximating the volume setting. You can place other tools on the System Menu, as well. One of the more useful ones is the Display control, which lets you adjust the display properties of your screen on-the-fly. The following Task shows you how to add this control to the System Menu. Follow the same procedure to add other controls if you wish.
Exploring the Desktop
Chapter 2
Task: Adding a New System Status Control 1. Click the System Preferences icon in the Dock. The System Preferences window opens. 2. Click the Displays icon to load the Display panel (see Figure 2.20).
Figure 2.20 You can change the resolution of your screen from this panel.
3. Click the Show Displays in Menu Bar check box. The Displays icon appears in the System Menu. 4. Click the System Prefs, Quit System Prefs menu option to close the System Preferences window. 5. To use the Displays control, click the Displays control. The Displays system status menu appears (see Figure 2.21). I’ll review some the Displays options in the next chapter. Until then, pause to review some of the basics of interface management on the Mac, namely, using the new windows in OS X.
53
54
Part I
Basic Mac OS X
Figure 2.21 Color and resolution options shown by the Displays control
Working with Windows If there is one thing that practically leaps off the screen in OS X, it is the radical new design of the windows. The old shading and closing icons have been replaced by red, yellow, and green buttons on the left corner of the windows. It’s all rather unnerving at first, until you realize that everything is now arranged in a neat little set of commands that will have you mastering your windows in no time. The first thing you need to do, of course, is open a window. Position an open window by clicking and dragging the title bar for the window until the window is right where you want it. Again, no rocket science here. Once a window is open, you usually see a standard set of window controls, as shown in Figure 2.22. I say “usually” because not all of the controls are active or present for every window. If a window does not have a toolbar, for instance, then it will not have a toolbar toggle control. The “traffic light” controls on the left corner of the window are not difficult to master, but they can be a bit counterintuitive.
Exploring the Desktop
Close Minimize Zoom Window Window Window
Chapter 2
Toolbar Toggle
Scrollbars (inactive)
Figure 2.22 The various components of a window
Window Resizing Tool
This is especially the case with the green Zoom control (represented by a small plus sign (+) for those of you who are color blind). The Zoom control does not expand a window to fill the screen, as you might expect. Instead, it merely expands the window to the greatest size that the user has ever sized it. Thus, if you have opened an application’s window and have never resized it, using the Zoom control will initially do nothing. But after you have resized an application’s window even once, the Zoom tool becomes useful. The other two tools, Close and Minimize, work how you would expect. Clicking on the red button with the small X in it immediately closes the window. Be aware, especially if you are new to Macs, that this does not always mean the application will stop running—even if you close all of the application’s windows. Applications keep running in OS X until you actively quit them.
TIP If you are not sure if an application is running, you can check its status in the Dock.
Minimizing windows with the yellow button (which has a minus sign – in it) is new; now all minimized windows immediately migrate to the Alias section of the Dock, whereas in earlier versions of Mac OS, minimization was a different action. They sit there until you quit the application or restore the window to the desktop.
55
56
Part I
Basic Mac OS X
By default, windows minimize to the Dock with an interesting window-wrapping effect known as the Genie effect (see Figure 2.23). This is a cool effect, but if you don’t like it, you can change it to a more conservative scale-down effect, as detailed in the next Task.
Figure 2.23 A window minimizing with the Genie effect
Task: Changing the Minimization Effect 1. Select the Apple, Dock, Dock Preferences menu command to open the Dock panel of the System Preferences window. 2. Click on the Minimize Using pull-down list box to see the entire list of options. 3. Click on the Scale Effect option. 4. Quit System Preferences using your preferred method. Now when you minimize and restore windows, they will shrink and expand in a straight-line effect, demonstrated in Figure 2.24.
Exploring the Desktop
Chapter 2
Figure 2.24 A window minimizing with the Scale effect
Windows that have any sort of toolbar benefit from the presence of the toolbar toggle tool in the upper right corner of the window. Clicking on the button immediately removes any toolbar that window might have, as demonstrated in Figure 2.25. The toolbar toggle window also reduces some applications to their minimum open configuration, if available.
Figure 2.25 A Finder window sans toolbar
57
58
Part I
Basic Mac OS X
If the contents of a window are too numerous to be seen in a single window, use the scrollbars to scroll up and down or across the window to view all of its contents. Or, if you’re of a mind to, you can resize the window itself. In OS X, you can resize a window only by using the resizing tool in the lower right corner of the window. To use the tool, just click and drag the corner of the window until the window’s height and width are adjusted to what you want. You can use these tools in combination with keyboard keys to accomplish more far-reaching tasks. Table 2.1 lists some of the most convenient shortcuts for managing windows. Table 2.1 OS X Windows Shortcuts Shortcut
Action
Option+Zoom
Maximizes window to fill screen
Option+Minimize
Minimizes all of an application’s open windows
Option+Close
Closes all of an application’s open windows
That covers some of the basics of using windows in OS X. Another key component to OS X is the icons that reside in the Finder, the desktop, and anywhere else where files and folders are listed. Using icons may seem simple, but there’s a lot of functionality in those little representations. You just have to know where to look.
Working with Icons Iconic representations of data have been around since the very beginning of the Mac OS. Indeed, only the prototypes developed at the Xerox Palo Alto Research Center used icons first. With so much experience wrapped up in these little doodads, you would expect that Apple has made a science out of icon management. And you’d be correct. There are two kinds of icons in OS X: direct icons and alias icons. In many ways, their functionality is exactly the same as their counterparts in older versions of Mac OS, so there’s not much here to surprise you if you are an experienced Mac user. For those of you coming from the Windows or Linux arena, a little more explanation is in order. On those operating systems (assuming you have been using a desktop environment on Linux), your icons fall into similar categories: actual icons and
Exploring the Desktop
Chapter 2
shortcuts. The critical difference between these operating systems and OS X is how icons representing actual files—especially applications—are handled. In Windows, moving a program executable to another directory on your computer is the equivalent of slipping the application a Mickey. Because the executable relies on knowing its exact location (and more importantly, where its supporting libraries are), once an application file is moved, there’s little chance the application will function. The same line of reasoning holds for Linux applications. This is why users create shortcuts to point to their program executable files. In OS X, such distinctions are not made between aliases and application icons. Because of a Mac’s vastly different directory structure, it does not officially matter where an application is located on the computer. It will work no matter where you put the file. Regardless, it is not a good idea to get too creative with application locations. As you will read in Chapter 6, OS X is essentially based on Unix, which is not quite as flexible as Apple would like to think. You should, therefore, play it safe and try to keep all applications in the same place on your computer, and just build aliases or Dock icons as you need them. Besides, such flexibility is a wonderful tool for customizing your computer, but it can cause organizational havoc on your system. Too many times, computer administrators find very cluttered desktops, and folders left lying around in an electronic morass. Fortunately, there are some nice tools to help you get things in order, as you will see in the next Task.
Task: Cleaning and Arranging Icons on the Desktop and Finder 1. To arrange your icons into rows and columns on your desktop or in a Finder window, click the View, Clean Up menu option. The icons are immediately set on an invisible grid (see Figure 2.26). 2. To go one step farther and set these icons in alphabetical order, click the View, Arrange by Name menu option (see Figure 2.27). You can make this arrangement more permanent by setting the View Options for the desktop or the Finder windows to auto-clean or auto-arrange icons.
59
60
Part I
Basic Mac OS X
Figure 2.26 This looks better than a scattered mess of icons…
Figure 2.27 …but this looks better yet.
Exploring the Desktop
Chapter 2
Task: Auto-Cleaning and Auto-Arranging Icons on the Desktop and Finder NOTE In this Task, you examine the steps as they apply to the desktop. The Finder steps are identical.
1. To permanently arrange your icons into rows and columns on your desktop, click the View, Show View Options menu option. The desktop view options panel appears (see Figure 2.28).
TIP You can type Å+J to open the view options panel.
Figure 2.28 Icons are controlled with panels like these.
2. For auto-cleaning, click the Always Snap to Grid button. 3. For auto-arranging, click the Keep Arranged By button. 4. From the pull-down list box, select one of the five sorting options: ◆ Name ◆ Date Modified
61
62
Part I
Basic Mac OS X ◆ Date Created ◆ Size ◆ Kind 5. Click on Close to close the panel. Another nifty trick for cleaning up your icons is to change their size—something which is unfamiliar to many computer users. In OS X, it’s a very simple operation, as you will see in the following Task.
Task: Sizing Icons on the Desktop and Finder In this Task, you examine the steps as they apply to the Finder. The desktop steps are identical. 1. Click on View, Show View Options from the menu. The view options panel for that Finder window appears (see Figure 2.29).
Figure 2.29 Resize your icons from this panel.
2. Click and drag the Icon Size slider to adjust the size of your icons. 3. If using a Finder view option panel, click either This Window Only or Global, depending on how extensive you want this adjustment to be. 4. Click on Close to close the panel.
Exploring the Desktop
Chapter 2
After this Task, your icons will be a completely different size, as shown in Figure 2.30.
Figure 2.30 Jumbo-size icons are just a click and a drag away.
There are, of course, useful ways of managing individual icons using the keyboard and the mouse. Table 2.2 lists these techniques in more detail. Table 2.2 OS X Icon Shortcuts Shortcut
Action
Shift+click
Select another icon as part of the current selected range
Å+click
Select non-adjacent icons
Return
Select an icon’s name
Arrow keys
Select icons
Letter keys
Select icon by first letter of its label
Tab
Select the next icon in alphabetical order
Click+drag
Select a group of icons
There is one kind of icon we have not yet discussed: a drive or disk icon. In the next section, we’ll delve into the peculiarities of these special icons.
63
64
Part I
Basic Mac OS X
Ejecting Disks Using a hard drive or disk icon on the desktop or in the Finder is similar to using any folder in OS X—except that these icons cannot be deleted or thrown away in the Trash. (Their icons can, however, be removed from the desktop.) For hard drives, the reason is pretty simple: OS X may be flexible, but it’s not suicidal. Therefore, it has made the steps for deleting a hard drive painfully difficult. This is a safety precaution that prevents you from trashing all your data in one fell swoop simply because you’re not paying attention. In other words, Mac OS X is aware of what you are using. It’s aware if you are using a copy of Mac OS X installed on a specific drive. It’s aware if Classic is running, which could be using an application or files stored on another drive. It’s aware of any device you connect to it. It’s that awareness that, unlike most other operating systems, prevents you from accidentally disconnecting a disk that contains items still in use, which safeguards your work and your sanity. You can accidentally delete individual bits of data or whole disks if they aren’t in use, but you can’t accidentally erase the startup disk while it’s in control of your computer. In the case of non-writable CDs and DVDs, the answer is also fairly obvious: data cannot be casually written to or removed from such media, so the Trash function is ineffective. For removable media, the Trash icon does serve another purpose: it can quickly send the eject command to the CD, DVD, or floppy drive. In fact, this is about the only way you can get removable media out of their drives because many such peripherals for Macs do not have manual push-button controls for ejecting disks. This is an idiosyncrasy that many Mac users have grown accustomed to. It’s just a matter of clicking and dragging the icon for your removable media over the Trash icon. In OS X, the Trash icon will even change to an Eject icon when the disk is held over it, further confirming the action you’re about to take. Release the mouse button, and voila! The disk is ejected from its drive. Another Mac characteristic is the Shut Down process. Some changes have been made to the shutdown and startup processes in OS X, which will be explained in the next section.
Exploring the Desktop
Chapter 2
Start Up and Shut Down In the past, Mac OS sometimes needed system extensions installed for some applications to work correctly. These extensions not only provided support for existing “mainstream” applications, but they could also be invisibly running applications on their own, just waiting for the user to call upon them to take action. System extensions always resided in the System Folder of Mac OS, and were visible as little puzzle-piece icons that blipped across the screen during startup. At least, before OS X came along. One of the first things an observant user is going to notice during startup is that the system extension icons are no longer there. In fact, there are no extensions in the System Folder for OS X. Before a wave of panic sets in, relax. OS X no longer needs extensions since it is built on a completely different architecture. When you install an OS X application, everything it needs is installed right where it needs to be—no extensions necessary. This simplifies the startup process quite a bit, cutting the time involved, as well. Shutting down the OS X system is no different than shutting down earlier versions of Mac OS, save that you now initiate such actions from the Apple menu instead of the (nonexistent) Special menu. There are three system-power options available on the Apple menu: Sleep, Restart, and Shut Down. Sleep does not turn the computer completely off. Instead, it shuts down the display and stops the hard disk from spinning. This reduced-power mode saves energy while still allowing for a very fast start whenever you come back to the computer. Waking up the computer from Sleep mode is only a matter of pressing a key on the keyboard. Restart does exactly what it says: when you select this option, the system shuts down and then starts right back up. Sometimes you need to do this after installing software, but the install process for the software should inform you of this. Finally, there is Shut Down. Click this option to completely turn off the computer.
65
66
Part I
Basic Mac OS X
As a matter of stability, it’s always a good idea for you to manually quit your running applications before implementing any of these options. The system automatically shuts down any running applications, but why increase the system’s workload and the chance for something to go wrong?
Summary In this chapter, you learned the basics of getting around the OS X interface. Although there have been some significant changes from prior versions of Mac OS, nothing in this new interface is going to be difficult to understand, especially after a little practice. In Chapter 3, we will move past the basic interface, and discuss the methods of making the interface your own. We will also discuss other important setup routines, such as user accounts and the all-important Internet settings.
Chapter 3 Setting Preferences
68
Part I
Basic Mac OS X
fter you have played with all of a new operating system’s bells and whistles, you feel a sense of calm in the air as you pause to take stock of what is on the screen before you. This is a good time to start digging further into the OS X interface and getting it customized to meet your standards. A lot of settings can be changed to suit your preferences and needs. Many of these settings are purely subjective—OS X will hardly suffer a performance hit if you change mouse speed settings. But some settings are much more critical, such as how OS X connects your computer to the network and to the Internet, which will be discussed more in Chapter 4, “Connecting with OS X.” For now, you’ll learn how to manage many of these settings, from the minor to the major, so you can make OS X your very own.
A
Desktop Preferences Perhaps the most popular set of changes you can make on your system is the way the interface behaves. These settings usually fall into the catch-all nomenclature of “desktop preferences.” Desktop preferences are any settings that directly and broadly affect the audio and video coming out of your computer. In other words, if the change shows up in all aspects of the interface—not just within one application—it can be characterized as a desktop preference. Desktop preferences encompass a wide range of configuration settings: everything from the monitor’s display settings to sounds to background pictures are in this interface übergroup. With so much to tweak, you can get lost amongst all of the settings. In the next section, you’ll get a step-by-step guide to making changes to your OS X desktop so you won’t get lost.
Setting Up Your Monitor If you are working with OS X on an iMac, you might be wondering what the big deal is about setting up your monitor. Whether you use an old-style iMac or one of the new models with the flat-panel displays, it surely has crossed your mind that Apple must have gotten all of this set up at the factory. For the most part, this is correct. But not every OS X user is using an iMac. And not all users, regardless of what device they’re using, will be 100 percent satisfied with the settings that came with their monitor, whether it’s built-in or not.
Setting Preferences
Chapter 3
As detailed in Chapter 2, “Exploring the Desktop,” many of the monitor settings are controlled from the Displays panel of the System Preferences application. You can access this panel by clicking on the System Preferences icon in the Dock, and then clicking the Displays icon. When the Displays panel is open, you can make your settings changes. All of these settings implement changes immediately, so you can instantly see if those changes produce the desired effect. In upcoming sections, you will learn how to alter your monitor’s pixel depth, color schemes, and basic geometry. (I promise that you won’t need a protractor.)
Making a Resolution One of the common changes is the screen resolution. Resolution refers to the number of pixels displayed on the monitor screen. A lower resolution, such as 640 pixels X 480 pixels, displays a screen on which the text and objects are much larger than they would appear on a screen with a higher resolution setting. A lower resolution produces magnified images, but the downside to it is that there is less screen “real estate” on which you can work. In contrast, higher resolutions, such as 1024 X 768, enable you to fit much more screen on your monitor. The downside is dealing with much smaller onscreen objects and fonts. If you have a larger monitor, however, a higher resolution is ideal because you can always increase the size of your screen fonts and icons. You can change the resolution from the Displays panel by using the steps in the following Task.
Task: Changing Screen Resolution 1. Click on System Preferences in the Apple menu. 2. Click on the Displays icon. The Displays panel will appear. 3. In the Displays panel, click on the Display tab to make it visible. 4. Single-click the resolution option you want. Immediately, the screen changes to display that resolution (see Figure 3.1). 5. Select another supported resolution option. The screen’s resolution will alter again, though a Confirm New Setting dialog box may appear (see Figure 3.2).
69
70
Part I
Basic Mac OS X
Figure 3.1 The display at 1024 X 768 resolution.
Figure 3.2 The display at 640 X 480 resolution.
Setting Preferences
Chapter 3
NOTE Resolution settings will vary, depending on the device you are using.
6. To keep this new resolution, click the Confirm button. The dialog box will close and the resolution will hold.
TIP If you don’t like the new resolution, you can either click the Revert button, or wait 15 seconds for the screen to go back to the last resolution.
Color by Numbers You may also want to change the number of colors shown on your screen. Pixels display color amounts as a relation of the powers of 2. 8-bit color means the screen displays 28 colors, or 256 colors. Most video cards give you a choice between 8-bit, 16-bit, and 32-bit color. What you choose is up to you and the performance of your video hardware. For instance, if you have an older video card and display, you may not be able to display 32-bit color or, if you can, you may see a real performance hit on your rendering speeds. Obviously, you should maximize your color settings for your display. Even if you are completely color-blind, doing so is a good idea. Reducing the number of colors makes the images and screen appear grainy because the shadings and subtle tones on a high-color display become pixilated approximations on a low-color display. The recommended color setting for OS X is Thousands. If you decide to alter the color settings on your monitor, follow the steps in the following Task.
Task: Changing Screen Color Settings 1. In the Displays panel, ensure that the Display tab is visible.
71
72
Part I
Basic Mac OS X
2. Click the Colors options list. You will see two or three options, which are explained in Table 3.1. Table 3.1 OS X Color Settings Setting
Actual Number of Colors
256 Colors
256 (8-bit)
Thousands
65,536 (16-bit)
Millions
16.7 million (32-bit)
3. Click the option you want. The screen immediately changes to the new color setting. 4. Some color settings may be available from your video card but not the actual monitor. You can try these by clicking on the Show Modes Recommended By Display check box to clear it. 5. Click the Colors options list. You will see all of the available color settings options. 6. Select a video-card supported color-setting option. The screen’s color settings will change again. Another adjustable setting on the Displays panel is the Refresh Rate. Refresh rate refers to the number of times per second (Hertz) a screen is updated. Although some people recommend that you adjust your refresh rate, I do not. Refresh rates are automatically selected for color depth and resolution, and should not be changed unless you absolutely know what you are doing. If you set refresh rates incorrectly, you could damage your monitor because the hardware will burn out trying to handle an oddball refresh rate. Another way to manipulate color with OS X is to change its color profile. Color profiles are stored color settings that can be applied to your display and to any hardware device that might need them, such as a printer or a scanner. This is a way to get hyper-accurate color settings from your computer, which is a real boon for Mac users in the graphics industry. Applying color profiles to other hardware is examined in more detail in Chapter 9, “Fonts and Printing.” In the meantime, you can calibrate your display color profile if you need to adjust it to a specific set of colors.
Setting Preferences
Chapter 3
Task: Calibrating a New Profile for Your Display NOTE Users with machines that have LCD displays, such as PowerBooks, may have a slightly different set of steps to follow for this Task. See the online help on your machine for more details.
1. In the Displays panel, click on the Color tab. 2. Click the Calibrate button. The Display Calibrator Assistant opens. 3. Read the introduction screen and click on the right arrow in the lowerright corner. The Display Adjustments screen appears (see Figure 3.3).
Contrast Control
Test Graphic
Brightness Control
Figure 3.3 Before calibrating, adjust the contrast and brightness of your screen.
4. Using the sliders, adjust the brightness and contrast controls until the test graphic appears as a solid black box with a gray oval inside it. 5. Click on the right arrow. The Determine Your Display’s Current Gamma screen appears (see Figure 3.4).
73
74
Part I
Basic Mac OS X
Test Graphic
Gamma Control
Figure 3.4 Use this test to determine the current gamma level of your display.
6. Use the gamma slider to blend the Apple logo into the striped background of the test graphic. 7. Click on the right arrow. The Select a Target Gamma screen appears (see Figure 3.5).
Figure 3.5 You can choose the Standard, Television, or No Correction option.
Setting Preferences
Chapter 3
8. Click on the gamma option you want to try. The test graphic and the display change to reflect the new setting.
TIP If you are working on an iMac, leave the target gamma setting at 1.8.
9. Click on the right arrow. The Select Your Display’s Color Characteristics screen appears (see Figure 3.6).
Tristimuli Graphic
Figure 3.6 When you match the display, the best color range for that display is
automatically selected.
10. Click on the display description that best matches your monitor. The range of color changes in the tristimuli graphic. 11. Click on the right arrow. The Select a Target White Point screen appears (see Figure 3.7). 12. Click on the white-point setting you want. The screen instantly changes to reflect the new setting.
75
76
Part I
Basic Mac OS X
Figure 3.7 You can set the display to correspond to various lighting levels.
NOTE Graphic artists need to see what their final output will look like in forms of light other than the computer’s artificial settings, so the white point (which is another way of saying “ambient light color”) can be set to match other environments. Now, a brief astronomy lesson is in order: the color of a star is directly tied to the star’s temperature, as measured in degrees Kelvin. To match the color of our sun, which burns at 6,500 degrees Kelvin, you would set the white point at D65 (“D” is for daylight, “65” is short for 6,500 K). If you wanted to simulate the light of an indoor room, then the white point setting would be D50. The white-point setting of 9,300 simulates the light of a blue-white star, which we can all be glad is not nearby, because we’d be very, very hot. But, if you are designing computer graphics, 9,300 is the setting you would use, because 9,300 also represents the light intensity output of a monitor.
13. Click on the right arrow. The Conclusion screen appears. 14. Type a name for the new profile, and click Create. The new color profile is saved in the Color tab of the Displays panel.
Setting Preferences
Chapter 3
To change the color profile for your display in the future, click on the Color tab of the Displays panel and select one of the saved profiles. The screen immediately changes to reflect the new settings.
The Geometry of a Monitor You’re looking at your monitor screen right about now and thinking, “What geometry? It’s a rectangle.” And indeed it is, but most monitors have the ability to display much more than a purely rectangular set of pixels. The primary reason for this is that monitors, although they are rectangular in two-dimensional terms, are often curved in three-dimensional space. The typical flat-panel display is usually just that: if you look at the screen edge-on, you will find that it is pretty flat. Many monitors, however, have curved screens, which means the projected image may appear “bent” to conform to the curved surface of the glass. To fix this problem, many monitor manufacturers supply their screens with on-board firmware or software that enables the user to control the generated shape of the images on the screen.
NOTE Users with machines that have LCD displays will typically not have to deal with geometric settings because such displays will not accommodate geometric changes.
If you have a highly curved screen (like the ones on older iMacs), you can use the Pincushion control to pull in the curved sides of the display screen. This results in an hourglass shape for the generated images, but to the viewer on the other side of the glass, the sides of the images appear parallel and vertical. You can also use the Keystone tool to broaden or reduce the top and bottom edges of the screen. This tool generates the illusion of a straight-on screen if the monitor is mounted above or below your line of vision. If the monitor were mounted on a rack above your workspace, and the glass were not completely facing you, you could decrease the size of the bottom edge of the screen to shift the projected image “down” to meet your line of vision. One of the more useful geometry tools is the plain old Height/Width tool. When monitors are shipped from the factory, the projected images never seem to fill up the entire area available on the screen. This is a waste of perfectly good screen, and
77
78
Part I
Basic Mac OS X
I fix this problem every time I get a new monitor. Using the Height/Width tool is similar to using all of the other Geometry tools in OS X, so after you run through the steps in the following Task, you should be able to handle other tools as well.
Task: Changing Screen Height and Width 1. In the Displays panel, click on the Geometry tab. 2. Click the Height/Width option button. The Height and Width controls are displayed (see Figure 3.8).
Screen Control
Button Controls
Figure 3.8 Geometry can be adjusted with either the screen control or the but-
ton controls.
3. To adjust your settings with the mouse, place your mouse pointer in the middle of the screen control. A green outline appears on the control, indicating that the control is highlighted. 4. Move the pointer to a horizontal edge if you want to adjust screen height. A red-and-green resizing cursor appears (see Figure 3.9). 5. Click the edge of the screen control and drag the edge up or down to adjust the height. The screen’s shape changes as you adjust the setting.
Setting Preferences
Chapter 3
Resizing Cursor
Figure 3.9 Click and drag the screen control to adjust screen settings.
6. Release the mouse button. The screen reflects the new shape. 7. Repeat steps 4–6 for a vertical edge of the screen control to adjust screen width. 8. To fine-tune your settings, click on the appropriate button controls to adjust screen height or width pixel by pixel. 9. To save the changes, quit System Preferences using your preferred method.
TIP If you completely goof up your settings using any of these geometry tools, simply click the Factory Defaults button.
Now that you know how to tweak your monitor to get the visual effects you want, it’s time to move on to getting your computer’s sound system running to your specifications.
79
80
Part I
Basic Mac OS X
Setting Up Sounds In the recent past, the only sounds a computer made were the metallic buzzing sound when it read your floppy drive, and a couple of beeps here and there. Macs were the first computers to break this bad habit, since the original Mac spoke to the audience when it was unveiled in 1984. Now computer sound systems are so sophisticated that they can be THX-certified, which means that your computer can produce the same sounds that a movie theatre’s speakers produce. You might wonder why this technology is necessary for a computer that says only “You’ve got mail,” but you will sleep better knowing that this sound technology is there. Most Apple platforms don’t have a lot of advanced onboard sound equipment straight out of the box. To add advanced sound capabilities to your OS X machine, use the additional software controls that come with the new hardware. OS X just needs to handle the needs of a basic sound system. The most common task you will perform on your system’s sound is controlling the volume. If you have external speaker controls, then you can just reach over and turn the knob. If you have a newer Mac and an Apple Pro keyboard, you can use the volume controls near the numeric keypad. But if you don’t have these devices, you must adjust system volume using the Volume control. The Volume control can be accessed from various spots in the OS X interface. The most prominent location is the System Menu, which was demonstrated in Chapter 2, “Exploring the Desktop.” The primary control for adjusting your computer’s sound is located within the Sound panel of the System Preferences tool. This is also the panel where you can define which sound plays for system alerts, as you will learn in the next Task.
Task: Configuring System Sounds 1. Click on the System Preferences icon in the Dock. The System Preferences application starts. 2. Click on the Sound icon. The Sound panel appears (see Figure 3.10).
Setting Preferences
Chapter 3
Figure 3.10 Sound controls are found in this panel.
3. To change the volume for your system, click and drag the Main Volume slider to achieve more or less volume. When you release the mouse button, a test sound indicates the volume level you’ve selected. 4. Alerts have their own volume control. Click and drag the Alert Volume slider to achieve more or less volume. When you release the mouse button, a test sound indicates the volume level you’ve selected. 5. To change the sound your system makes when displaying an alert, click on the listed sound. An example of the selected sound plays. 6. If you want to make further changes on the audio settings, click the Output tab to reveal the Output page (see Figure 3.11). 7. If you have more than one sound card or device attached to your system, you can activate the sound card by clicking on its listing in the list of sound devices.
81
82
Part I
Basic Mac OS X
Figure 3.11 Sound output is controlled from this page of the panel.
8. To change the balance of the audio output between the speakers, click and drag the Balance slider. When you release the mouse button, a test sound indicates the balance level you’ve selected. 9. To save your changes, quit System Preferences using your preferred method.
Personal System Preferences Part of what makes your desktop so unique is how it is organized based on your needs, which has a lot to do with where you live and where you use your computer. For example, the official language in Portugal is not the same as the official language in the United States. Portugal doesn’t use the same currency or the same notations for dates and times that the U.S. does. Therefore, a computer that displays U.S. notations is not very convenient for a Portuguese person to use. Fortunately, the Portuguese user can change those notations.
Setting Preferences
Chapter 3
Você Fala O Português? In Faro, Portugal, the principal language is Portuguese, whereas in Cupertino, California, it’s English. (Though each city has a pleasant mix of other languages, we’ll stick with the ones used by the governments of these two towns.) It would be great if the OS X interface could be changed to the Portuguese language so someone in Faro could readily use an OS X system. As you might expect, Apple has made it simple to do just that. But Apple does not support every language right off the bat. If you are using the default United State configuration, the languages are: English, Spanish, German, French, Dutch, Italian, and Japanese. This might seem like a bad bit of luck for all of the countries that don’t speak these languages, but you can add more language support for OS X, as shown in the next Task.
Task: Configuring System Language 1. Click on the System Preferences icon in the Dock. The System Preferences application starts. 2. Click on the International icon. The International panel appears, opened to the Language tab (see Figure 3.12).
Figure 3.12 You can define supported languages and their order of support.
83
84
Part I
Basic Mac OS X
3. Because Portuguese is not listed in the Languages list, click on the Edit button to begin the addition process. The Edit panel drops into place (see Figure 3.13).
Figure 3.13 All of the languages available in OS X.
NOTE The languages are listed in the name according to the particular language, not the English translation. “Austrian German” is listed as “Österreichisches Deutsch,” for example.
4. Click on the appropriate language’s check box to select that language. 5. Click OK to close the Edit panel. The new language is displayed at the bottom of the Language list.
Setting Preferences
Chapter 3
NOTE As the International panel informs you, language changes take place when you first open applications. Changes in the Finder will not be made until after you log out of the Finder and log back in again.
6. To make the new language the primary supported language, click on its listing in the Language list and drag it to the top of the list. 7. Quit System Preferences using your preferred method. Not every menu and dialog box immediately starts using the chosen language, because language preference works only for those applications that have support for that language. If you are running a version of Internet Explorer that doesn’t have Portuguese support, for example, you’ll still see Internet Explorer in English. This lack of uniformity is why you can choose the order in which languages are supported. If you are, for instance, a bilingual Portuguese/French speaker who knows a little English, then you want to click and drag the options on the Language list so the first three items read: ◆ Português ◆ Français ◆ English By doing so, you ensure that languages are shown in the priority you need. If an application supports French and English but no Portuguese, then by setting French as the second-highest language of priority, you can work with that application in French. Besides the language displayed on the OS X desktop, there is the matter of inputting the proper characters. That’s where switching keyboards comes in handy.
QWERTY Isn’t the Only Keyboard For most Western languages, it is possible to use a U.S.-style keyboard to enter all of the characters in other languages. But this method takes time, because nonEnglish characters are not easy to type on such a keyboard.
85
86
Part I
Basic Mac OS X
With just a few quick steps, you can adjust the character map of your keyboard to reflect the same mapping as another language’s keyboard.
Task: Configuring System Keyboards 1. Click on the System Preferences icon in the Dock. The System Preferences application starts. 2. Click on the International icon. The International panel appears, opened to the Language tab. 3. Click on the Keyboard Menu tab to display that page (see Figure 3.14).
Figure 3.14 Many keyboard options are available.
4. Click the appropriate language check box. The language listing is selected and a small national flag appears in the Menu Bar.
NOTE When you select more than one keyboard option, the Keyboard System Status Menu, represented by a national flag, appears in the Menu Bar.
Setting Preferences
Chapter 3
5. Quit System Preferences using your preferred method. 6. To switch to the new keyboard layout, click on the Keyboard System Status Menu and select the appropriate menu option (see Figure 3.15).
Figure 3.15 Select the keyboard option you need.
TIP When the Keyboard System Status Menu is visible, enter the Keyboard Menu tab for the International panel by clicking the Customize Menu option in that Menu.
Getting the Date and Time The United States has many standards for expressing date and time. “January 14, 2002” might also be written as “Jan. 14, 2002” or “1/14/02,” depending on the context and how you were taught. Time has the same varieties: “8:52 p.m.” can be expressed as 2052 hours for military purposes.
87
88
Part I
Basic Mac OS X
Different nations have different ways of expressing dates and times, even if they’re agreeing to use the Gregorian calendar and 24-hour clock (which, it should be noted, is not universally adopted). OS X has incorporated tools that enable you to set time and date based on the national norm for a certain country, but it also allows you to make changes to suit your personal preferences.
Task: Configuring Date and Time Representations 1. Click on the System Preferences icon in the Dock. The System Preferences application starts. 2. Click on the International icon. The International panel appears, opened to the Language tab. 3. Click on the Date tab to display that page. 4. Click on the Region options list and select the date convention you want to use. The convention immediately changes on your desktop (see Figure 3.16).
Figure 3.16 You can be very specific for date displays.
Setting Preferences
Chapter 3
5. If the changes are satisfactory, click on the Time tab to display that page. 6. Click on the Region options list and select the time convention you want to use. The convention changes on your desktop (see Figure 3.17).
Figure 3.17 Time conventions are easy to set.
7. Quit System Preferences using your preferred method. Unlike the other International settings, date and time require more than formatting them to match regional standards. You also need to set the date and time. When you installed OS X, you were asked if you wanted to use a Network Time Server to keep your time and date synchronized. Apple provides three localized servers to users in the Americas, Asia, and Europe. The servers adjust your system’s clock to a single standard when your system polls the time servers over the Internet. If you chose this option, you should be all set. Your OS X machine will periodically poll the nearest Apple time server when you are connected to the Internet, and it will adjust your system clock and calendar. If you did not opt to use a Time Server, you may need to set your calendar and clock manually, which is with the Date & Time panel in System Preferences.
89
90
Part I
Basic Mac OS X
Task: Setting Date and Time 1. Click on the System Preferences icon in the Dock. The System Preferences application starts. 2. Click on the Date & Time icon. The Date & Time panel appears, opened to the Date & Time tab (see Figure 3.18). 3. Click the hour expression to select it.
Figure 3.18 What time is it?
4. Click the combo controls to change the hour expression. 5. Repeat Steps 3 and 4 as needed for the minutes and seconds values. 6. To change the month, click on the scroll arrows in the month field. 7. Click on the scroll arrow to adjust the year. 8. Click on the appropriate date on the displayed calendar page to set the date.
NOTE Time travelers, take note: The perpetual calendar allows you to set any date and time in history before 32,767 AD!
Setting Preferences
Chapter 3
9. To keep the changes you have made, click on the Save button. 10. Quit System Preferences using your preferred method. You also need to establish your time zone, which helps your computer keep track of daylight saving time, which is common in North America, Europe, and Australia. Time zone information also assists you in using the Network Time Servers (if you choose to use them). You normally set up time zones during the initial OS X configuration. But people do move, and it’s not unusual for a computer in, say, Indianapolis, Indiana, to have a new home in Dublin, Ireland. If something like this happens to your computer, use the next Task.
Task: Setting the Time Zone 1. Click on the System Preferences icon in the Dock. The System Preferences application starts. 2. Click on the Date & Time icon. The Date & Time panel appears, opened to the Date & Time tab. 3. Click on the Time Zone tab (see Figure 3.19).
Figure 3.19 Getting in the zone.
91
92
Part I
Basic Mac OS X
4. On the world map, click the approximate location that you want to switch to. The entire zone for that location will be highlighted. 5. Because a time zone can span different countries—each with a different policy on time keeping—you need to narrow down the region of the time zone. Click on the region options list and select the nation or region closest to your target location. 6. Quit System Preferences using your preferred method. You can neatly side-step a lot of the rigmarole of setting your clock and calendar by establishing a connection to one of Apple’s Network Time Protocol (NTP) Servers. Even if you log on to the Internet only once a week, having your clock synchronize automatically is convenient. Setting up a Time Server connection is not difficult, but you should make sure your time zone information is correctly configured before you set up the connection. The information the Time Server sends back to your computer depends entirely on what time zone your computer reports to the server.
Task: Establishing a Time Server Connection 1. Click on the System Preferences icon in the Dock. The System Preferences application starts. 2. Click on the Date & Time icon. The Date & Time panel appears, opened to the Date & Time tab. 3. Click on the Network Time tab to open that page (see Figure 3.20). 4. Click on the Use a Network Time Server check box to select it. The other fields on the Network Time page become active. 5. Click on the NTP Server field’s option list and select the NTP server nearest to your location. 6. To manually start the synchronization process, click the Set Time Now button. Your computer will log on to the Internet (if it is not connected already) and gather the appropriate information from the NTP server in the background. 7. Quit System Preferences using your preferred method.
Setting Preferences
Chapter 3
Figure 3.20 Synchronicity has never been so easy.
NOTE Once you make this setting change, you will not be able to manually change the date and time on your Mac.
No matter what country you are in, you can further adjust the format in the Date & Time panel, as shown in the next Task.
Task: Formatting the Menu Bar Clock 1. Click on the System Preferences icon in the Dock. The System Preferences application starts. 2. Click on the Date & Time icon. The Date & Time panel appears, opened to the Date & Time tab. 3. Click on the Menu Bar Clock tab to open that page. 4. If you want to see the clock as an icon on the Menu Bar, click on the Options list, and select the View as Icon setting, which makes the other options inactive and changes the clock to a small analog icon (see Figure 3.21).
93
94
Part I
Basic Mac OS X
Analog Clock
Figure 3.21 It’s small, but accurate.
5. If you elected to keep the clock digital with the View as Text option, click on the various check-boxed options to set or remove the options presented. 6. If you want to remove the clock from the Menu Bar’s System Menu altogether, click the Show the Clock in the Menu Bar check box to clear the option. The clock will be removed from the System Menu. 7. Quit System Preferences using your preferred method.
Managing Numbers and Currency In the U.S., numbers are usually expressed with a comma denoting thousands places and a period denoting the decimal point. An American citizen would write 2,000,564.43, for example. But in Portugal, a comma is used for the decimal point and a space is used for thousands places, meaning that it would be expressed as 2 000 564,43.
Setting Preferences
Chapter 3
Currency has similar issues, even in the same country. In most of Canada, the price for a comic book might be $3.75, but in Quebec, it would likely be denoted 3,75 $. And none of this is set in stone. On January 1, 2002, 14 member states of the European Union officially switched to the euro as their currency. By February 28, all existing currencies—the guilder, the franc, the deutsche mark, and so on— ceased to be legal tender. At the publication time of this book, Apple has not officially updated OS X to reflect this change. The default regionalization settings in OS X still reflect the symbology for the older currencies. Fortunately, it’s easy to change. Before demonstrating how to do this, you need to know how to enter the euro currency symbol (€). The process for doing this differs depending on the keyboard you’re using. Table 3.2 shows the different keyboard shortcuts for entering the € glyph. Table 3.2 Typing the Euro Symbol (€) Keyboard Layout
Keyboard Shortcut
U.S. and British English
Option+Shift+2
French
Option+Shift+R
German
Option+Shift+D
Italian
Option+I
Task: Configuring Numeric and Currency Representations 1. Click on the System Preferences icon in the Dock. The System Preferences application starts. 2. Click on the International icon. The International panel appears, opened to the Language tab. 3. Click on the Numbers tab to display that page (see Figure 3.22).
95
96
Part I
Basic Mac OS X
Figure 3.22 Numeric conventions are easy to set.
4. Click on the Region options list, and select the national or regional number convention you want to use. The conventions immediately change on your desktop. 5. To change the default currency settings, enter the € glyph in the Symbol field. 6. Click on the Before Number option button. The Region selection is changed to Custom, but the changes remain in place. 7. Quit System Preferences using your preferred method. General desktop settings like these may seem tedious, but they are important. Not everyone in the world uses the same conventions, and it’s good that OS X lets you reflect the way you express yourself. In addition to standard conventions, OS X also takes aesthetic considerations into account, such as setting up a pleasing environment in which to work. That is the topic of the next section.
Setting Preferences
Chapter 3
Setting Desktop Appearance Often, when you move into a new home or apartment, your new domicile has very little character. Maybe there are some molded finishings here and there or some woodwork that catches the eye. But for the most part, you are looking at a lot of bare walls. The room has little character yet—just the potential for character. The same holds true when you get a new computer, even an OS X machine. An OS X has more character than a typical suburban apartment to be sure, but it is not your character. You can customize the OS X desktop environment in several ways. Some of them are utilitarian and some are purely aesthetic, although some might say that such worries are frivolous. Frivolity, however, is always a good thing. The OS X desktop, which is also referred to as the Aqua interface, is unique. Only certain X Window environments running on Unix or Linux look like the OS X. Aqua presumably earned its name because it’s a clear interface sitting on top of all of the other interface and application components in OS X. The relationship between Aqua and the rest of OS X will be discussed in Chapter 6, “What’s under the Hood?” but for now I’ll hone in on the appearance of Aqua—which, like its namesake, is mostly blue. Desktop appearance is controlled as one meta-setting on the Aqua desktop, which means that you can adjust the desktop’s overall appearance in one fell swoop. To be more specific, the appearance setting changes the look of buttons, controls, menus, and windows. These changes are color-oriented only. In the initial releases of OS X, only two desktop appearance settings were available: Blue and Graphite. In Blue, menu highlights and all buttons and controls have a blue tinge. In the Graphite appearance, anything blue appears as gray. (In Graphite Aqua, the red, yellow, and green “traffic signal” window-control buttons all change to gray.) Making the change is not very difficult, as you’ll see in the next Task.
Task: Changing Desktop Appearance 1. Click on the System Preferences icon in the Dock. The System Preferences application starts. 2. Click on the General icon. The General panel appears (see Figure 3.23).
97
98
Part I
Basic Mac OS X
Figure 3.23 You can change several desktop settings here.
3. Click on the Appearance options list, and select the Graphite option. The desktop settings immediately change. 4. Quit System Preferences using your preferred method. This is not a dramatic change, to be sure. Maybe in the near future, Apple will add more appearance options to the list. You can make other changes using the General panel, as described in the next Task. You can change the color of highlighted text, the behavior and appearance of every window’s scroll bar, and the look of your onscreen fonts.
Task: Making General Desktop Changes 1. Click on the System Preferences icon in the Dock. The System Preferences application starts. 2. Click on the General icon. The General panel appears. 3. Click on the Highlight Color options list and select the color option you want. If you want to create a custom color, select the Other option. The Colors dialog box appears (see Figure 3.24).
Setting Preferences
Chapter 3
Color Wheel Slider Control List Palette Palette Palette Image Selection Palette
Brightness Control
Selection Box Stored Color Palette
Figure 3.24 The color wheel is one method for implementing Mac color selection.
4. Click on a section of the color wheel that approximates the color you want. The color will show up in the selection box. 5. Click and drag the brightness slider to increase or decrease the amount of brightness in the selected color. 6. Click Apply. The selected color is added to the Highlight Color options list. 7. To reposition the scroll arrow controls, click the At Top and Bottom button of the Place Scroll Arrows field. The scroll arrows are moved to new positions, as shown in the example Finder window in Figure 3.25. 8. To change the behavior of the scroll bar, click the Scroll to Here button of the Click In The Scroll Bar To field. The scroll bar now acts as an absolute positioning tool, moving to the point in the document where you click in the scrollbar. 9. If your small fonts appear too indistinct, you may want to turn off text smoothing (an anti-aliasing effect that gives the appearance of smoothedged fonts) for the smaller font sizes. Click on the numeric options list for Turn Off Text Smoothing for Font Sizes x And Smaller, and choose a larger font size. Text with a smaller font size than what you have selected immediately appears more jagged, as seen in Figure 3.26.
99
100
Part I
Basic Mac OS X
Adjusted Scroll Arrow Positions
Figure 3.25 The scroll arrows now bracket the scroll bar ends.
Non-Smoothed Text
Figure 3.26 Turning off text smoothing may help sharpen smaller font sizes.
10. Quit System Preferences using your preferred method. One other tool, the Number of Recent Items menu, is on the General panel, but it can’t really be considered a desktop tool. This tool sets the number of recent applications and documents that will be displayed in the Apple, Recent Items
Setting Preferences
Chapter 3
menu. Simply set the numeric values to what you want (all the way up to 50!), and the corresponding number of applications and documents will show up in the Recent Items menu. You can make many more dramatic changes on your desktop. The most popular way is to alter the desktop itself, and the easiest way to accomplish that is to change the wallpaper on the desktop. Wallpaper is a bit of a misnomer—unlike the real thing, it is not difficult to apply. Desktop background image requires no paste, no alignment, and no heated arguments with your significant other. No, virtual background image is much less complicated. In this case, you merely insert a digital image onto the desktop, which is set behind the icons, Menu Bar, and Dock. Apple provides a number of pleasant, soothing backgrounds that you can use for wallpaper. In the following Task, you’ll learn how to put one of them up—and also to utilize an image of your own (just in case you’re not into pleasant and soothing).
Task: Changing Desktop Background Images 1. Click on the System Preferences icon in the Dock. The System Preferences application starts. 2. Click on the Desktop icon. The Desktop panel appears (see Figure 3.27).
Image Well
Collection Display
Figure 3.27 You can select images from Apple’s tasteful collection.
101
102
Part I
Basic Mac OS X
3. If an image in the collection display appeals to you, click on it to select it. The image appears in the image well and is immediately placed on the desktop. 4. To view other images, click on the Collection options list and select another collection to view. 5. If you want to use an image of your own, perhaps located in the Pictures folder, click on the Pictures folder option in the Collection options list. 6. Scroll to the picture you want to use and click on it to select it and activate it.
TIP You can also drag and drop an image icon from the Finder directly into the image well to activate it as a background image.
7. Quit System Preferences using your preferred method.
TIP If you use your own image, make sure it is not overly white. Otherwise, your icons’ labels will have little contrast with your desktop, making them difficult to read.
One of the most anachronistic tools on any GUI-based operating system is the screen saver. Originally devised to prevent screen “burn-in” on phosphor-based monitor screens, screen savers now have only two uses: to display the user’s personality and locking the user’s screen if he or she walks away for a while. Screen savers in OS X are relatively simple affairs—no dancing lines or incoming star fields; instead, OS X screen savers display image files from Apple’s own collections or image files that you specify. Motion is achieved by slowly panning and zooming the image.
Setting Preferences
Chapter 3
Task: Setting Up a Personalized Screen Saver 1. Click on the System Preferences icon in the Dock. The System Preferences application starts. 2. Click on the Screen Saver icon. The Screen Saver panel appears (see Figure 3.28).
Figure 3.28 You can fit screen savers to your personality.
3. Click on the Slide Show option in the Screen Savers list. 4. Click on the Configure button. The Open panel drops down. 5. Navigate to the folder where your images are stored. 6. Click on the Open button. The Open panel closes, and the screen saver test window begins to display the images in the selected folder. 7. Click on the Activation tab to open that page. 8. Click and drag the slider to set an amount of time that the computer should be inactive before starting the screen saver. 9. Quit System Preferences using your preferred method.
103
104
Part I
Basic Mac OS X
Saving Energy The final desktop setting I will look at in this chapter does not have as much to do with how the desktop looks as how the desktop (and the rest of your system) behaves. Laptop users will especially appreciate the system energy settings. After all, the less energy consumed, the longer that oh-so-precious battery life will be. On the other hand, desktop users may not see the need to change the energy settings systems. After all, the electrical outlet supplies a virtually independent supply of energy, and the energy costs of running a PC 24/7 is far less than for many appliances in the home. However, if the computer is using energy, that’s energy that could be used elsewhere. I’m not talking about powering the lights on a movie marquee, but it all adds up in the end. And why should you pay for energy you really don’t need? Furthermore, keeping a system running 24/7 causes wear and tear on the system and decreases its life expectancy. By how much? That’s very hard to determine. Maybe you’ll upgrade to a new system long before the end of the life expectancy of your system, but why take the chance of a surprise repair job? You can manually set your computer to sleep at any time with the Apple, Sleep menu command. Many people use this option if they use their computer on an irregular work schedule. But if your work patterns are predictable, you can set your computer to sleep on its own, as shown in the next Task.
Task: Configuring the Sleep Settings 1. Click on the System Preferences icon in the Dock. The System Preferences application starts. 2. Click on the Energy Saver icon. The Energy Saver panel appears (see Figure 3.29). 3. Click and drag the main Sleep timer to set how long you want the computer to be inactive before sleeping.
TIP To activate your settings to never let the computer sleep automatically, slide the controls to the far right end, where the value of Never is.
Setting Preferences
Chapter 3
Figure 3.29 The system Sleep settings.
4. To set different settings for the display and hard drive, click on either or both of the Separate Timing For… check boxes. 5. Click and drag the individual sleep timers to set how long you want the computer to wait before putting the display and/or the hard disk to sleep. 6. Click on the Options tab to open that page. 7. Click on any of the three options listed to fine-tune the Sleep settings. Those options are: ◆ Wake when the modem detects a ring. ◆ Wake for network administration access. ◆ Restart automatically after a power failure. 8. Quit System Preferences using your preferred method.
Summary Now that you have your desktop settings in hand, you need to address the issue of connectivity.
105
106
Part I
Basic Mac OS X
Connectivity means more than how your computer connects to the Internet, though that’s certainly something to address. Connectivity also extends to how you connect to the computer before you. OS X has additional security and permissions in place that you, as the user or the administrator, must navigate. In Chapter 4, “Connecting with OS X,” you’ll learn how to get connected to your system, a network, and then out to the Internet—the biggest network of all.
Chapter 4 Connecting with OS X
108
Part I
Basic Mac OS X
ot so long ago, companies used a single computer tucked away in a little corner of the office. A single user would peck away at the keys to enter data that would be spit out at a nearby printer. Other people would huddle over the computer and discuss the printout. That was when most companies had offices with walls and doors. Today’s typical office space is a wide open sea of cubicles, where employee interaction is a necessity.
N
Interaction and openness are the keys to successful businesses, and collaboration and connectivity are the buzz words of business today. Anyone who isn’t connected is now seen as a liability to the progress of their given business. OS X takes connectivity to heart in every aspect of its design, accommodating more than one user, while maintaining security and workflow division between each individual. In this chapter, I’ll review the different kinds of connections that form OS X.
User Connections Something that’s new to many OS X users is multi-user capability. Many operating systems, Unix and Windows NT among them, have had this capability for quite some time. Until recently, however, the concept did not extend to every home or office computer. Instead, Mac OS (and its counterparts, Windows 95, 98, and Me) all relied on the concept of one computer, one user. Computer companies assumed that companies would have a dedicated computer for every employee. They also assumed that every member of a household would have his or her own terminal, too. The development efforts of “The Big 2” helped drive away the “one computer, one user” methodology. Developers tailored task-oriented applications that would match a new and growing business philosophy: it does not matter what your position in the company is—the important thing is what you are able to contribute to the overall good of the company, no matter if you are the working in the mailroom or the boardroom. Nowadays, there is an increased need for multiple users to have access to fewer, more specialized machines. Thus, the need for multi-user access to computers has become more prevalent.
Connecting with OS X
Chapter 4
Also driving this need is the primary reason that Unix and Windows NT have had multi-user controlled access from the start: security. When computer technology was new and users were more trusting, they thought little of what would happen to their data if they were to leave their terminals unattended. But people have always known that information is power, and the ability to steal it or block it is a powerful incentive to the unscrupulous among us. Having multiple user accounts on a computer may seem superfluous at first. But there are some real benefits to the practice. Many Mac OS users are familiar with logging on to their computers with a login name and a password. But before OS X, they were likely logging on to a remote network server (if they were connecting to a business network) or, more commonly, connecting to the Internet. In essence, the logon procedure was just a calling card that told the server at the other end of the network, “Hello, here I am. I’m using this computer, and I’d like to use these files, please.” In OS X, you log on for special access to the local machine. With this access, you cannot see all the files on the computer. But (and here’s the good news) other users cannot see the material you have access to, either.
TIP If you don’t need additional accounts and are not concerned about securing your data, feel free to leave OS X using the auto-login feature, which will automatically log you in to your account and start your computer without any intervention from you.
Multi-user access in OS X offers other benefits, as well. Each user has his or her own Public folder, Drop Box, and system preferences. Any preferences changes that one user makes are maintained separately from other users’ accounts. Multi-user benefits also play out well on home computers. Having a separate user account for each member of the family affords each person a custom-tailored workspace and enables the family’s “administrator” to control the access younger family members have to the Internet. Now that you know the benefits, you can begin configuring your OS X machine for multi-user access.
109
110
Part I
Basic Mac OS X
Creating a New User Account When you configured OS X, you were given an option to add all of the users to your system. If you did so at that time, you might want to skip to the next section, “Updating a User Account,” where you will learn how to modify existing accounts. If you did not add users to your machine during the initial setup, or if you need to add someone to the set of user accounts, you can add a user to the device at any time, as shown in the following task. Remember, you must be logged in with an owner/administrator account to perform these actions.
Task: Adding a User to OS X 1. In the Dock, click on the System Preferences icon. The System Preferences window opens. 2. Click the Users icon. The Users panel opens (see Figure 4.1).
Figure 4.1 The Users panel.
3. Click on the New User button. The New User dialog box opens (see Figure 4.2). 4. Type the user’s full name in the Name field. 5. Enter a user ID in the Short Name field.
Connecting with OS X
Chapter 4
NOTE A user ID is a one-word user identification of no more than eight characters. Many network operating systems, such as NetWare, prefer this type of ID to a full given name. OS X requires that the short name be composed of all lowercase characters. The short name must contain eight or fewer characters. So, bproffitt would not work, but bp would (although it’s not very helpful as a descriptive ID).
Figure 4.2 Adding a new user starts here.
6. To select a Login Picture, click on one of the images provided in the selection area at the bottom of the New User dialog box.
TIP To use a custom figure for the Login Picture, you can drag and drop a picture from the Finder into the Login Picture field. You can also click the Choose button and use the Open panel to select an image file.
7. Click on the Password tab to open the Password page (see Figure 4.3).
111
112
Part I
Basic Mac OS X
Figure 4.3 Set up a user’s password at the very beginning of the user creation
process.
8. Type at least a four-character password in the Password field. 9. Type the same password in the Verify field. 10. In case a user forgets his password, give him a hint in the Password Hint field. 11. Click on Save. The New User dialog box closes.
TIP If you have been using the machine with just one user, the Automatic Login panel appears to ask if you want to turn the feature off. Automatic Login simply starts the desktop of the first user created on the machine. If you have multiple users, this is impractical, so click the Turn Off Automatic Login button.
12. Quit System Preferences. Once you’ve added a user, you will see that user listed among a choice of users at the first screen when you start your computer. There, users can log in to their accounts using their assigned passwords.
Connecting with OS X
Chapter 4
Still, you don’t have to wait until the system goes through the steps of changing the user. Switching users without powering down the machine is easy, as you will see next.
Task: Switching Users in OS X 1. When ready to switch users, click the Apple, Log Out menu option. A log out message window appears.
TIP Use the Shift+Å+Q key combination to start the logout process.
2. Click the Log Out button. The main login screen appears. 3. Click on the username to use. The other user names vanish from the users list, and the Password field appears. 4. Type the user’s password into the Password field. 5. Click on the Log In button to log in the selected user.
Updating a User Account When you have all the users up and running on your system, little administrative work is required to maintain their accounts. The administrator is responsible for changing a user’s password if he or she forgets it, however. In OS X, the administrator account is the first user account created when the operating system is installed. Having just one administrative account is not a very good idea. After all, what if the administrator is out sick or traveling out of town? Redundancy is not a bad plan, and the following task shows you how to let other users perform administrative tasks.
Task: Granting Administrator Privileges 1. In the Dock, click on the System Preferences icon. The System Preferences window opens.
113
114
Part I
Basic Mac OS X
2. Click the Users icon. The Users panel opens. 3. Click on the user account you wish to change. 4. Click on the Edit User button. The user’s dialog box opens. 5. Click on the Password tab to open that page. 6. Click on the Allow User to Administer This Computer check box. 7. Click on OK to close the User’s dialog box. 8. Quit System Preferences. Sometimes, you need to remove a user’s access to the computer. (A child goes off to college; a spouse is banned from the computer for buying too many Dr. Pepper collectibles on eBay; a co-worker moves to a new job.) The next task shows you how to change your users list.
TIP If you need to temporarily block access to the user’s account, you could simply edit the account as an administrator and change the password. That way, the user’s information is saved until he or she returns.
Task: Removing a User 1. In the Dock, click on the System Preferences icon. The System Preferences window opens. 2. Click the Users icon. The Users panel opens. 3. Click on the user account you wish to remove. 4. Click the Delete User button. The Delete Confirmation panel opens (see Figure 4.4). 5. Click on the administrator account to which you want to transfer the removed user’s files. 6. Click the Delete button. The user is deleted and the Delete Confirmation panel closes. 7. Quit System Preferences.
Connecting with OS X
Chapter 4
Figure 4.4 All the user’s files are transferred to one of the administrator
accounts so they aren’t lost.
Now that your users are set up and ready to go, they need passwords to protect their important (and not-so-important) files.
Password Connections A user’s primary password is very important. It not only allows him or her to log on to the computer, but it is also instrumental in using OS X’s Keychain function, which will be covered in the next section. Unfortunately, as important as passwords are, many people let them fly right out of their brains. To compensate, many users use a password that’s simple for them to remember, like a spouse’s or child’s name. The problem is, anyone who does half a minute of guesswork can crack these passwords. Even worse, some users don’t use passwords at all, thinking that no one will want to look at their material. That’s a naive attitude, and it does not take into account the well-meaning co-worker who wants to check some data on a file on your computer while you’re away—and accidentally changes the document. Obviously, the harder a password is to crack, the more protection you will have. Don’t choose a password that resembles a word in English, French, or any other language. Mixed-up letters and numbers are great because they’re impossible to guess and very difficult for password-hacking programs to crack.
115
116
Part I
Basic Mac OS X
I recommend thinking of a stanza from your favorite song and using the first letters of the words in that stanza and make a password from it. For example, the last line of a famous Led Zeppelin song would create the password “asbtsth.” Then there’s the line from the song “Feelings”: “fnmtf.” You get the idea. As long as you remember the words to your favorite little ditty, you will remember your password. But there’s always that one person who forgets….
TIP Apple has admitted that for now, in Mac OS X 10.1, only the first eight characters of a password are actually used in the password recognition process. They are expected to improve this, but in the mean time, just be sure that the first eight characters in your password are the hardest to guess!
Task: Changing a User’s Password 1. In the Dock, click on the System Preferences icon. The System Preferences window opens. 2. Click the Users icon. The Users panel opens. 3. Click on the user account you wish to change. 4. Click the Edit User button. The User’s dialog box opens. 5. Click the Password tab to open that page. 6. Type at least a four-character password in the Password field. 7. Type the same password in the Verify field. 8. If your user consistently forgets his password, give him a strong hint in the Password Hint field. 9. Click on OK to close the User’s dialog box. 10. Quit System Preferences.
Setting Up a Keychain Knowing your user password is very important in OS X, because it allows you to log on to the computer, and also provides access to many different Internet and network locations.
Connecting with OS X
Chapter 4
The secret behind this convenience is the OS X Keychain application. Actually, keychains were designed for the OS 9. The principle is simple. As you move through the Internet, a number of servers need to verify your identity before letting you access their files. Each server might have its own username and password scheme, too. If users have trouble remembering one password, imagine how much hassle it will be to remember many passwords. A keychain enables you to gather all the usernames and passwords and lets you access sites that need the password all by using a single, master password. Thus, you get one keychain holding a collection of “keys” to access information on other computers. Every user account gets one keychain that is tied directly to that user’s ID and password. But, if many servers are being accessed, and they are of many different types (such as newsfeed sites, shopping sites, mail servers, and so on), a user may want to create a separate keychain for each category.
Task: Creating a New Keychain 1. In Finder, open the /Applications/Utilities folder. 2. Double-click the Keychain Access icon. The application opens (see Figure 4.5).
Figure 4.5 Your default keychain contents are listed here.
117
118
Part I
Basic Mac OS X
3. Click on the File, New Keychain menu option. The Save Default Title dialog box opens (see Figure 4.6).
TIP You can use the Å N key combination to create a new keychain.
Figure 4.6 Choose a title for your new keychain.
4. Type a title for the new keychain in the Save As field. 5. Click on the Save button. The Save Default Title dialog box closes, and is replaced by the New Keychain Passphrase dialog box (see Figure 4.7).
Figure 4.7 Give your new keychain a secure password.
6. Type a password or a complete phrase in the Password or Phrase field. 7. Type the same information in the Verify field. 8. Click on OK to close the New Keychain Passphrase dialog box. The new keychain’s window appears. 9. Quit Keychain Access.
Connecting with OS X
Chapter 4
Editing a Keychain After you set up a keychain, you’ll want to add keys to the chain. You collect these keys as you go around a network to other computers. There are two ways to add keys. A few OS X applications, such the as Mail and Network Browser applications, can add keys to your keychain automatically. When you first set up a Mail account, the username and password information are copied as a key to your default user keychain. If you browse to another computer on the network with Finder, and you’re asked to provide a password to access a remote server, a check box option asks if you want to create a key on your keychain. If you click on this option, the next time you come back to the same machine, your keychain will log in to the remote computer for you. Not every application works automatically with keychains. Internet Explorer is one glaring example of this statement. Because it has its own password-management functionality, the default browser for OS X completely disregards keychain functionality. However, you can manually add keys to a keychain for Web sites. There is a catch, though. Not every site will correctly receive a username and password from the keychain through Internet Explorer. It’s a hit or miss proposition. But you can still use the keychain, if only as a location to store all of your important passwords.
TIP You can also use the keychain to store noncomputer information, such as credit card numbers and PINs.
Task: Creating a New Password Item 1. In the Finder, open the /Applications/Utilities folder. 2. Double-click the Keychain Access icon. The application opens.
TIP If you use keychains a lot, consider adding the Keychain Access application to the Dock or as an alias on the Desktop.
119
120
Part I
Basic Mac OS X
3. Click on the Add button. The New Password Item dialog box opens (see Figure 4.8).
Figure 4.8 You can use the keychain to store any kind of password information.
4. In the Name field, you can enter a descriptive name for the password item or the URL for the Web page needing the password. 5. Enter the account or login information in the Account field. 6. Type a password in the Password field. 7. Click on Add to close the New Password Item dialog box. The new item window appears in the keychain window. 8. Quit Keychain Access. When you have more than one keychain, only the default keychain appears when you start Keychain Access. To access other keychains, choose the Keychains menu in Keychain Access. If you want to make another keychain the default, follow the steps in the next task.
Task: Altering the Default Keychain 1. In Finder, open the /Applications/Utilities folder. 2. Double-click the Keychain Access icon. The application opens.
NOTE Depending on the Locked status of the keychain you are opening, you may need to enter the password for the keychain to open it.
Connecting with OS X
Chapter 4
3. Click the Keychains menu and select the keychain you want to open. 4. Click on the Keychains, Make Default menu option. The open keychain becomes the default. 5. Quit Keychain Access. There is, unfortunately, one very serious drawback to using keychains. Someone can gain access to the main password for your keychain if the keychain is selected and you click on the Get Info option and then select the View Password option. This is because OS X will unlock the user’s entire keychain at login, which means that anyone can walk up to your computer while you are away and just grab your stored passwords. Therefore, you should lock your keychains, preferably just after login is complete. All keychains present a Locked option, which protects the sensitive information you are storing. Locking a keychain renders the contents of the keychain unviewable, even to you. Locking a keychain manually is simple: in the open keychain window, click on the Lock button. If you click Unlock in the same window, the computer will ask you for the correct password for the keychain. Once you provide it, the keychain opens.
TIP If you want to lock all of your keychains at once, click the File, Lock All Keychains menu option.
You can, for additional security, configure your computer to lock a keychain automatically after it has been inactive for a while or when the system sleeps. This is a very good idea, given the vulnerability in the keychains we have just mentioned.
Task: Locking a Keychain Automatically 1. In Finder, open the /Applications/Utilities folder. 2. Double-click the Keychain Access icon. The application opens. 3. Click the Keychains menu and select the keychain you want to configure from the list.
121
122
Part I
Basic Mac OS X
4. Click on the Edit, Settings menu option. The Change Settings dialog box opens (see Figure 4.9).
Figure 4.9 Configuring a keychain.
5. Click the Lock After x Minutes of Inactivity check box. 6. Enter a new minute value in the minutes field. 7. Click the Lock When the System Sleeps check box.
TIP You can click the Change Passphrase button to alter the password for this keychain.
8. Click on Save. The new settings are saved. 9. Quit Keychain Access.
Summary In this chapter you explored the various ways in which a user can connect with OS X. With the addition of multi-user access, OS X is a much better platform to manage the workflow and security of having many users, but only one machine. The inclusion of Keychain technology further enhances this security. In Chapter 5, “Exploring the New Finder,” I examine how to use the system’s tools to manage your documents and files.
Chapter 5 Exploring the New Finder
124
Part I
Basic Mac OS X
n the mid-1990s, the wave of the future was Internet appliances. While the computer experts looked on in amusement and dismay, marketers were fixated on providing the general public with these Internet-only devices that would allow users to surf the Internet with impunity—and without all of that pesky PC overhead, such as a hard drive.
I
Web-only devices had one serious flaw: no audience. Businesses wouldn’t buy them because their office workers needed a more productive platform. Home users wouldn’t buy them because they needed something to help them with little Joanie’s homework, such as a word processor (or something to run their games). Internet appliances are a good idea in some respects. The ability to tap into the Web is something we’d all like to have at our fingertips. But Internet usage can be divided into two categories: entertainment and knowledge gathering. If users are purely into entertainment, then Web-only appliances have some merit. But often, users must obtain knowledge and work with it, manipulate it, and present it in a new form. For that, you need the tools of a full-fledged computer. When they put together OS X, Apple’s development team recognized that using the Internet would be a central task for many users. But Apple has not fixated on this idea to the exclusion of all else. OS X is designed to make working with documents and files (the real meat of using any computer) as simple as possible. Towards this effort, a good deal of time and effort was put into the Finder, Apple’s file manager application and (in OS X), keeper of the desktop.
The New File-Storage Concept Before OS X, the Desktop was the king of the Mac OS. In earlier versions of Mac OS, the Desktop represented a single, all-user directory that was the top level (or root level) of the Mac OS file system. Root is a concept that (until OS X) was not used much in the Mac world. It was used more in Unix and Linux circles, where the directories are represented with tree-like structures. Each directory is a branch of the tree, and the root directory is the one from which all the others branch off. For instance, on a DOS-based PC, C:\ is the root directory of C:\Documents\Work\June_Project, because C:\ is the container directory that holds everything else—directories and files alike. On a Linux machine, “/” is the notation for the root directory because Linux does not use drive letters as DOS does.
Exploring the New Finder
Chapter 5
NOTE Don’t confuse root with root user. A root user is the user who possesses all privileges on a given system. In Mac terms, the root user is the ultimate administrator. Administrators are not root users, however. The root account is a separate entity that Apple intentionally disabled to prevent experienced Mac OS 9 users from easily trashing their system with superuser powers. The owner and other administrative accounts allows most of the admin functions of root without the dire consequences.
In Mac OS (prior to OS X), the root directory was essentially the Desktop. From there, you could access any volume on the computer, and all of the folders within the selected volume. With the introduction of multi-user functionality, OS X is no longer centered on the Desktop. In a single-user environment, you can make the desktop the root folder of the Mac OS directory structure. But when you introduce multiple users to the equation, using the desktop as the root folder becomes impossible. Something else must become the root, which leads to a whole new directory structure. In Mac OS 9, the directory structure was simple. The desktop was the root directory from which users accessed all other folders. Figure 5.1 is a bird’s-eye representation of how the Finder displays the OS 9 directory structure. The typical OS 9 platform, of course, has many more folders than depicted in Figure 5.1, depending on the installed applications on a particular system. These other folders are not important to represent here, because Figure 5.1 serves only as a comparison with the new OS X directory structure.
Figure 5.1 Part of the OS 9 directory structure.
125
126
Part I
Basic Mac OS X
Figure 5.2 represents how the Finder displays a typical OS X directory structure, where the Classic OS 9 and the new OS X each reside on their own volumes on the OS X platform. Again, this by no means shows all of the folders in the OS X directory tree. But it gives you an indication of how much is changed in OS X. For example, the Desktop is no longer the root folder; the Computer folder is now the root. In the Computer folder, you find all of your computer’s volumes. In Figure 5.2, those volumes are the Network, OS 9, and OS X. The Network volume is a pointer to any servers on your network. This is covered in more detail in Chapter
Figure 5.2 Part of the OS X directory structure.
Exploring the New Finder
Chapter 5
12, “File Sharing.” In the meantime, you’ll take a quick look at the OS 9 and OS X volumes. Figure 5.3 is a look at a system’s OS 9 volume, down to the first level of folders. You can see many similarities to how OS X organizes its own directory structure.
Figure 5.3 An OS 9 volume from within OS X.
However, note the Desktop Folder within the OS 9 HD volume. Even in its own volume, OS 9 does not get to be the root directory—at least not when you’re running OS X. Instead, all of the contents of the Desktop are in the Desktop Folder, which is on the same level of the other first-level folders in the OS 9 volume.
NOTE The Desktop Folder contains all of the aliases on the OS 9 Desktop.
Everything else about the OS 9 volume is structured exactly as you would find it if you were running OS 9 and looking at the volume in that operating system. The layout of the OS X volume, which is named OS X HD on this machine, is as follows: directories: Applications, Library, System, and Users (see Figure 5.4). These are the “four horsemen” of an OS X volume. These key folders must remain, unchanged, in their installed location for Mac OS X work properly.
127
128
Part I
Basic Mac OS X
Figure 5.4 An OS X installation has a standardized directory structure.
In previous versions of Mac OS, you could move the contents within folders (including applications) at will. An application could still find a moved file to open it; a relocated application could be opened as it always had been. This is no longer the case. Now several key folders within OS X are protected. This means that applications and documents within some OS X folders cannot be moved or removed at all. For example, everything in the System folder must stay put—the only thing you could do is copy files and applications from this folder to another location, and for a good reason. If core files were altered or relocated, OS X would not be able to find them. Unlike previous versions of Mac OS, OS X is built on an operating system kernel that is much more dependent on a file’s location in the directory structure. It doesn’t matter which folder applications are in when you execute them. Like all good Mac applications, they will run from wherever you double-click on them. Here’s an example: the Help Viewer is a small application that is tapped by most other applications running in OS X: Finder, iMovie, Mail—they all use it to display their help files. If I were to copy the Help Viewer from its home location (/OS X HD/System/Library/CoreServices) and put the copy on the Desktop, I could double-click on the Desktop icon for the Help Viewer and run it without incident. But if I were to invoke system administrator privileges and (foolishly) delete the original Help Viewer, I would run into trouble when I tried to run Help from within any application, because OS X has told the applications that the Help
Exploring the New Finder
Chapter 5
Viewer file they need is and would always be in the OS X HD/System/Library/ CoreServices folder. If Help Viewer were moved, renamed, or deleted, it would seriously gum up the works when someone clicked a Help menu option.
CAUTION Besides critical folders, three other files within OS X must be left alone as well: mach, mach.sym, and mach_kernel, located at the top level of the hard drive where an OS X installation resides. Moving or deleting these files will decapitate OS X. So don’t touch them.
Another potential pitfall would be if you moved some applications files and folders around without ill effect. You might think that you’re home free, but the next time you apply an upgrade to OS X, and the installation can’t find the files it needs in the right place, you may completely lose the use of OS X. You can add folders and subfolders at will and move and rename them as necessary. But the basic structure of OS X’s directories—the way they appeared “out of the box”—cannot be altered. The next few sections cover the contents of each of these top-level OS X folders and how they relate to each other.
Applications Folder The Applications folder is very straightforward. After all, virtually all of the OS X applications are there.
NOTE If you have Mac OS 9 installed on your computer in addition to Mac OS X, you’ll find two Applications folders. The folder named Applications contains the OS X applications only. The folder Applications (Mac OS 9) contains your original Mac OS 9 programs, which will work as part of the Classic environment.
Any user can view the contents of the Applications folder, but only an administrative user can adjust the contents. Regular users can only make copies or aliases of
129
130
Part I
Basic Mac OS X
the applications and files within the folder. Table 5.1 lists the applications in the Applications folder within a standard OS X installation. Table 5.1 The Applications Folder Application
Description
Acrobat Reader 5.0
The standard client application for reading PDF files
Address Book
Apple’s contact manager
Calculator
A simple calculator application
Chess
The latest version of this Apple game now has voice recognition
Clock
An analog clock for the Dock
Image Capture
An application to retrieve images from digital cameras and scanners
iMovie
The simple and fast way to edit digital movies
Internet Connect
Replaces Remote Access for dial-up Internet connections
Internet Explorer
The most prolific browser client in the world
iTunes
A great application for listening to CDs or ripped music files
Mail
Apple’s default e-mail client
Preview
The system’s default image viewer
QuickTime Player
The best way to view QuickTime multimedia files
Sherlock
The main Apple search application
Stickies
Create memos to yourself to slap on the screen
System Preferences
The OS X control panel
TextEdit
A simple text editor
AppleScript Subfolder Script Editor
A tool to create AppleScripts
Script Runner
An application to test AppleScripts
REALbasic Subfolder REALbasic 3.5.1
A tool to create REALbasic -based applications
Exploring the New Finder
Chapter 5
Table 5.1 The Applications Folder (continued) Application
Description
Utilities Subfolder AirPort Admin Utility
Wireless network configuration tool
AirPort Setup Assistant
Wireless network setup tool
Apple System Profiler
Provides a complete look at your machine’s statistics
Applet Launcher
Starts Java programs
ColorSync Utility
Configures the monitor for finely tuned colors
Console
A system reporting screen for Mach kernel activities
CPU Monitor
Monitors the level of activity of the CPU
DigitalColor Meter
Reports color values on the screen
Directory Setup
Configures network-mounted directories
Disk Copy
Creates images of hard disk volumes
Disk Utility
Contains a number of tools that assist in maintaining your hard drive
Display Calibrator
Configures the monitor preset color schemes
Grab
A screen-capture utility
Installer
OS X’s default installation utility
Java Web Start
The Java Runtime Engine for OS X
Key Caps
A keyboard-capturing application
Keychain Access
A management utility for your keychains
NetInfo Manager
A network browser and administrative tool
Network Utility
A compilation of useful network tools
Print Center
Administration tool for local and remote printers
Process Viewer
A utility that reports all running processes on your system
StuffIt Expander
A file compression/expansion utility
Terminal
A command-line interface application
131
132
Part I
Basic Mac OS X
Library Folder If you have poked around in the folders and files within your OS X system, you have noticed the number of folders named Library. Each Library folder has its own job. You can deduce what these jobs are by the Library folders’ locations in the directory structure. For example, the top-level Library folder contains collections of files and folders that are available to all users. Every user has access to the contents and settings that these files dictate. Within the top-level Library folder are about 20 folders that all of the assigned users can tap into. The exact number of folders varies, because as you activate certain services on your computer, the number of these folders increases. The contents of all of these folders can be modified only by an administrator (which is a good thing, because monkeying around with these files too much could cause problems for your computer). Even as an administrator, you want to be very judicious in how you interact with these files. The second Library folder is System/Library. The contents of this Library folder are only for the system itself to use; no users should alter these files. You will examine this in greater detail in the next section. The third Library folder is the one within each user’s individual account folder (for example Users/proffitt/Library). The contents of this Library folder are much the same as those of the top-level Library folder, except that only the individual user benefits from his or her unique Library folder. Much of the multi-user separation of preferences takes place here. Table 5.2 presents some of the more interesting folders within Library. (Interesting, because these are folders that you can add content to and that enrich your overall OS X experience.)
System Folder The System folder has long been the core of the Mac OS and is where all of the items relating to the functioning of the operating system are stored. The contents of the OS X System folder are much more inviolable than the contents of System folders of the past. OS X has only one item in System: the Library folder. So, when referring to the System folder, you should really refer to the System/Library folder.
Exploring the New Finder
Chapter 5
Table 5.2 The Library Folder Folder
Description and Use
Desktop Pictures
Contains the background pictures for the system. Add your own pictures directly into this folder to have them displayed in the Desktop panel.
Fonts
Contains the fonts available to all users (not the system fonts). You can add additional fonts to this folder if you want more.
Screen Savers
Contains the screen savers available to all of the system’s users. You can add different screen savers to this folder to give your users more choices.
User Pictures
Contains the login pictures for each user. Add your own graphic here to have it available for the users.
Again, the administrative user is the only person authorized to manipulate files and folders in System/Library. Even to the administrative user, I issue a stern warning: very few of these files can be changed or moved without causing serious problems with running OS X. And don’t think that your experience with other versions of Mac OS will help you, because the contents of this folder won’t be what you expect. Table 5.3 lists and explains some of the important folders in System/Library. The System/Library folder has much more functionality; Table 5.3 just gives a quick glance at the most easily recognizable contents. For example, the Frameworks folder holds the files that comprise the core components of OS X’s modular functionality: Cocoa, Java 2, Carbon, and Classic, as well as Audio, OpenGL, Quartz, and QuickTime. Table 5.3 The System/Library Folder Folder
Description
Core Services
Contains Finder, Dock, Menu Bar, and other key components to OS X.
Extensions
Contains Apple extensions for hardware devices.
Fonts
Contains the system fonts for OS X. Do not add or remove fonts from this folder.
Sounds
Contains the system sounds for OS X.
133
134
Part I
Basic Mac OS X
NOTE Don’t worry if you don’t know what all of these core components do. They are covered in detail in Chapter 6, “What’s under the Hood?”
The System/Library folder should not be adjusted, even by the administrator! On the other side of the coin is the Users folder, which all users can get their virtual hands on.
Users Folder Every user who has an account on a particular OS X system has an accompanying folder in the Users folder. The Users folder simplifies dealing with user accounts. The Users folder has three main folder levels that you will examine in this section. In Figure 5.5, you can see the first two levels of the Users folder structure displayed in the Finder window. The contents of the Users folder comprise the first level of this structure, which is made up of one folder for each user and a Shared folder. The use of icons is important in the Users folder. The icon that looks like a little house represents the home folder for the user who is currently logged on. In this
Home Folder
Figure 5.5 The Users folder.
Exploring the New Finder
Chapter 5
figure, proffitt is logged on, so his folder is marked as the home folder. Proffitt is the only user folder the proffitt account can access. Clicking on the Home icon in the Finder window’s Toolbar displays the user’s folder. All users can use the shared folder, because it allows them access to files they might otherwise be unable to access. In Figure 5.6, you can see how OS X displays inaccessible folders.
Denied Access Icon
Figure 5.6 Access is denied to other users’ folders.
Except for each user’s Public folder, no user can readily access the contents of other users’ folders. If files need to be shared between users, they can use their own Public folders, and request that other users get the files they desire from there. But this requires a lot of mouse clicks. Also, this option is only available if an administrator has turned on File Sharing in the Sharing Preferences panel. A simpler approach is to place shared files in the Users/Shared folder. Accessible to all users, this folder is the ideal place to save and open files that require user collaboration. Each user account folder contains eight subfolders that form the backbone of user file management. Users can add, modify, or remove any folder in their account folders, though some restraint might be in order on removing, because some applications look for certain folders on your computer. Table 5.5 lists these folders and describes the purpose of each one.
135
136
Part I
Basic Mac OS X
Table 5.5 The User Account Folders Folder
Description
Desktop
Contains any item on your Desktop. This cannot be removed.
Documents
The suggested location for all user-created documents.
Library
Contains the application- and user-specific configuration files.
Movies
The suggested location for all user-created video files.
Music
The suggested location for all user-created music files.
Pictures
The suggested location for all user-created image files.
Public
If File Sharing is activated, the location for users to exchange files, using the Drop Box.
Sites
The location of all files used for Personal Web Sharing.
The functionality within these folders is examined at various points throughout this book. The Drop Box, for instance, is covered in the “Controlling Access to Folders and Files” Task later in this chapter. But one folder that deserves a quick look now is the (you guessed it) third and final Library folder we need to examine. For an individual user, this is a very important collection of files; these files allow a user to modify many aspects of his user environment. Table 5.6 lists some of the important Users/<user>/Library subfolders, and what they mean for users. These folders are at once storable and transportable. Being storable makes all of these folders (and the others in this Library folder) easy to back up. Just drag and drop the folders to another volume, and they are backed up in one fell swoop. Table 5.6 The Users/<user>/Library Folders Folder
Description
Addresses
Contains the contact data for the Mail application’s address book
Fonts
Contains fonts specific to the user
Mail
Contains the message data for the Mail application
Preferences
Contains all of a user’s set preferences
Exploring the New Finder
Chapter 5
They are also transportable. If you ever have to work on a new computer, you can drop these files into your user account’s Library folder on the new OS X machine, which duplicates many of your settings from the first machine—very handy. This concludes your brief examination of the OS X folder structure. Feel free to poke around the folders and files to discover the nuances of OS X. Of course, you have a specific tool to accomplish all this exploration: the OS X Finder. The Finder is central to many key activities within OS X, so it’s important to get the most out of this file-management tool.
Working with the Finder The Finder has been retooled from prior versions of Mac OS. This is probably one of the most jarring changes made to the Mac OS; the Finder has looked and behaved the same way since 1984. The look of the Finder is the most stunning change: Apple’s new Quartz technology brings a startling appearance to this tool. As well it should; since Finder is the central application of OS X, its look must be defined by the rest of the operating system. The major new visual presence in the Finder is the toolbar that runs along the top of the Finder window. This toolbar contains navigational tools and aliases to assist you in moving around the directory structure of your computer. It’s very customizable, so you can create a toolbar that meets your exact needs. Figure 5.7 shows a typical Finder window, opened to the root Computer folder. Just like earlier versions of Mac OS, the familiar Icon view, shown in Figure 5.7, is one of the ways to view the contents of any folder. Each icon represents a volume, folder, or file that opens or (if the file is an application) runs when you double-click it. What has changed in the Icon view is how the Finder behaves when you open a folder or volume. In previous editions of Mac OS, double-clicking a folder or volume opened a new Finder window that displayed the contents of the newly opened folder or volume. If you were digging deep into the directory structure, open Finder windows would be littered around the screen under the most recent Finder window—scattered debris from your exploration into the files. This effect would occur no matter which view you were using.
137
138
Part I
Basic Mac OS X
Back Icon Button View
List Column View View View Buttons
Title Bar
Hide Toolbar
Toolbar Shortcuts Status Bar
Folder Content Window
Figure 5.7 The basic components of a Finder window.
In OS X, there’s a completely different effect when you double-click a volume or folder in the Finder. Instead of a new Finder window opening, the contents of the opened volume or folder appear in the same Finder window. This is quite a radical step in file and folder navigation for experienced Apple users, and it takes a bit of getting used to. This single-window mode of navigation is the reason Apple has included the Back button to help you navigate the system’s file structure.
TIP If you don’t like this single-window mode, click on the Finder, Preferences menu command and in the Finder Preferences dialog box that appears, click on the Always Open Folders In A New Window check box.
Clicking on the Back button (in the upper-left corner of the Finder toolbar) takes you back to the previous screen. In the Icon view, this is very important because you can only “drill down” into the next level of folders within the Finder contents.
Exploring the New Finder
Chapter 5
Backing up, therefore, is impossible without the Back button. The Back button also has its uses in the other two views in the Finder. In the List view, the Back button is pretty important, though in the Column view, it is more a matter of convenience than of necessity.
TIP If you Å+click on the text in the Title Bar, a pop-up menu details all of the subfolders that have gotten you where you are in the directory structure.
The Status Bar, located just under the toolbar, displays information on the items in an open folder. You can obtain information, such as number of items in the folder, memory available, and read/write access. Curiously, the Status Bar is not active by default in the Finder. To activate the Status Bar, click View, Show Status Bar in the Finder. The Status Bar stays put until you remove it with the View, Hide Status Bar menu command. So what are these three views of the Finder? The Icon view you have already seen, but how about the other two? One, you will see, is an old standby of the Finder. And the other is something completely new. I will examine all of them in the next section.
Icon, List, and Column Views In the Finder of Mac OS versions past, you can use three views in the Finder: the Icon view, the List view, and the Button view. In these earlier editions of the Finder, the Icon and Button views behaved similarly, except that in Button view, icons appeared atop grey square buttons that users had to single-click to open. The grey buttons would not mesh very well with the new Aqua interface, so Button view is a thing of the past. Replacing the Button view is the all-new Column view, which is a very different interface (as you will learn in the “Working with the Finder’s Column View” section later in this chapter). Changing the view mode in the Finder is a piece of cake, thanks to the View buttons in the Finder toolbar (the View buttons are highlighted in Figure 5.7). In the next task, you’ll see how they work and what other methods you can use to switch views.
139
140
Part I
Basic Mac OS X
Task: Switching Finder Views 1. Open any volume or folder by double-clicking it on the Desktop.
TIP If you don’t want to look at your files from a particular spot in your directory structure, type Å+N on the Desktop to open a new Finder window opened to the root Computer folder.
2. Click the List view button. The Finder shifts to the List view (see Figure 5.8).
Figure 5.8 The Finder’s List view of the Computer folder.
3. To shift to the Column view, either click on the Column view button, or on the View, As Columns menu command. The Finder shifts to the Column view (see Figure 5.9).
Exploring the New Finder
Chapter 5
Figure 5.9 The Finder’s Column view of the Computer folder.
As you move through the Finder and use different views on different folders and volumes, the view for each folder changes to the last-used view for that folder. This change leads to some disconcerting interfaces with the Finder—you could be looking at the Computer folder in the Icon view, the OS X volume in the List view, and the Applications folder in the Column view. If you don’t like all of this view-switching, you can force the Finder to maintain view consistency.
Task: Keeping Consistent Finder Views 1. From a Finder window or the Desktop, click on the Finder, Preferences menu command. The Finder Preferences dialog box opens (see Figure 5.10). 2. Click the Keep a Window’s View… check box to select it. 3. Click the Close Window button. The changes are applied in the next Finder window you open.
141
142
Part I
Basic Mac OS X
Figure 5.10 The Finder Preferences dialog box.
The Icon view’s functionality has not changed much in OS X. Double-click an icon to open or run it—that’s the main way of getting around in the Icon view. Windows users will find it similar to the basic functionality of the Windows Explorer. The other two Finder views—List and Column—can be a bit more daunting to Windows users. And the Column view is new to Mac users as well. But with a little time, you will see that these views are not complicated at all.
Working with the Finder’s List View The List view, like the Icon view, functions in the same way in OS X as it did in earlier versions of the Finder. In Figure 5.11, the contents of a typical OS X volume are displayed in the List view. This figure displays a number of open folders in the directory structure. You can open folders in inside the directory or outside of it. If you want to open a folder and see where its contents are in relation to other folders on your system, singleclick the folder-expansion control (the arrow to the left of the folder) to reveal the folder’s contents. Clicking on an expansion control of an already-opened folder closes that folder’s contents. If you are solely interested in the contents of one particular folder, just doubleclick on that folder. The contents of that folder are displayed in a new Finder window (see Figure 5.12).
Exploring the New Finder
Folder Expansion Control Folder File
Chapter 5
Sort Order Category Indicator Columns
Figure 5.11 The components of the Finder’s List view.
Figure 5.12 You can make the List view display only the contents of a particu-
lar folder.
The List view has four columns. These columns display specific information about the folder or file listed onscreen. The default column categories are Name, Date Modified, Size, and Kind, where Kind reflects the type of document. You can sort the contents of any folder by any of these categories. To accomplish this, simply click on the appropriate column heading to highlight it. The contents of the window are sorted according to that column’s category.
143
144
Part I
Basic Mac OS X
You can sort every column in two ways: ascending (A-Z, 1-10) or descending (ZA, 10-1). The small arrow on the right side of a highlighted category points up to indicate ascending order, and down to indicate descending order. You can switch between ascending and descending order by clicking on the highlighted column heading until the indicator arrow points in the right direction. Of course, you are not limited to just these displayed categories; these are just what the Finder uses by default. Nor do you have to leave these columns in the same order, as you will see in the next Task.
Task: Customizing the List View 1. Open any volume or folder by double-clicking it on the Desktop. 2. Click on the List view button. 3. Click on the View, Show View Options menu command. The folder’s Preference panel appears (see Figure 5.13).
TIP Type Å+J in the Finder to open a folder’s View preference panel.
4. Click the Global option button. (The Global option enforces your changes on all folders shown in List view.)
Figure 5.13 The View preference panel for a folder in List view.
Exploring the New Finder
Chapter 5
5. Click the Close Window button. The changes are applied in the next Finder window you open. 6. Click on the check boxes to select or clear the categories you want displayed.
NOTE You cannot remove or modify the Name category from the List view.
7. Click on the close window button to close the Preferences panel. 8. To change the order of the displayed categories, click and drag the column header of the column to be moved (see Figure 5.14). Dragged Column
Figure 5.14 Moving a column.
9. When the outline for the column is in place, release the mouse button. The column appears in its new position.
Working with the Finder’s Column View The Column view of the Finder is the most significant change to the Finder application, but it is not an original way of doing things.
145
146
Part I
Basic Mac OS X
This view is a direct result of the merger of NeXT OS and Mac OS; the Finder’s Column view is directly analogous to the Browser view in NeXT’s OpenStep Workspace Manager. The idea of the Column view is not very complicated. Each column represents a “level” of your computer’s directory structure. By clicking on the contents of one level, you open the contents of the next level in the adjacent column. This is similar to the cascading effect of multi-level menus in Mac applications: click on a menu option, and a submenu appears. In the Finder, click on a folder, and the contents of that folder open in the next column. This continues until you click on a file. Here, you only have to single-click on a folder to open it; doubleclicking opens files and starts applications. When you click on a file, you see a detailed description of the file in the last column in the sequence. You can see an example of this in Figure 5.15. Column File Scrollbar Information
Figure 5.15 Digging into a file in the Column view.
In Figure 5.15, notice that some columns have their own scrollbars that enable you to scroll vertically through the folder’s contents. You can also click and drag each column’s borders to resize them horizontally. In the case of multimedia files, you can get a lot more than just a snazzy little bit of information telling you about the files; you can actually preview the files without opening a viewer application!
Exploring the New Finder
Chapter 5
To preview a multimedia file, select one, such as an audio or video clip, as shown in Figure 5.16. If the file’s format is compatible with OS X’s default viewer application, you only need to click the Play button under the clip to preview the contents of the file. Horizontal Scrollbar
Multimedia Controls
Preview Window
Figure 5.16 Getting a quick look at a home movie.
If you have delved deep into your system’s directory structure, you may have scrolled into columns beyond the width your Finder window can handle. When that happens (refer to Figure 5.16) the Finder presents a horizontal scroll bar that lets you slide back and forth across the columns. Unlike the other views, you cannot customize the Column view in the Finder. Navigating in the Column view takes a bit of getting used to, but if you keep at it, you should become proficient in no time.
Using the Finder’s Toolbar No matter what view you are using in the Finder, you can use the toolbar to navigate the files in your system. You have already reviewed the Back and View tools of the Finder toolbar; now you’ll examine the shortcut icons. By default, the Finder toolbar has four shortcut icons: Computer, Home, Favorites, and Applications. Clicking on any of these icons takes you to the folders they represent.
147
148
Part I
Basic Mac OS X
You can add your own icon to the toolbar, too. Just click and drag a folder onto the toolbar. When you release the mouse button, the icon appears in the toolbar. Removing an icon from the toolbar is a little bit more involved, as you’ll see in the following Task.
Task: Customizing the Finder’s Toolbar 1. Open any volume or folder by double-clicking it on the Desktop. 2. Click on the View, Customize Toolbar menu option. The Toolbar panel appears.
Figure 5.17 The Finder’s Toolbar panel.
3. To move an icon on the toolbar, click and drag the icon to its new position. 4. To remove an icon from the toolbar, click and drag the icon off of the toolbar area. 5. To place a new icon on the toolbar, click and drag one of the special icons from the displayed set.
Exploring the New Finder
Chapter 5
TIP If you want to undo all of your changes, click and drag the entire default setup to the toolbar. This set replaces all of the toolbar changes you have made.
6. Click the Done button to apply your changes. You should have a pretty good idea of how to navigate your computer’s files with the Finder. But what can you do with the Finder besides look at files? Quite a lot.
Common Finder Tasks In this section, you’ll move away from the “How does the Finder work?” mode and towards the “What can I do with the Finder?” mode. One of the first things you may do after you explore your directories is to rename some files and folders. In the next Task, you’ll see how easy that is to do.
Task: Naming Files and Folders 1. Using the Finder, navigate to the file or folder you want to rename. 2. Click on the file or folder name once, pause, then click on it again to select the label for the file or folder.
TIP In the List view, you only need to click on a folder name once to select the label.
3. Type the new file name. 4. Click anywhere in the Finder window or Desktop. The change is applied. Another very common job is to add new folders. This short process is outlined in the next Task.
149
150
Part I
Basic Mac OS X
Task: Creating New Folders 1. Using the Finder, navigate to the folder in which you want to create the new folder. 2. Click on the File, New Folder menu command. A new folder icon with the selected label “untitled folder” appears.
TIP Type Shift+Å+N to create a new folder icon. This is a change from earlier versions of Mac OS, when Å+N was all you needed. If you find the change confusing, add a New Folder icon to the Finder’s toolbar.
3. Type the new file name. 4. Click anywhere in the Finder window or Desktop. The change is applied. Renaming and creating folders is pretty simple. So is moving and copying files and folders.
Task: Copying, Moving, and Making Aliases TIP Many users think they need more than one Finder window open to move files in separate folders. Actually, it is simpler to use the List view to drag and drop files using the list of folders.
1. Using the Finder, navigate to the file you want to move. 2. Click and drag the file to another folder location.
TIP If you do not have the privileges to move a file, the most you can do is copy it.
Exploring the New Finder
Chapter 5
3. To copy a file, hold down the Option key, and click and drag the file to another location.
TIP If you are copying a file from one volume to another, you can forego holding down the Option key; files are automatically copied when you drag them between drives and volumes.
4. To create an alias, select the original file or folder by clicking it. 5. Click the File, Make Alias menu command. The alias icon appears.
TIP Type Å+L to make an alias of an item.
6. Copy or move the alias icon to its new location.
TIP To simultaneously create and move an alias of an item, hold down Å+Option, and then click and drag the alias to its new location.
The file information in the Column view is pretty handy, but you can obtain more complete data about a file or folder by using the Finder’s Info tool.
Task: Obtaining File Information 1. Using the Finder, navigate to the file you need information about. 2. Click on the file to select it. 3. Click on the File, Show Info menu command. The file’s Info panel appears (see Figure 5.18).
TIP Type Å+I to open a file’s Info panel.
151
152
Part I
Basic Mac OS X
Figure 5.18 You can obtain information for every file.
4. Click on the options list, and select the type of information you need. Select Preview to see a preview of a multimedia file. 5. Click the close window button to close the panel. Even when files or folders are in your personal user account folders, you can share them with other users—right from their location in the directory structure. You must establish access privileges for the files or folders to enable others to view and even modify those items. Before you implement such a change, remember one thing: never share your user/Library folder. Also, you won’t need to use file sharing to connect to other computers, only when someone wants to log in to your computer.
Task: Controlling Access to Folders and Files 1. Using the Finder, navigate to the file or folder you want to change the privileges for. 2. Click on the file to select it. 3. Click on the File, Show Info menu command. The file’s Info panel appears. 4. Click on the options list, and select the Privileges option. The Privileges page appears (see Figure 5.19).
Exploring the New Finder
Chapter 5
Figure 5.19 You can control access privileges for files and folder.
5. To grant more access to members of your user group, click on the Group options list and select either Read & Write, Read Only, or Write Only (Drop Box). For all-access, select Read & Write. 6. To grant more access to all users, click the Everyone options list, and select the desired option (but be very sure you want this as an option). 7. Click on the Apply button. The new privileges are applied to the file or, in the case of a folder, all of the files within that folder. 8. Click the close window button to close the panel. OS X makes it very easy to create aliases to link to your most used files and applications. You can place aliases on the Finder toolbar, on the Desktop, and in other places. But rather than clutter up these locations, you can store aliases in the Favorites folder, which is easy to access from the Finder toolbar.
Task: Creating Favorites 1. Using the Finder, navigate to the file or folder you want to make a Favorite. 2. Click on the file to select it. 3. Click on the File, Add to Favorites menu command. The file or folder is added to the Favorites folder.
153
154
Part I
Basic Mac OS X
TIP Type Å+T to make a favorite from a selected item.
4. Alternatively, click and drag the item to the Favorites icon on the Finder toolbar. An alias for the item automatically appears in the Favorites folder.
Summary You have learned a lot about OS X’s version of the venerable Finder. Some of the application’s features have remained the same, and some are quite different—perhaps to the Apple fans’ collective dismay. While change is not always better, these changes have made the Finder (and the rest of the OS X interface) a much better environment in which to work. But where did all of these changes come from? What makes OS X so different from earlier versions of Mac OS? In Chapter 6, you’ll get a peek inside the OS X architecture, and see why it has more in common with old Unix machines than with brand-new PCs.
Chapter 6 What’s under the Hood?
156
Part I
Basic Mac OS X
t never fails: some guy buys a new car, and the first time he shows it to his friends, they stand around and peer under the hood. Never mind that it’s likely that none of these gentlemen are mechanics and have never touched a car part other than the steering wheel and the gas cap. Interestingly enough, no one thinks to pop open the case of their computer—literally or figuratively.
I
In the literal sense, poking around under the hood can be a bad idea, because too much poking around can leave a terrible impression on the computer’s inner workings. And with an iMac, opening the case is a bad idea altogether. In the figurative sense, however, looking under the hood of your Mac OS X machine is not a bad idea. Knowing what’s going on in this all-new operating system will give you a better idea of how your computer works and, more importantly, let you learn what applications will run on your machine. If you think it’s just Mac applications, you’ve got another think coming.
From Past to Present By now, you’re pretty familiar with the OS X Aqua interface. It is the most noticeable change to the Mac OS. But it is not the most dramatic change. If you were to look at the underlying structure of OS X, you would see something that has much more in common with a Unix system than with the Mac OS of days gone by. If you were to analyze the older Mac OS architecture, you would see a set of layered utilities, each with its own functions. These layers formed the connections between the computer’s hardware and the user. The first layer, connected to the hardware, was the Mac OS core layer. This layer handled memory management, input and output, and communications (such as modem or network links). “Above” this Mac OS layer was the graphics layer, which displayed all the icons, windows, buttons…everything to do with the graphics of the graphical user interface. In the previous versions of Mac OS, QuickDraw accomplished this task. The next highest layer in the old Mac OS architecture was the programming layer, which contained the tools to create the applications that run in the Mac OS. In the very early days of Mac OS, this would have been the Pascal programming language and the Assembler compiling tool, though this changed as time went by.
What’s under the Hood?
Chapter 6
Finally, there was the Macintosh Toolbox layer. The graphics layer controlled how the elements on the screen (menus, windows, buttons, and so on) were displayed, and the Toolbox controlled how these elements looked (by matching them to a specific Mac style), and how they related to one another. These relationships are important. Without them, a button might just appear on the desktop without a dialog box around it. A menu might not appear adjacent to the menu command that you clicked to activate the menu. These relationships bring predictability and continuity to the interface, and they are the most important element of the Macintosh Toolbox. Figure 6.1 depicts the relationship between all of these layers.
Figure 6.1 The ideal Mac OS architecture.
In theory, this is the way the Mac OS operated. But in reality, nothing like this neatly layered construct existed. The QuickDraw graphics layer permeated the architecture—it went way beyond its one level. QuickDraw’s functions extended all the way up to the desktop on the screen and all the way down to the Mac OS core. In many cases, it is unclear where the programming and the Macintosh Toolbox layers end and the other layers begin. Different programmers approached this
157
158
Part I
Basic Mac OS X
problem in different ways, leading to a blurring of the lines between these two layers. To make matters more interesting, later versions of the Mac OS included extensions—code that spanned all of the layers and allowed users to directly control hardware, almost completely outside of the rest of the operating system. In the end, the architecture looked more like what is displayed in Figure 6.2.
Figure 6.2 A more realistic view of the Mac OS architecture.
As time went by, more and more functionality was added to benefit the user—but not necessarily to the benefit of the operating system. Although each version of Mac OS improved, the basic structure of the operating system did not change. Instead, Mac OS was patched and prodded to do things it wasn’t designed to do. One of the biggest problems was multitasking. The original Mac OS wasn’t meant to multitask, but later versions of the operating system were assigned the task. This problem, coupled with poor memory management, caused the Mac’s infamous system crashes. (One process in an application would hijack the rest of the system’s memory and bring down all of the processes at once.) Although Apple’s OS team members did the best they could with what they had to work with, it was clearly time for a change. The result of the change is an entirely new system architecture that has real segregated layers, allowing better memory and task handling than ever before.
What’s under the Hood?
Chapter 6
The Core: Darwin The heart of OS X is the core, which is officially called Darwin. Darwin is an open source project, composed of two major elements: the Mach 3.0 microkernel and an emulation of FreeBSD 3.2 operating system. (You might recognize the terms “kernel” and “FreeBSD” as Unix-like.) A kernel is the central module of any operating system. It is the part of the operating system that loads first, and it remains in main memory. Because it stays in memory, it is important for the kernel to be as small as possible, while providing the essential services that other parts of the operating system and the applications require. Typically, the kernel is responsible for memory management, process and task management, and disk management. In older versions of Mac OS, these system management duties were handled by the Mac OS core level files—files buried deep within the System folder. Now, the Mach kernel and the FreeBSD components handle these responsibilities. These technologies are not new—Mach has been around since 1985, almost as long as Macintosh machines.
FreeBSD and Mach Mach was released in 1986, running on a multiprocessor VAX 11/784 server. The Mach Project took place at Carnegie-Mellon University, where Richard Rashid wanted to create a kernel that would support interprocess communication and multiple processes, among other things. Rashid was most interested in modular operating systems, which would perform OS functions within easily swapped and managed layers. The first release of the Mach kernel was understated, but many developers soon picked up on this microkernel’s power and incorporated it into their projects (including the NeXTSTEP OS, which used Mach 2.5). This was Mach’s first connection with NeXT. Through Steve Jobs, this early connection made Mach a major candidate for inclusion in the then-envisioned Rhapsody operating system. Mach was already a favorite among some Apple developers. Because Mach worked well on the RISC-based processors in Apple’s computers, it was a perfect candidate when developers worked to port the Linux operating system to the Mac. This new version of Linux, MkLinux, runs on a Mach microkernel.
159
160
Part I
Basic Mac OS X
Because of its modular nature, Mach can appear to run as any operating system. This is done through emulation: one operating system imitates the looks and actions of another. In some cases, the emulation is so complete that it’s hard to tell where the emulation stops and the “true” operating system begins! One of the first operating systems the Mach microkernel was designed to emulate was a version of Unix known as the Berkeley Software Distribution (BSD) Unix. BSD is one of several types of Unix, all based on the original version of Unix developed by Bell Laboratories some 30 years ago. Not all Unix versions are alike, however. The popularity of Unix far outstripped Bell Lab’s desire to copyright it for themselves. This led to a fragmentation of Unix and competing versions of what was once a single operating system. Because of the preponderance of BSD Unix software in 1985, the CarnegieMellon development team led by Rashid focused on getting Mach to emulate BSD. The inclusion of BSD Unix emulation in Mach bent the rules for a microkernel (which is really supposed to be a simple bit of code), but the end result is what the designers needed. This melding of Mach and BSD technology in 1985 proved especially fortuitous nearly two decades later, when Apple was looking for something to handle the new core for Rhapsody. Mach was clearly a good candidate, but Apple needed something like BSD to handle other functionality for the new Mac OS. BSD itself, however, was ruled out early in the selection process, because of one crucial fact: BSD Unix was a proprietary system, and Apple needed something different. The new core of Rhapsody would be open source software, and nothing proprietary could reside within that core.
Open Source The difference between proprietary software and open source software can be explained by asking a simple question: Can you see the source code or not? All software is written in a programming language, which many call the “source code.” This code is a set of human-language instructions that uses mathematical and logical statements to tell the operating system how the application wants to use the computer’s resources to accomplish a certain task. When you buy software at the store, the box contains a CD-ROM and some paper documentation that explains how to use the software. When the software is
What’s under the Hood?
Chapter 6
installed on your computer, it opens windows, runs functions, and does whatever else it is supposed to do. But at no time do you ever see the source code that went into making the application. Like the copyright on a book or a song, there is a strong sentiment among developers that says “I wrote the code, I own the code, and you will pay me to use the application I wrote with that code.” This concept is easy to enforce, because typically not even your computer has seen the source code. Computers, after all, don’t understand anything other than binary instructions that are written as 1s and 0s. So, before a computer can use an application, the programmer compiles the application’s IF…THEN statements into a collection of pure binary commands that your computer gladly accepts. The upshot of this practice is that proprietary software is difficult to examine at the source code level—unless someone releases the code. In the development community, there is a movement that believes in the openness of the source code. Letting users get at the source code, open source proponents argue, lets them customize the code to their own standards. After all, they bought the program, so why shouldn’t they own all of it? This concept of openness originated in the Free Software movement, which argued that software users should be free to: ◆ Run programs for any purpose ◆ Modify programs to meet their needs ◆ Redistribute the original programs as they wish ◆ Redistribute the modified programs as they wish This shift in software openness began with Richard Stallman, a former MIT programmer who believes that software should not be owned, but rather used for the betterment of humankind. He even created a legal definition—the GNU General Public License (GPL)—to enforce this freedom, much like a copyright would. (In fact, the GPL is often referred to as a “copyleft.”) This movement is a brilliant way to promote freedom of choice and creativity, but there have been quite a few barriers to getting Free Software off the ground—not the least of which has been the word “free.” “Free” connotes software that the developer can’t sell on the open market, so it must be something the developer is trying to pawn off on people. This is cer-
161
162
Part I
Basic Mac OS X
tainly not the case (Linux is licensed with the GPL), but the negative connotation is there. Also getting in the way were the politics surrounding Stallman and his Free Software Foundation. Like any true believer, Stallman is forthright about his belief in free software—sometimes to the point of alienating the very people he’s trying to win over. The political nature of the GPL has turned away more than one interested corporation. Open source is a term and a philosophy that seeks to depoliticize the free software ideal and make the concept of sharing an application’s source code more palatable. Open source software came about when Netscape Communications, Inc. decided to release the source code of its browser suite, Netscape Communicator, to the public, circa 1998. Faced with a tremendous loss of browser market share to Microsoft Internet Explorer, Netscape put forth the source code in hopes of generating more interest in the developer community to work on the Netscape platform. Netscape asked Eric Raymond, a prominent member of the development community, to assist in preparing the source code for distribution. Raymond, along with other prominent members of the Linux community, came up with the term open source, and defined how it would differ from free software. Open source software would be licensed in much the same way as GPLed software, though with one important difference: in the GPL, if any software works directly with proprietary software (for instance, a copyrighted module of code that is stuck within a larger application code because that is the only way to get the application to work), the source code of that proprietary, closed section of code has to be opened or the GPL can not apply. In open source, no such restriction exists. A developer can use proprietary code within an open source application. The only restriction is this: if someone modifies the source code, he or she must re-release those modifications for the benefit of others. The benefit of open source software development is that anyone can get at the source code for an application, make improvements, then release the improved code to the community. This is why Apple released Darwin as open source software. Now, in addition to Apple’s developers, there is the potential for a whole world of developers to assist with making improvements.
What’s under the Hood?
Chapter 6
To keep Darwin open source, Apple decided to use FreeBSD 3.2 instead of BSD Unix 4.4 as the operating system companion to Darwin’s Mach 3.0 kernel. FreeBSD is an open source offshoot of 386BSD, itself an Intel processor port of BSD Unix, developed in 1991 by William and Lynne Jolitz. Completely open sourced, Darwin was ready to be incorporated into OS X. But what exactly does Darwin accomplish?
What Darwin Can Do The core of an operating system accomplishes fundamental tasks—anything more complicated would slow down the whole operating system. If the core is slowed down, the rest of the OS is slowed down as well. Darwin is designed to manage three basic elements of a computer’s environment: processes, memory, and interprocess communication.
Multitasking and Multiprocessing Processes form the basis for what that application can do. Data and instructions are processes. Threads are what act upon the processes. For example, an instruction to download a file from the Internet is a process in a browser program, and the actual execution of the download is the thread. Darwin uses a fancy-sounding technology called multitasking to run multiple processes and threads far more quickly and with more stability than any other version of Mac OS. The Mach kernel can utilize two kinds of multitasking: preemptive and cooperative. Cooperative multitasking is familiar to most Mac OS users, especially if they have run the MultiFinder, which should be familiar to anyone who has used System 7.6.1 or earlier. Cooperative multitasking allows each program to control the processor (the brains of the computer) for as long as the application needs to use it. When nothing is using the processor, another application can use it temporarily. This sounds good in theory, but it depends upon the applications cooperating properly. In other words, if one application does not share nicely, then the other apps are left without any of the toys. Also, in previous Mac OS versions, multitasking management responsibilities were not always confined to the Mac OS core because some applications (like the Finder) had the authority to reach
163
164
Part I
Basic Mac OS X
through the core layer and access the system processor directly. These situations led to multitasking slowdowns, and breakdowns in Mac OS. Preemptive multitasking is new to the Mac OS. This method of multitasking, which is found in Unix and 32-bit Windows operating systems, parcels out processor time slices to each application, based on the initial requested load. If the load from one application increases, the system re-balances the time slices between all of the running apps. Darwin can switch between these two methods of multitasking, depending on the applications’ specific needs. Better yet, Darwin makes OS X capable of running on multiple processor chips. Using symmetric multiprocessing (SMP), OS X can run on machines with more than one processor, which opens up an array of functions for a Mac OS X machine including something a Mac OS has not done very well before: act as a server.
Memory Management When an application runs, it uses a specific amount of memory as a sort of workbench. On this workbench, the application has room to maneuver to complete its tasks. In an ideal world, each application would have as much memory as it needs to perform all of its tasks quickly and efficiently. Alas, memory is finite and applications have to share what resources there are. Memory management in older Mac OS versions is a minefield of stalls and crashes because, as with many other functions in the operating system, it is not confined to a specific layer. Depending on the application and the whims of that application’s developer, memory handling can be pulled in many directions. Applications can access memory that they normally can’t, making it very hard for an already-running application to receive more memory. The very fact that the Darwin kernel performs all of the memory handling is a huge improvement. A centralized memory-handling function precludes one application from being favored over the rest. Now, even if a program makes a mistake and tries to grab more memory than it should, Darwin can prevent such a grab. And, if the program gets too uppity, the kernel simply locks out that application and shuts down its processes. This may sound like the crashes that happen in the old Mac OS, but it’s not. In the old days, an application crash would likely pull down the rest of the operating
What’s under the Hood?
Chapter 6
system. With Darwin’s protected memory functionality, all of the other applications’ and operating system’s memory are maintained, leaving that workbench for the well-behaved applications to run on.
Interprocess Communications Interprocess communication is simply the passing of information from process to process. For instance, a data process may have to change its content after a thread acts upon it. Such a thread could be a new value getting added to the data process. Darwin accelerates interprocess communication by connecting it to memory management. The kernel can send messages by reassigning the piece of memory that contains the information that must be passed on from one process to another. This is a huge leap in the rate of information exchange, eclipsing the memorycopying methods of past Mac OS versions. Imagine the workbench having a bunch of pieces of paper on it. The papers represent the processes, and the writing on them represents the information within the processes. In the past, information would have to be copied onto each piece of paper that is affected by an information exchange. But in Darwin, the pieces of paper are translucent, and information is stored directly underneath the paper, on the individual sections of a tiled workbench. When information is exchanged, the tiles (which represent memory) underneath the papers are shifted and copied to lie underneath other pieces of translucent paper. This process, which is handled solely by the kernel, greatly enhances the efficiency of the processes running in OS X.
A Picture is Worth… Humans are visual creatures. After all, you’re not smelling the words in this book, are you? Computers, on the other hand, are not visual devices. When a computer processes information, all of that work is taking place as electrons and magnetic bubbles dance across circuitry so minute that you need a microscope to see the circuit paths. The process of getting all of that information into something you can see takes place on another layer over the Darwin kernel: the graphics layer. Figure 6.3 highlights the relationship between Darwin and the graphics layer.
165
166
Part I
Basic Mac OS X
Figure 6.3 Darwin and the graphics layer in OS X.
As with the older Mac OS iterations, the OS X graphics layer is a separate layer. But, unlike prior versions, applications in OS X cannot directly tap into the functions of the graphics layer. To get to the graphics layer, applications have to go through Aqua and the API layer (discussed in “The API Framework” section later in this chapter). Another big difference between earlier Mac OS versions and OS X is the fact that there is no longer just one graphics tool that renders the display. Instead of the outdated QuickDraw, OS X utilizes three separate tools (Quartz, OpenGL, and QuickTime) to run graphics for the screen.
Quartz Of the three graphics-rendering systems in OS X, Quartz is likely the one you’ve heard the most about. Apple has touted it as the future of graphics rendering, and it is the heart and soul of the Aqua interface. Quartz is a window server: a piece of technology that is designed to translate the input and output of an operating system into something that the user can visually examine and manage. The Quartz window server is not responsible for the look and the feel of all the windows, menus, and buttons; that’s the job of the Aqua interface. Rather, Quartz is responsible for the existence of all of the windows, menus, and buttons. Quartz is a unique window server because of some of the cool stuff that’s been incorporated into its bag of tricks, such as device-independent color and pixel depth (which allows for the color calibration we performed in Chapter 3, “Setting Preferences”), and layered composition (the mechanics of those nifty-looking translucent panels, menus, and the Dock).
What’s under the Hood?
Chapter 6
Layered composition is also the secret behind the neat onscreen effects, like the Genie effect of minimizing a window into the Dock. In Quartz, every pixel on the screen can be shared between all windows in real time, which allows for far smoother transitions in the interface, as well as the anti-aliased (non-jagged) fonts and clever 3-D shadow effects. Perhaps the coolest feature of Quartz is the fact that much of its functionality is based on Adobe’s Portable Document Format (PDF). (You’ve probably used the ubiquitous Acrobat Reader to look at PDF files on the Web.) Adobe developed PDF as a platform-independent way of displaying documents exactly as they were meant to be displayed. This was a natural outgrowth of Adobe’s work in prepress software such as Photoshop and PageMaker. Quartz’s incorporation of PDF technology allows for onscreen previews of graphics and even thumbnails of the document as icons in the Dock. OS X users also get automatic save-as-PDF capabilities in every native OS X application—something you would normally need a third-party tool to accomplish.
OpenGL Although Quartz is the primary renderer of graphics in OS X, it has its limitations—it is engaged to display only two-dimensional effects. For 3D graphics, such as images found in many games, OpenGL comes into play. OpenGL is an industry standard in 3D rendering. It was first implemented in 1992, and it is designed to run games, medical imaging, animation, and the powerful blueprinting CAD/CAM applications. Because it is an open standard, many developers can write their applications to take specific advantage of OpenGL’s feature set, which translates into more apps that look better for users.
QuickTime Mac users have used the third and final graphics engine in OS X for a long time, but it has never been incorporated into the operating system before. In OS X, it appears as the QuickTime multimedia engine. The integration of QuickTime as an OS X rendering engine allows any compatible-format audio, video, or graphics
167
168
Part I
Basic Mac OS X
file to be easily displayed within any OS X-native application. This is the functionality, for instance, behind video previews in the Column view of the Finder, which you examined in Chapter 5, “Exploring the New Finder.” QuickTime’s inclusion as a rendering device brings a lot of extra functionality to OS X, especially when coupled with the strengths of Quartz and OpenGL.
The API Framework “Above” the graphics layer is the place where all applications that can run on an operating system can work together: the application program interface (API). You can extend the workbench metaphor used to describe system memory to the API: if the workbench is the memory, then the API is the collection of tools that the application needs to get work done. When a developer writes an application, he or she does not have to write every single instruction that is necessary to, say, open a window on the screen. If every trivial function required intricate instructions, all applications would have trillions of lines of code and would be too big for the average computer to handle. Instead, the developer counts on the presence of tools in the API. Those tools allow the developer to write, “I need a window to open at this point” in programming language. The API knows what functions to kick off to generate that window, so the API actually sends the instructions to the graphics engine. This elegant programming shorthand is how all applications run on almost any computer. The API layer is also instrumental in keeping application interfaces similar, because different applications utilize the same tools in a given API. In OS X, there are four API environments for an application to use: two transitional APIs (Classic and Carbon), one open-standard API ( Java); and one brandnew OS X API (Cocoa). Figure 6.4 shows how these APIs relate to the other OS X layers. In the following sections, you’ll examine the roles of each of these APIs.
Mac Classic Whenever a company looks at revamping its operating system, the company must decide how to deal with the applications that ran on previous versions of that OS.
What’s under the Hood?
Chapter 6
Figure 6.4 The API layer in OS X.
The company doesn’t want to alienate customers with an OS upgrade, and if the OS is altered too much, legacy applications either will not find the API tools they need to run in the new environment, or they will be so inefficient when they do run that they’ll drag down the operating system. In the case of the jump to OS X, Apple developers had to consider that the new Cocoa API was nowhere near the specifications that the legacy Mac applications needed. The new API would leave an estimated 150,000 Mac applications out in the cold. Apple took a two-pronged approach to keeping those legacy applications viable. For the first prong, the developers decided to capitalize on the Mach microkernel’s ability to host operating system emulations; they would have one of the APIs emulate the API of Mac OS 9. This is the Classic API that runs in the API layer. The benefit of this approach is that the applications that ran on older Mac OS versions can run within the OS X environment, because the emulation allows for side-by-side use of Classic apps and OS X apps. There are drawbacks for this approach, however. All the problems associated with the previous Mac OS iterations still exist in the Classic API. For instance, Classic applications still need their memory partitions set before they can run, and they still suffer from the memory management problems that can crash themselves and any other running Classic application. Another problem is that third-party hardware drivers cannot be used with the Classic API. This is because the Classic API is just an emulation running atop the kernel, and therefore cannot directly access the hardware.
169
170
Part I
Basic Mac OS X
Clearly, the Classic API is a stopgap measure to keep a hold of the legacy apps (and thereby the legacy users) until developers can modify their apps to run within the Cocoa API. But since the Cocoa API is so different from the Classic API, that requires a lot of developer resources, time, and money. To overcome resistance, Apple introduced the second prong of their two-pronged migration approach: the Carbon API.
Compromising with Carbon Although the differences between Classic and Cocoa (which we’ll get to in the next section) are very significant, the Apple developers discovered that with minimal time and energy, existing applications could be changed to enable them to access an API close enough to Cocoa that the program could use the Aqua interface and the kernel. This “halfway” API is called Carbon. By shifting the application code to use this API, developers can create OS X-native applications that have better memory management, superior multitasking, and full access to the nifty-looking Aqua interface. What’s more, most developers can get to this halfway point by changing only an estimated 10 or 20 percent of an application’s code. This is a great incentive for the major development shops to adopt OS X. Even better, Carbon applications are 100 percent PowerPC code, and they can run under Mac OS 8 and higher.
Cocoa: The Native X Environment Cocoa is the promised land for the API layer. Applications in Cocoa are 100 percent compliant with Mac OS X, and can make full use of the system architecture, just like Carbon apps. But Cocoa does more than just take advantage of OS X. Some of the best tools in Mac OS were originally shareware or commercialware developed by programmers outside of Apple. These applications became so popular and useful that Apple often bought them to bring them directly into the OS. One such application is the Control Strip found in earlier versions of Mac OS.
What’s under the Hood?
Chapter 6
In a nod to these third-party developers, Apple made the Cocoa API with a dynamic language. Dynamic programming languages are very programmer friendly, because they have lots of self-checking abilities. With access to the tools in the Cocoa API, third-party developers from professional to amateur can create powerful and great-looking applications.
Java: Applications to Go The final component to OS X’s API layer—Java—has been around on the Web for quite some time. Java is a small and fast platform-independent programming language, making it very conducive to creating Web pages that viewers can interact with. Because Java is platform-independent, a Java page behaves the same way no matter what kind of browser you view it with. There is one catch to this feature: you need a Java engine running on your machine so it can work with incoming script on the Java Web page. The Java installed on your computer gives the incoming code a safe place to run without damaging your computer. (You wouldn’t want a Web page working directly with your system’s native APIs and kernel.) The Java 2 Standard Edition version 1.3 is installed in OS X in the API layer. It sits in the API layer because it’s really just another API: a toolbox that waits for Java code to come in and use it. Because it is effectively an API, the Java engine allows incoming Java code to use the Aqua interface and the Quartz rendering engine (if the developer of the Java code has the foresight to use these layers). Also, incoming Java archive ( JAR) files, which contain the components incoming Java applications might need, are treated as shared libraries within the Java API. This means that Java apps run much faster and need far less memory than they otherwise might.
Summary You have seen the ins and outs of the latest and greatest Mac operating system. Figure 6.5 shows you all of the layers in OS X. The Aqua interface is the fourth and final layer in the OS X architecture.
171
172
Part I
Basic Mac OS X
Figure 6.5 The OS X architecture.
Having seen the guts of OS X, you should have a clearer idea of why this platform is so special. By maintaining these strict layered functions, OS X will have incredible flexibility and scalability in the years to come. In Chapter 7, you will learn how all of this technology comes together to run applications.
Chapter 7 Working with Applications
174
Part I
Basic Mac OS X
ou can have the best operating system in the world and never get any use out of it. That’s because, marketing entreaties aside, the operating system isn’t what you really need to work with. The applications that work within the operating system are what really matter to the user. After all, a nice screen background is all well and good, but that doesn’t get the reports done for the office.
Y
OS X can run any of the applications created for earlier Mac OS versions, plus a host of applications designed specifically for OS X. OS X handles its applications differently than earlier versions. In this chapter, you will learn to install and remove applications, update and run them, and use Classic applications seamlessly.
Package or Bundle? Applications on Mac OS have always looked like a single executable file. This is a far cry from Windows application storage, where applications include a single executable file and a slew of shared library files and a number of specific changes to the operating system’s Registry and… well, you get the idea. But in Mac OS, the situation is not much better. The one-file-per-application methodology is just a well-meaning sham. Earlier versions of Mac OS kept applications in one file, called a package. To install an application, all you had to do (essentially) was drag the icon for the application (package) from a CD or floppy disk to your hard drive. To remove that application, you would simply drag the package to the Trash. But there were usually many files within the package. The single application executable might be in some user-defined folder with all of the other application executables, but other files in the package (such as the ones controlling preferences, fonts, and extensions) would appear in the System Folder. The package file automatically tracked where to place the files, and in older versions of Mac OS, it did not matter where in the file structure files were placed. But the core of OS X’s file structure—the Mach and FreeBSD kernel that comprises Darwin—strongly depends on file paths (see Chapter 5, “Exploring the New Finder”). Older versions of Mac OS were not completely independent of file and folder location, but you could relocate or rename even the System Folder. Because of the radical shift in file structure for OS X, Apple’s developers feared that the users would have to start giving a hoot about file location.
Working with Applications
Chapter 7
In Darwin, files are located according to function; the program executable could be in usr/bin, the icons in usr/share/application, the plug-ins in usr/libexec, and so on. Suddenly, files are scattered all over the hard drive, and installs and uninstalls become as labyrinthine as for Windows applications. In the end, the solution was to borrow another piece of technology from the NeXTSTEP OS: opaque directories. Opaque directories are virtual metadirectories that span across the file structure and are undetectable to the user. The operating system could place applications in an opaque directory (called a “bundle” in OS X) that would look like a single file. The bundle would contain any number of component files for the application, which (no matter where the bundle was located) would be placed in the appropriate folders in the OS X file structure. All the font files would be stored in the proper Fonts folders, all of the preferences in the Preferences folders, and so forth. But the Finder (and therefore the user) never sees these component files. The only file that the Finder displays is the primary bundle: the single application icon that the user can place anywhere on the OS X system. In short, this method appears to behave like the old package method—you won’t be able to tell the difference, no matter how you install or uninstall your applications.
Installing and Removing Applications Because of the existence of the bundled application file, you can install applications in OS X using the same technique used in prior Mac OS versions: drag an application (bundle) file onto your hard drive, then double-click it to run it. That’s it; you’re done. But software engineers always have to make things a little more complicated. Dragging and dropping an application bundle is all well and good, but it does not provide the opportunity for the software developers to get their license agreements in front of the user, and it precludes the user from making important decisions about how to set up the application. You can install an application in OS X in three basic ways: the drag-and-drop routine described above; the small-scale installation routine (typically using an expansion program like StuffIt or StuffIt Lite); and the full-scale installation and
175
176
Part I
Basic Mac OS X
setup routine, performed by third-party installation programs that the software developers put together. The small-scale installation routine is the most common one for OS X applications because putting together such a package is so simple. These packages are light on memory (and therefore faster to download), and they’re simple for the user to utilize. The following Task demonstrates a small-scale installation of StuffIt Lite, the best expansion and compression utility for OS X. In this Task, the user has downloaded the compressed software from a Web site. The Download Manager in Internet Explorer automatically decompressed the file and placed a folder containing the installation file on the Desktop.
NOTE Sometimes the Download Manager handles the first step of file decompression for you; sometimes not. If it doesn’t, simply start the installation process by double-clicking the compressed file.
Task: Installing a Compressed Application 1. Double-click the newly installed folder icon on the Desktop. The Folder opens in the Finder (see Figure 7.1).
Figure 7.1 A lone installation file.
Working with Applications
Chapter 7
2. Double-click the icon for the installation file. The Authenticate dialog box appears to confirm that you have the Administrator privileges to install this application. 3. Type your administrative password into the Password or Phrase field, and click on OK. The splash screen for StuffIt Lite appears. 4. Click on Continue. The IM_Installer Read Me dialog box appears (see Figure 7.2).
Figure 7.2 Many new applications want you to read important information
in the Readme file.
5. Click on Continue. The Software License Agreement dialog box appears.
NOTE You will likely see a License Agreement in every multi-step installation you perform, as most software developers have lawyers running around demanding such things.
6. Click on the Agree button. The IM_Installer dialog box opens (see Figure 7.3). 7. StuffIt Lite has no setup options, so simply click on Install. An Install Where? dialog box appears (see Figure 7.4). 8. Select an appropriate folder location (and it really should be the Applications folder), and click on Choose. The installation process begins.
177
178
Part I
Basic Mac OS X
Figure 7.3 Many installations provide setup options in this kind of
dialog box.
Figure 7.4 Choose where to install StuffIt Lite.
9. When the installation is finished, click on the Quit button. 10. Click and drag the compressed file and any installation folders from your Desktop into the Trash. This example is only indicative of small-scale operations: few choices, not too much to set up. Not every installation goes exactly like this one. For instance, some applications just display the License Agreement, and once you’ve agreed to it, the rest of the installation takes place automatically. Pay attention to every
Working with Applications
Chapter 7
installation, no matter how simple you think it is. Subtle differences between each installation routine can trip you up if you assume too much. On the other end of the spectrum are the third-party installers. These come with the really big apps, like Microsoft Office, Adobe Photoshop, or QuarkXPress. Before installing get out your cup of tea (or coffee), and settle in for a good hour of poking and prodding. These installation routines are in a class of their own because they typically have so many setup options. One such routine is the one created for Microsoft Office X, which is the subject of the next Task.
Task: Installing a Major Application 1. Insert the Office X CD into the CD-ROM drive. The Microsoft Office X icon appears. 2. Double-click on the Microsoft Office X icon. The Microsoft Office X window appears (see Figure 7.5).
Figure 7.5 The Microsoft Office X installation choices.
3. Double-click the Microsoft Office Installer icon to open the Microsoft Office Installer dialog box (see Figure 7.6).
179
180
Part I
Basic Mac OS X
TIP You can skip all of the setup steps, and simply drag and drop the Microsoft Office X folder icon shown in Figure 7.5 onto the volume icon for your hard drive. This sets up every Microsoft Office X component and takes you up to Step 8 in this Task.
Figure 7.6 Beginning the installation process.
4. Click on the options list near the top of the dialog box, and select the Custom Install option. The list displays the available components (see Figure 7.7).
Figure 7.7 Select which components you want to install.
Working with Applications
Chapter 7
5. Click on any of the check boxes to fill or clear them as you desire. 6. Click on the Install Location options list, and select a desired folder in which to install the applications. 7. Click on Install. A status window appears, highlighting the progress of the installation. 8. Click on Quit when the installation is finished. The Microsoft Office X Setup Assistant dialog box opens (see Figure 7.8).
Figure 7.8 Office X wants you to perform more detailed setup steps.
9. Fill in all of the information on the first screen of the Setup Assistant. Be sure to use the proper CD key from the software’s CD jacket. 10. Click on Next. The Personal Information and License Agreement screen appears. 11. Read the end-user license agreement by clicking on the View EULA button. 12. When finished, click on Accept. The Product Identification Information screen appears. 13. Click on Next. The Microsoft Office X Registration screen appears. 14. Click on Register Now. The information gathered in the installation process is sent to Microsoft via the Internet, and the installation program closes. Microsoft Office X is now installed (see Figure 7.9).
181
182
Part I
Basic Mac OS X
Figure 7.9 The opening screen of Microsoft Office X.
Again, the way Office X is installed differs from other large applications. The intent here is to give you a feel for the amount of effort you have to put forth to install such an application or suite of applications. No matter how simple or complicated an installation may be, removing an installed application is ridiculously easy. Thanks to the bundled nature of applications in OS X, all you have to do is drag and drop the application’s icon (or the subfolder in which it resides) to the Trash. Once you empty the Trash, the application is permanently removed from your computer.
Using Software Update Software Update is a rather elegant feature that Apple carried over from earlier versions of Mac OS. From the moment you installed OS X, the Software Update application has been keeping an eye on all of your applications. Based on a schedule you set, Software Update checks a central Web site to see if there are any updates for OS X system files or any of the applications you have installed (see “Task: Scheduling Software Updates” later in this chapter).
Working with Applications
Chapter 7
If the application finds an update, Software Update pops up on the Dock, giving you the option to download and install the updates. In the following Task, you can see how Software Update works after it notifies you of an available update.
TIP Software Update is an elegant but murderous feature for dial-up Internet users. Not everyone has DSL or cable modems yet, and even Apple seems to have forgotten this. Software updates typically are multi-megabyte files that could take hours to download using a 56K modem. If you have a 56K modem, you should consider upgrading your Internet connection or find a friend with a fast connection who can copy the essential software updates onto a CD. And make sure you have set System Update to retrieve updates manually.
Task: Performing a Software Update 1. When Software Update appears (usually at the beginning of a session) examine the list of available updates in the Software Update window (see Figure 7.10). 2. To select a file for update, click on its check box.
Figure 7.10 The main Software Update window.
183
184
Part I
Basic Mac OS X
3. To ignore a certain update, click on the file to select it. 4. Click on Update, Make Inactive. The Make Inactive panel drops down (see Figure 7.11).
Figure 7.11 You can choose to ignore updates you will likely never use, such as
language updates.
5. Click on Make Inactive. The panel closes, and the selected option disappears from the list of available updates.
TIP You can select multiple updates with Shift+Click, and make them inactive all at once to save time.
6. Continue choosing applications or making them inactive until you’ve examined the entire list. Then click on Install. The Authenticate dialog box may appear if you need Administrator privileges to install these updates. 7. Type your administrative password into the Password or Phrase field, and click on OK to download and install the updates.
Working with Applications
Chapter 7
NOTE Depending on the update(s) you installed, you may be asked to restart the computer. If so, close all open applications and click on the two Restart buttons that appear.
Even if you like to have every file as new as possible, choosing to make some updates inactive is not a bad idea. Language updates are an excellent example of this. No one in my office reads Korean, so I don’t want to pull down a 40 MB file for Korean Language Support. Some day I may hire a Korean speaker, however, and I will want Software Update to begin tracking those updates again.
Task: Reactivating Inactive Updates 1. When Software Update appears (usually at the beginning of a session) it displays the number of inactive updates near the bottom of the Software Update window. Click on the Update, Show Inactive Updates to reveal the list of inactive updates (see Figure 7.12). 2. Click on the file(s) you want to become active. 3. Click on Update, Make Active. The selected update(s) appear in black text.
Figure 7.12 Inactive updates appear in gray-shaded text.
185
186
Part I
Basic Mac OS X
4. Click on the check boxes for the updates you want to use, then click on Install. The Authenticate dialog box appears to confirm that you have the Administrator privileges to install this new application. 5. Type your administrative password into the Password or Phrase field, and click on OK to download and install the updates. You can schedule Software Update to check for new files on a daily, weekly, or monthly basis. By default, Software Update checks for new files on a daily basis. If you have a dial-up connection, however, you might want to decrease the frequency of checks to free up your connection.
Task: Scheduling Software Updates 1. From the Desktop, click on the Apple menu, System Preferences. The System Preferences window appears. 2. Click on Software Updates. The Software Update panel appears (see Figure 7.13).
Figure 7.13 Scheduling an update.
3. Click on the Check for Updates options list. You can choose between three options: Daily, Weekly, or Monthly. 4. Click on Weekly or Monthly.
Working with Applications
Chapter 7
TIP If you ever want to start an update manually, come to this panel in System Preferences and click the Update Now button to start Software Update.
5. Quit System Preferences. Now that you have the basics of installing and updating your applications down pat, you’ll move on to how OS X runs your applications—specifically, the technique used to run Classic applications.
Classic and Carbon Applications According to the literature provided with OS X, the ability to run Classic applications within OS X is seamless. This is a bit of a stretch; running Classic applications isn’t an invisible process. As you will see in the next Task, OS X must take a few steps to get the application up and running.
Task: Starting a Classic Application 1. From the Finder, navigate to an application in the /Applications (Mac OS 9) folder. 2. Double-click on the application icon. The Classic Environment Starting From… window appears to mark the progress of the Classic environment startup (see Figure 7.14). 3. To view the start of the Classic environment in more detail, click on the expansion arrow near the lower left corner of the Classic Environment Starting From…window. The entire emulation screen appears (see Figure 7.15). 4. When the environment is through loading, the application starts (see Figure 7.16).
187
188
Part I
Basic Mac OS X
Figure 7.14 Any time you start a Classic application, your computer must
start the Classic environment.
Figure 7.15 The Classic environment must start just as if OS 9 were being
booted up.
Working with Applications
Chapter 7
Figure 7.16 A Classic application running within OS X.
If you look closely at Figure 7.16, you can see that while the Dock is in place as an OS X element, the Menu Bar and window of the Netscape browser have reverted to the older Mac OS appearance. Even the Switcher (the OS 9 Application menu) is back on the Menu Bar! Remember, OS X is designed to emulate different environments simultaneously. To smoothly run Classic applications, Apple’s developers decided to have a fully functional version of Mac OS 9 run as a virtual environment. The transition between environments is almost seamless; it just takes a little while for the first Classic environment to get started. Once the Classic environment has started, Classic applications start up without delay. There is also no need to formally switch between Classic and Carbon applications. Figure 7.17 shows Internet Explorer 5.1 coexisting with the older Classic Netscape Communicator 4.77, each displaying identical pages with their own interfaces.
189
190
Part I
Basic Mac OS X
Classic
Carbon
Figure 7.17 Classic and Carbon applications maintain their own interfaces.
You can switch between the applications as you normally would, by clicking on the windows or using the Dock icons. The emulation is so well done that you can even cut and paste text between Classic, Carbon, and Cocoa applications. The Classic virtual machine remains running for as long as you are logged into the current user account. If you plan to use Classic applications often, you can have the Classic environment start up when you first log on to OS X.
Task: Starting Classic Automatically 1. From the Desktop, click on the Apple menu, System Preferences. The System Preferences window appears. 2. Click on Classic. The Classic panel appears (see Figure 7.18). 3. Click on the Start Up Classic on Login to this Computer check box to select it. 4. Quit System Preferences.
Working with Applications
Chapter 7
Figure 7.18 The Classic control panel.
On the other hand, you may not want the Classic environment running when you aren’t using it. (It uses a little bit of memory when it’s running.) The following Task illustrates how you can stop the Classic environment.
Task: Stopping Classic 1. From the Desktop, click on the Apple menu, System Preferences. The System Preferences window appears. 2. Click on Classic. The Classic panel appears. 3. Click the Stop button. The Classic environment shuts down. 4. Quit System Preferences. There is nothing special that must be done to run applications that use the Carbon API. In fact, many of the applications that use the Carbon API (these are referred to as “Carbonized” applications) look so much like the Cocoa applications that you probably can’t tell the difference.
191
192
Part I
Basic Mac OS X
Figure 7.19 displays the AppleWorks 6 application, which runs in OS 9 just as well as in OS X. It uses the Aqua interface, just like a Cocoa application. But we know it’s a Carbonized application because it can also run in Mac OS 9.
Figure 7.19 A Carbon API application.
The only applications that need extra effort to run are the Classic applications. And even then, the computer automatically puts forth the effort.
The Application Menu In the Menu Bar of every Carbon and Cocoa application, the first entry after the Apple menu is the application’s name. This area is called the Application menu. Each Application menu contains a couple of important menus: the Services menu and the Preferences menu.
Using Services OS X automatically adds the Services menu to any Carbon or Cocoa API application. Unfortunately, this is no guarantee that the items in the Services menu will work.
Working with Applications
Chapter 7
The Carbon and Cocoa APIs place a skeleton/placeholder menu in the Application menus of all applications using these APIs. The developer must activate those placeholder services, and perhaps add more services. Otherwise, the options in the Services menu appear dimmed, meaning they’re unavailable. As OS X evolves, these services will become more available in OS X-native applications. Until then, it will be a hit or miss to see which services are active. One example of an active service is the Grab service. It is active, for instance, in the TextEdit application.
Task: Using the Grab Service 1. From the Finder, start the TextEdit application. The TextEdit window appears. 2. Click on TextEdit, Services, Grab, Screen. The Screen Grab panel appears (see Figure 7.20). 3. Click anywhere outside the Screen Grab panel to capture the screen. The figure appears in the TextEdit document window.
Figure 7.20 Grabbing a screen for TextEdit.
193
194
Part I
Basic Mac OS X
Figure 7.21 The screenshot within TextEdit.
4. Edit the document as needed. 5. When finished, save the TextEdit document and close the application. 6. In the Dock, click on the Grab application to make it active. 7. Quit the Grab application.
Setting Preferences The functionality of the Services menu is a bit spotty, but most applications have a working Preferences menu or command. Found in each program’s Application menu, the Preferences menu is the gateway to the application’s own preferences dialog box. Each application’s preference settings are different. But having a consistent method of accessing those preferences is very convenient. Beyond the Application menu are more tools that can help you run your applications. In fact, one such tool will help you put the brakes on any application that gets out of control.
Working with Applications
Chapter 7
Force-Quitting Applications Nothing in the big wide world is perfect. No matter how good OS X and its application set are, the occasional hiccup makes something go really wrong with an application. The causes for such events are almost too many to count. A bad function line, incompatible software, a badly-written piece of Javascript, user error…many things can bring down an application in any operating system. When this happens, OS X’s first response is to block off the offending application from the rest of the system, and let the application quietly crash, doing little damage to the application or the operating system. But, every once in a while, something goes awry, and OS X is unable to shut down a malfunctioning program. When this happens, you must call for a Force Quit. OS 9 users should be aware that this new version of Force Quit does not leave the computer in an unstable state that requires a restart, like the OS 9 Force Quit does. So it is a much more useful tool.
TIP If a Classic-environment application crashes and Force Quit is used, it is advisable to restart Classic (if it doesn’t kill itself), as its memory partition will be unstable, just as OS 9 would be after such an operation.
Force Quitting an application overrides the application that’s running, and tells it to stop running. This is very simple to do, as you will see in the next Task.
Task: Force-Quitting an Application 1. When an application freezes or malfunctions, click on the Apple menu, Force Quit menu option. The Force Quit Applications dialog box appears (see Figure 7.22).
TIP You can also start the Force Quit operation be pressing Å+Option+Esc.
195
196
Part I
Basic Mac OS X
Figure 7.22 Force quitting is a fast process.
2. Click on the name of the malfunctioning application to select it. 3. Click on the Force Quit button. A confirmation panel appears. 4. Click on Force Quit again. The malfunctioning application closes. 5. Click on the Close Window icon. The Force Quit Applications dialog box closes.
Summary By now, you know the basics of using applications within OS X. There are not many surprises here, as the Apple developers have taken great pains to make the OS X experience as close to previous versions of Mac OS as possible. In Chapter 8, you’ll examine an old favorite, the Sherlock search engine, and see how it has changed under OS X.
Chapter 8 Sherlock
198
Part I
Basic Mac OS X
omeone, I’m not sure who, once said: “in a paperless society, documents will never be lost again.” On the surface, it seems like a reasonable notion. After all, you have electronic files, all of which should have descriptive names, all of which are located somewhere on a finite hard drive. How hard could it be to find anything?
S
Anyone who has ever stayed up until 2 a.m. looking for that lost piece of data that is absolutely critical to the annual report draft due at 8 a.m. can attest to the vulnerability of electronic files. The fact of the matter is, the contents of a disk drive are only as organized as the human who uses it. Unorganized users often fling files across the folders and directories with no rhyme or reason. Even the most organized person may occasionally “lose” data due to a misnamed file. Into this sticky wicket of searching for meaningful data, there comes Sherlock, OS X’s specialized search engine. Sherlock appeared in Mac OS 8.5, replacing the Finder as the primary search engine for internal document searches. But Sherlock can do a heck of a lot more than search hard drives. Using modular search technology, users can employ Sherlock to search the Internet. Better yet, users can supply their own search sites in the form of plug-in files, which makes custom searches a snap. Sherlock 2 for OS X has refined the search model from the earlier versions of Sherlock. Users can add and save search sites and individual search criteria to Sherlock, which is a real boon for doing repetitive searches.
Performing Searches Sherlock can perform on two levels. For casual users, it is pretty good at looking for files and documents on your computer and for searching for specific Web pages. For power users, Sherlock cannot be dismissed as merely a very strong search application. Sherlock’s strength lies in its easy customization. Sherlock is very flexible. From the depths of your hard drive to the depths of the Internet, it scales itself to your search needs.
Searching Locally Users most often use Sherlock to look for files and documents in their own backyards—on their computers. Even if you’re so organized that you arrange your pencils by degree of sharpness, this is a valid use for Sherlock.
Sherlock
Chapter 8
For example, I am pretty organized about where I put my files, but the applications that were preinstalled on my iMac are another matter. This is because of the dual nature of OS X—some of my apps are in the Applications folder and some are in the Applications (Mac OS 9) folder. Rather than digging through these folders and all of their subfolders, I use Sherlock to locate the application I’m looking for. You can search for files with Sherlock by name, contents, or with a custom search. This last category is a catch-all for a myriad of search parameters, from file size to creation date to file type. You will examine these parameters in more detail later in this section. Here’s a look at the most common use of Sherlock: looking for a file by name.
Task: Finding a File by File Name 1. Click on the Sherlock icon in the Dock. The Sherlock window appears (see Figure 8.1).
Search Field Find Button
Volume/Results Window
Description Window Figure 8.1 The main Sherlock window.
199
200
Part I
Basic Mac OS X
TIP You can also start Sherlock by clicking on the File, Find option in the Finder, or by typing Å + F in the Finder.
2. If it is not selected already, click on the File Names option button to select it. 3. Type a term or a word in the search field. 4. In the On column of the volume window, click the checkboxes of the volumes and folders you want to search. 5. Click on the Find button. Sherlock searches the selected volumes and folders for any file name that contains the term or word you entered. 6. When the results appear in the results window, click on one of the files. The file’s location in the directory structure is shown in the description window (see Figure 8.2).
Figure 8.2 You can see exactly where files are.
Sherlock
Chapter 8
7. To open the file or folder, double-click it in the results window. The document opens in the appropriate application, or the folder opens in the Finder. One of the nice things about searching for files by name is that you don’t have to recall entire file names to run a search. In the example above, I was able to use the word “skating” to find files with much more complete file names. Unlike searches in other operating systems, you do not have to use wildcard characters like *skating.* to locate a particular file. You don’t even have to use complete words: I could have typed in “skat” and gotten the same results. If you cannot recall any words in the name of the file you are trying to find, you may want to search for a file based on its contents. To do this, however, you must index the contents of the files on your drive first. Indexing is very important to the file contents search process, because it gives Sherlock a leg up on performing time-consuming searches. It also peeks inside documents to index their contents so you can perform file content searches. Sherlock automatically reindexes any folder in the volume window whenever you start it. It will not, however, automatically index files in a given volume; you must do it manually. You must also do this if you have Sherlock running, and you have recently moved many new files into an indexed folder.
Task: Indexing a Folder or Volume 1. In Sherlock, click on the folder or volume you want to index. 2. Click on the Find, Index menu option. The indexing process begins. Now, once the volume you want to search is indexed, you can search for files by their content.
Task: Finding a File by Contents 1. Click on the Sherlock icon in the Dock. The Sherlock window appears. 2. Click on the Contents option button to select it. 3. Type a word or phrase in the search field.
201
202
Part I
Basic Mac OS X
4. In the On column of the volume window, click the checkboxes of the volumes and folders you want to search. 5. Click on the Find button. Sherlock searches the selected volumes and folders for any file that contains the phrase you entered. The results are displayed in order of relevance (see Figure 8.3).
Figure 8.3 The more times a search term appears in a document, the more
relevant the document.
6. When the results appear in the results window, click on one of the files. The file’s location in the directory structure is shown in the description window. 7. To open the file or folder, simply double-click it in the results window. The document opens in the appropriate application, or the folder opens in the Finder.
Sherlock
Chapter 8
Before you examine the custom search—the last category of searching for files locally—you must perform some additional configuration techniques to optimize your searches by file content. In Figure 8.1, the volume window displayed the volumes and folders that could be searched when you entered a search term. Both volumes on my machine were listed, as was the user folder for my account. This may seem a bit redundant. After all, it stands to reason that everything within the selected volumes will be searched. This is certainly true for file name searches, where information about a file can be gathered without much work from Sherlock. The file name is examined, compared to the search parameters, and then it’s done. But to search file contents, your computer must examine a lot more information. Your computer must open each file and (if applicable) search for a specific phrase or term. Depending on the size of the files involved, a search may take a very long time. To decrease this time, Sherlock takes a focused index approach to searching file contents. Every folder and volume that you select in Sherlock is automatically indexed, meaning that file contents are examined and certain keywords are recorded and set into an index file before the search actually begins. This presearch accomplishes a lot of the content searching so that when a search is actually run, the search goes a lot faster. Here’s the catch: Sherlock has instructions not to make an index file bigger than a certain file size. A hyper-detailed index of an entire volume of files might occupy half the size of the volume itself. So, the rule is that the bigger the volume or folder being indexed, the less detailed that index will be. This is what is meant by “focused” indexes. If a smaller folder is added to the array of searchable folders in Sherlock, that smaller folder’s index will be more detailed; fewer files to examine means more room in the index file, so it can hold more information. To use the file content search, you must use a file index. It makes sense to make more detailed indexes to monitor your file contents. To do this, point Sherlock at a different folder on your computer, or even on the network. The indexing occurs automatically, as you will see in the next Task.
203
204
Part I
Basic Mac OS X
NOTE The volume that contains the entire OS X directory structure cannot be indexed. That’s because an index for a given folder must be saved to that folder. Some folders (especially those inaccessible to the user) cannot be written to, so indexing is blocked for the entire set. To circumvent this, you must index the specific folders to which you specifically have read-write access.
Task: Adding a Folder to the Searchable Volumes 1. In Sherlock, click the Find, Add Folder menu option. The Add panel drops down (see Figure 8.4).
Figure 8.4 You can index any folder you can normally access.
2. Using the column view, navigate to the folder that you want to add to the search. 3. Click on Add. The folder is added to the list of volumes and is immediately put through the indexing process (see Figure 8.5).
Sherlock
Chapter 8
Indexing in Progress
Figure 8.5 Sherlock immediately indexes new folders.
4. In the On column of the volume window, click the checkboxes of the new folder.
TIP You will get more accurate results with file content searches if you do not include nonindexed volumes or folders in the search parameters.
There may be times, however, when you cannot recall the name of the file or the contents of the file. This typically coincides with the times you most need the file. If your brain is taking a vacation, don’t give up. The custom search options in Sherlock enable you to use other parameters to locate the file. The following Task shows you how to access these options and focuses on how to find a file by date created.
205
206
Part I
Basic Mac OS X
Task: Finding a File with a Custom Search 1. Click on the Sherlock icon in the Dock. The Sherlock window appears. 2. Click on the Custom option to select it. 3. Click on the Custom options list to select one of the five options on the list. 4. If you need more options, click on the Edit option. The More Search Options dialog box appears (see Figure 8.6).
Figure 8.6 Some of the options available for a custom search.
5. If desired, click on the Date Created checkbox to select it. The options list for that field becomes active. 6. Click on the Date Created options list and select one of the 16 date parameters if you want to use this for your search. 7. Click on the month, day, and year fields, if need be. Type the appropriate number in each field, or use the spinner controls to increase or decrease the values of each field. 8. Click on OK. The More Search Options dialog box closes. 9. In the On column of the volume window, click the checkboxes of the volumes and folders you want to search. 10. Click on the Find button. Sherlock searches the selected volumes and folders for any file that matches the parameters you enter. The results are displayed in the results window.
Sherlock
Chapter 8
11. Click on one of the files. The location of the file in the directory structure is shown in the description window. 12. To open the file or folder, simply double-click it in the results window. The document opens in the appropriate application, or the folder opens in the Finder. Believe it or not, the More Search Options dialog box in Figure 8.6 displays only a few of the search parameters. Clicking the Advanced Options button in that dialog box reveals more search options, as shown in Figure 8.7.
Figure 8.7 All of the options for a custom search.
You can activate each of these options by checking their checkboxes, and you can use these parameters in any combination you want. Table 8.1 lists each of the parameters and their possible options and modifiers. Table 8.1 shows the many search parameters that you can use to find an errant file. Usually, one of these parameters will locate the lost file on your local machine or on a connected network server. As you have seen, Sherlock works well when you are dealing with your machine and your network; but how does it handle the Internet?
207
208
Part I
Basic Mac OS X
Table 8.1 Custom Search Options Option
Value
Modifier
File Name
Word or Phrase in File Name
Contains Starts With Ends With Is Is Not Doesn’t Contain
Content Includes
Word or Phrase in File Content
Date Created
Date
Is Is Before Is After Is Not Is within 1 Day Of Is within 2 Days Of Is within 3 Days Of Is within 1 Week Of Is within 2 Weeks Of Is within 3 Weeks Of Is within 1 Month Of Is within 2 Months Of Is within 3 Months Of Is within 6 Months Of
Is Today Is Yesterday Date Modified
Date
Is Is Before Is After
Sherlock
Chapter 8
Table 8.1 Custom Search Options (continued) Option
Value
Modifier
Is Not Is within 1 Day Of Is within 2 Days Of Is within 3 Days Of Is within 1 Week Of Is within 2 Weeks Of Is within 3 Weeks Of Is within 1 Month Of Is within 2 Months Of Is within 3 Months Of Is within 6 Months Of Is Today Is Yesterday Size
Memory (in KB)
Is Less Than Is Greater Than
Kind
Alias
Is
Application
Is Not
Clipping File Control Panel Desktop Printer Document Extension Folder Font Letter Sound
209
210
Part I
Basic Mac OS X
Table 8.1 Custom Search Options (continued) Option
Value
Modifier
Stationery File Type
File Type
Is Is Not
Creator
Name of Creator
Is Is Not
Version
Version Value
Is Is Not
Folder
Empty
Is Is Not
Shared
Is Is Not
Mounted File/Folder
Is Locked Is Unlocked
Name/Icon
Is Locked Is Unlocked
Has
A Custom Icon No Custom Icon
Is
Invisible Visible
Searching the Internet Like the human brain, the Internet is a vast collection of data nodes connected in a network that seeks the fastest connection between those nodes. And, like the human brain, there must be an upper limit on the amount of information that can be stored within the network. But we will probably never know what that limit is.
Sherlock
Chapter 8
The human brain can store every experience you ever have . That is a lot of memory, but your brain never reaches capacity. The same is true for the Internet. The capacity of the Internet is always shifting and growing, as more servers come online. This ever-increasing dynamic network is the reason that no single Internet search engine or directory service can totally index the Internet. Besides the constant growth of the Internet, search engines must contend with the “invisible Web.” The invisible Web is the term for Web sites and Web pages that are not directly connected to any other pages. These could be Web sites that people set up to show pictures of their dogs, for example. The only people coming to these sites are the friends and family of the webmasters. No links lead to or from these sites. Some search engines are designed to seek out these sites, searching by Internet address rather than through hyperlinks. But these are slow to build, and not very numerous. Most search engines work by hopping from link to link, so such sites go unnoticed. If a webmaster does not announce his site on a directory service such as Yahoo! or LookSmart, there will be no evidence that the site exists. Hence, it is part of the invisible Web. The best way of searching the Internet is to diversify your search approach. Many of us have a favorite search engine or directory service (I use Google constantly, for instance). Often, our favorite tools are enough to get us what we need. But for really comprehensive searches, it’s best not to fall into the familiarity trap. Analyze your search topic, and find words or phrases that you can use. “Hard drives” is far too generic to successfully use as a search topic. “PowerMac hard drives” is better. Narrow down the topic as much as possible, and think of alternative ways of expressing the same topic. Next, choose the best search tool. The more broad and general the topic, for instance, the more you should use directory services. They allow you to start general, and narrow down to something you can use.
TIP If you use a directory service, use the search tools built in with the service. Casually browsing the directory links simply takes too long if you’re looking for something specific.
211
212
Part I
Basic Mac OS X
If the topic is very specific, you’ll have more success using a search engine like Lycos or Google. Pay attention as you go. Learn from your successes and mistakes. If a particular tool consistently doesn’t work, for goodness’ sake, stop using it. Look for new tools, and try them. Sherlock provides access to multiple Internet search sites at once. You can choose which sites you want to search based on your needs. To make it easier to find search sites, Sherlock organizes them into channels. Sherlock has eight channels by default: ◆ Files—The file search engine for Sherlock ◆ Internet—A collection of Internet search sites ◆ People—People-specific search sites ◆ Apple—Apple-specific Web sites ◆ Shopping—Popular shopping and commerce sites ◆ News—News and finance Web sites ◆ Reference—Encyclopedia and dictionary Web sites ◆ Entertainment—Music and movie search sites The Files channel is what you learned to use in the last section; this is where you conduct local and network file searches. The remaining seven channels are Internet search tools targeted for specialized information. All of the Web channels work in a similar fashion, as you will see in the following Task.
Task: Using Sherlock to Find Information on the Internet 1. Click on the Sherlock icon in the Dock. The Sherlock window appears. 2. Click on the Internet channel icon. The channel’s sites appear in the Sherlock window (see Figure 8.8). 3. Type the term you want to find on the Internet. 4. In the On column of the channel window, click the checkboxes of the site and engines you want to use in your search. 5. Click on the Find button. Sherlock searches the selected sites for matches to the term you entered, and displays the results in the results window.
Sherlock
Chapter 8
Figure 8.8 You can search multiple sites at once with Sherlock.
6. Click on one of the files. A brief summary of the page appears in the description window. 7. To open a found page, simply double-click it in the results window. The page opens in your default browser. Each channel varies slightly, but this is essentially the same technique that you will use for each Internet search that you perform: enter a term, choose the sites to search, then sit back and watch the results come in!
Configuring Sherlock Sherlock does a very good job of helping you keep your searches as organized and as powerful as possible. It is a very scalable application, which means that it can handle jobs both small and large. When you find that Sherlock needs even more oomph, you can add additional search sites, organizing the channels to your personal preferences. You can even save search criteria that you plan to use again.
213
214
Part I
Basic Mac OS X
Saving Search Criteria As more and more businesses depend on the Internet, there is a growing need to perform repetitive Internet searches. Instead of searching for specific industry information every once in a while, workers might run the same search weekly or even daily, compiling information for themselves and their co-workers. Performing the same search every day would be a bit of a hassle, if not for Sherlock’s ability to save searches that you have conducted. When you are ready to run the same search again, just open it and examine the results of a new search.
Task: Saving a Search 1. In Sherlock, click on the appropriate channel icon. The channel’s sites appear in the Sherlock window. 2. Type the term you want to find on the Internet. 3. In the On column of the channel window, click the checkboxes of the site and engines you want to use in your search. 4. Click on the Find button. Sherlock searches the selected sites for matches to the term you entered, and displays the results in the results window. 5. Click on File, Save Search Criteria. The Save As panel drops down.
TIP You can type Å+S to save search criteria, too.
6. Choose a location to save your data. 7. Click on the Save button to save the criteria. Once the criteria are saved, you can easily call them up again.
Task: Opening a Saved Search 1. In Sherlock, click File, Open Search Criteria. The Open panel drops down.
Sherlock
Chapter 8
2. Click on the appropriate search file to select it. 3. Click on Choose. A new Sherlock window opens and automatically starts the search.
Adding Plug-Ins When Sherlock first hit the scene with Mac OS 8.5, Apple fans talked a lot about Sherlock’s new plug-in capability. In essence, plug-ins are customized search sites that you can import directly into Sherlock. Not every search site had a Sherlock plug-in made for it, so Apple and third-party developers made new plug-ins for Sherlock. For a while, this plug-in movement really took off. In theory, any site that had a search field could have a plug-in made for it. But the practice has slowed sharply in recent years. The OS X version of Sherlock no longer requires Apple to maintain a repository of Sherlock plug-ins on its Web site. Thanks to the Software Update application, any new plug-ins for Sherlock can be downloaded during a scheduled software update. The advantage to this is that you no longer have to search for plug-ins yourself. The disadvantage is that you have to wait for Apple to get a plug-in ready for Sherlock, and hope it’s one you want. The ability to import plug-ins manually, however, has not gone away. Table 8.2 lists a few of the plug-in repository sites that are still on the Web. Table 8.2 Sherlock Plug-In Repositories Site
URL
Adam’s Sherlock Plug-Ins
http://easyweb.easynet.co.uk/~durandal/sherlock/
Sherlock International Plug-ins Archive
http://www.xenophone.com/sherlock/
Sherlock Plug-ins for Power Searchers
http://pwrsearchr.users1.50megs.com/sherlock/pg1.html
Tucow’s Sherlock Plug-Ins
http://mac.tucows.com/sherlockplugins.html
215
216
Part I
Basic Mac OS X
Once you find a plug-in that you want to install, download and save the file to your hard drive. Then follow the steps in the next Task to bring the plug-in into Sherlock.
Task: Installing a Sherlock Plug-In 1. In Sherlock, click on the channel icon in which you want to add the plug-in. The channel’s sites appear in the Sherlock window. 2. Click on Channels, Add Search Site. The Open panel drops down. 3. Navigate to the file you want to add, and click on it to select it. 4. Click on Add to add the file to the channel (see Figure 8.9).
A New Search Site
Figure 8.9 Imported sites are listed as “Custom.”
Sherlock
Chapter 8
Editing Channels If you have located and installed a number of new plug-ins, or you just want to reorganize the search sites you have, you can add new channels to Sherlock and easily move sites between channels. To add a new channel, follow these steps in the next Task.
Task: Creating a New Sherlock Channel 1. In Sherlock, click on Channels, New Channels. The New Channel dialog box appears (see Figure 8.10).
Figure 8.10 Channels are easy to create.
2. Enter a new name for the channel in the Name the Channel field. 3. Click on the Channel Type options list, and select a category for the new channel. 4. Click on the Icon controls to scroll through the selection of icons until you find one you want. 5. Enter a brief summary of the new channel in the Description field. 6. Click on OK. The new channel appears in the Channel Bar. To add new sites to the new channel, you could use the import method detailed in the previous section. Or you could drag the search site icons from other channels and drop them on to the new channel’s icon. This quickly moves the site from one channel to another.
217
218
Part I
Basic Mac OS X
Summary As you have seen throughout Part I of this book, Mac OS X comes loaded with tools that are simple to use, and which you can customize to further meet your needs. Chapter 9, “Fonts and Printing,” is the start of Part II of this book. You will begin examining some of the tools that enhance home and office computer use: multimedia, graphics, and of course, printing.
PART 9 Fonts and Printing 10 Multimedia 11 The Mac Sound Machine
II
Printing, Graphics, and Multimedia
This page intentionally left blank
Chapter 9 Fonts and Printing
222
Part II
Printing, Graphics, and Multimedia
orking with fonts should not be difficult, but it often is. Maybe I was spoiled by that first little Macintosh I worked on in the public library when I should have been out dating girls. Find a new font? No problem! Pop it into the Fonts directory, and all is well. I was giddy with excitement. Throughout high school and college, Macs and Adobe PageMaker dominated my computing existence.
W
The debut of Windows led to a lot of changes in the computing world. But one of the things that bugged me about Windows was the unavailability of my favorite fonts. Where’s Helvetica? What’s this Arial thing? Why does Windows wall off my favorite fonts and make me use these goofy proprietary fonts? You can imagine that I was pretty excited to see that OS X keeps font management very simple. You find a font (presumably on the Internet). You download it and save it on your OS X machine, and every program on your system instantly has access to it. Done. Fonts are probably the second-most anachronistic thing on any computer, since they’re a clear throwback to the days of wood-cut movable-type printing presses that wanted to distinguish their work from others’. And the most anachronistic computer item? The printer. Its sole purpose is to take perfectly good electronic text and transfer it to paper, which has been around for 2,000 years. Not that printers are bad. But the very fact we have them is proof that we, as a society, have not gotten over our 5,000-year love affair with information that we can feel and hold as well as see. Practicality is also an issue. Paper is easy to transport, requires no special care other than keeping it dry, and can be written on using almost any dye. Paper still wins in the arena of pure portability and affordability. As long as that is the case, there will be printers attached to computers, ready to convert virtual text to real text.
A Short History of Fonts Before Johannes Gutenberg’s 15th-century invention of the movable-type press, the text in books and documents was almost exclusively handwritten. There were some fixed-page presses, but information was most often transcribed by hand—
Fonts and Printing
Chapter 8
usually in very ornate writing known as black letter, which was hard to read. Black letter was very fancy, which conflicted with the surge of rational thought that was cropping up in Europe during the Renaissance. Art—including the written word—was being overhauled to fit the new line of thinking: the information on a page was much more important than how the information was presented. The Gutenberg press made this transition possible. Since handwritten text was becoming the exception rather than the rule, the wild variations in lettering style would soon be replaced by more uniform typefaces that would be easier to read, and would therefore convey information more effectively. During this period of experimentation, people noticed that the Roman style of lettering from the past was streamlined and legible. But there was a hitch: Roman writing did not have lowercase letters. So, capital Roman lettering was combined with the lowercase styling of Carolingian letters, which (before black lettering became so popular) were all the rage in Europe during the Middle Ages. These new fonts were heavily serifed, with letters containing asymmetric swoops and swishes that simulated handwritten letters. Artistry was not removed so much as reprioritized in this group of fonts, which historians have labeled Old Style. It was nearly 300 years before typefaces got another major facelift. In the 18th century, lettering became more symmetrical, and each letter was given more contrast by emphasizing the vertical lines of each character. Fonts, such as Times New Roman, were developed during this transitional period between the Old Style period of the past and the Modern period of the 19th century. In most Modern typefaces, many of the artistic little tails and curved edges (serifs) faded, in an effort to maximize contrast and the legibility. Vertical lines and contrast were emphasized so much that a document printed in a sans-serif typeface was sometimes less legible than a document with a serif typeface. The human eye, faced with so many strong vertical marks on a page, pauses for a fraction of a second on each high-contrast character. Printers realized that sans-serif typefaces were most effective in short blocks of text that needed subtle emphasis. But for lengthier documents, the older serif typefaces were more comfortable to read. Ironically, as we progress in the electronic age, the old-fashioned typefaces (which common practice has labeled fonts, even though that’s not quite right) have experienced a huge resurgence. This is especially true for electronic documents that are rarely or never printed.
223
224
Part II
Printing, Graphics, and Multimedia
When an image is displayed on a computer monitor, the eye must look at two planes: the plane of the phosphor screen, where the colors, shapes, and text of the computer display are projected, and the outer part of the screen, such as the glass of a CRT monitor or the thinner plastic coating of an LCD panel monitor. Because these two planes are at different distances from the reader’s eyes, the eyes shift their focus from the plane of the projected text to the plane of the screen’s glass, and back again. This cycle makes the eyes tired much faster than when reading printed text. To make it even easier on readers’ eyes, publishers of electronic documents knew that serif typefaces would need to be used for their documents. Hence, the resurgence of Times New Roman-style fonts and new fonts such as Veranda and Georgia. What were called typefaces in the past are now popularly called fonts, a term we will use for the sake of modern convention. Fonts are constantly evolving to meet the needs of readers. Many of today’s fonts are balanced to appeal to readers of both hard copy and soft copy. OS X ships with a large collection of fonts that are appropriate for many needs, including serif, sans-serif, and just plain fun fonts that can communicate information or a sense of whimsy.
Working with Fonts Many people set a font for an application, and leave it there indefinitely. Fonts are sort of like seat belts: you don’t really appreciate them until you need them. Mac OS X makes font management transparent, meaning that any application that needs fonts can access the same fonts that all other applications can. How you call up a particular font, however, differs from application to application. In Word X, for instance, you can select a font from a large Font menu (shown in Figure 9.1). This is because Carbonized applications, just like Cocoa apps, can use OS X “native” and conventional PostScript fonts stored in OS X Font folders as well as utilize fonts stored in an OS 9 System Folder. When you use a native Cocoa OS X application, you can get to the fonts via the convenient Font panel. (Mail and TextEdit use this.) Unfortunately, only Cocoabased applications use this tool.
Fonts and Printing
Chapter 8
Figure 9.1 One application’s font access can differ from another’s.
Managing Fonts When you choose a font for your document, don’t fall into the “ransom note” trap. You may think that if one cool font is good, more than one font must be great! Well, not exactly. Typically, you should use no more than two fonts in a document. Use one font for body text and another for headings, captions, and so on. Sometimes you can get away with using a third font for special boxouts or headings, but usually two is enough. Remember, the point of most documents is to get information across, whether it’s a scientific paper or the latest advertisement from Madison Avenue. Having too many fonts can be confusing and distracting. The same tenet holds for using colors. Using more than two colors of text is overkill, but using two colors can help emphasize key points. In the next Task, you will learn how to change fonts within a document using the OS X Font panel.
225
226
Part II
Printing, Graphics, and Multimedia
Task: Using the Font Panel 1. Within an application such as TextEdit, click on Format, Font, Font Panel. The Font panel appears (see Figure 9.2).
TIP You can also start the Font panel by typing Å+T in a native OS X application.
Figure 9.2 The OS X Font panel.
2. Click on All Fonts in the Collections field. A list of fonts appears in the Family field. 3. Click on a font in the Family field. A list of available typefaces appears in the Typeface field. 4. Click on a typeface in the Typeface field to select it. 5. Click on a font size in the Size field. The text in the document changes to match the selection. 6. Click on the Extras pop-up menu. The options menu appears. 7. Click on the Color option. The Colors panel appears. 8. Using your preferred color selection method, choose a color for your text. 9. Click on Apply to select the color. 10. Click on the Close Window button to close the Color panel. 11. Click on the Close Window button to close the Font panel.
Fonts and Printing
Chapter 8
TIP If you anticipate making more font changes in your document, drag and drop the Font panel out of the way on your Desktop, and leave it open for faster access. Also, the Font Panel will disappear from view when the application using it is not active.
12. Click on the document window you are editing. When you begin typing, the text appears in the specified format. In the Font panel, fonts are grouped into collections. This makes locating a font a lot quicker than scrolling through the All Fonts list. Mac OS X has six collections in the Font panel: Favorites, Classic, Fun, Modern, PDF, and Web. You can manage all of the collections except Favorites by using the Font panel’s collection manager, but the Favorites collection requires a unique method.
NOTE If you are accustomed to using third-party font managers, such as Suitcase, in earlier versions of Mac OS, you should know the differences between those font managers and Font Panel. Font managers, such as ATM Deluxe and Suitcase, were useful in Mac OS 9 because Mac OS 8 and earlier versions could open only a finite number of fonts. Also, PostScript fonts appeared jaggy without something to aid viewing them on screen. Finally, Mac OS didn’t natively provide a way to organize or switch fonts on and off. Because Mac OS X automatically accesses an infinite number of fonts and anti-aliases every font, all that is needed is the organizer, which is the purpose of the Font Panel. What this means is that using Suitcase or ATM Deluxe under OS X is a bit redundant.
Task: Managing Font Collections 1. In the Font panel, click on the Extras pop-up menu. The menu appears. 2. Click on the Edit Collections menu option. The Font - Collections panel appears (see Figure 9.3). 3. Click on the Create New Collection button to add a new placeholder collection name to the Collections list. 4. Click on Rename. A text cursor appears on the placeholder listing.
227
228
Part II
Printing, Graphics, and Multimedia
Collections
Add Family All Families to Collection Families
Create New Remove Selected Rename Selected Collection Collection Collection
Remove Family from Collection
Figure 9.3 Managing font collections is simple.
5. Type a new name for the collection. 6. Click on a listing in the All Families list to select a font family. 7. Click on the Add Family to Collection button to add the family to the collection’s family list. 8. After adding the desired font families to your new collection, click on Done. The Font panel reappears.
CAUTION Be very careful not to click on the Remove Selected Collection button. There is no confirmation message box or dialog box for this action, so once you click it, it’s gone for good.
Building your own collections is useful when you have the time. If you find some fonts that you really like, you can use the special tools for the Favorites collection to keep track of them.
Task: Managing the Favorites Collection 1. In the Font panel, select a font and size. 2. Click on the Extras options list. The options menu appears. 3. Click on the Add to Favorites menu option to add the font to the Favorites collection.
Fonts and Printing
Chapter 8
4. Click on Favorites to display the contents of the collection (see Figure 9.4).
Figure 9.4 Favorites are listed in their own typefaces.
5. To remove a font from the Favorites collection, select the font in the Favorites list. 6. Click on the Extras options list. The options menu appears. 7. Click on the Remove from Favorites menu option to delete the font from the Favorites collection. The Font panel also lets you change the way you edit the font size options on your system.
Task: Editing Font Sizes 1. In the Font panel, click on the Extras options list. The options menu appears. 2. Click on the Edit Sizes menu option. The Font – Sizes panel appears (see Figure 9.5).
Figure 9.5 You can even edit available sizes for fonts.
229
230
Part II
Printing, Graphics, and Multimedia
3. Click on the Adjustable Slider button. The font size slider appears. 4. Edit the values in the Max Size and Min Size fields to set the range of sizes for your fonts. 5. Click on Done. The Font panel reappears with the slider size control (see Figure 9.6).
Figure 9.6 You can use a slider to adjust your font’s sizes.
Now that you know how to manage fonts, you can turn your attention to learning how to get more fonts and how to look at what you’ve got.
Obtaining and Viewing Fonts You may have noticed the Get Fonts option in the Extras menu in the Font panel. Choosing Get Fonts takes you to a page on the Apple Web site (http://www. apple.com/fonts/buy/) where you can purchase and download new font sets. When this book went to press, however, this service was not yet available. There are other sources of fonts; a quick Internet search will yield several free and commercial sites with Mac fonts. Table 9.1 lists some of these sites. Once you find and download a font file, you usually decompress it and put it in one of two primary font folders. If you want to make the font available to all of the computer’s users, put it in Library\Fonts. Do not put font files in System\Library\Fonts. You cannot save anything to this folder without a lot of trouble, and the fonts in this directory are used by the operating system itself, not the users. If you want to make the font available for a certain user, place the font file in the Usersusername\Library\Fonts folder. Only that user will have access to the font.
Fonts and Printing
Chapter 8
Table 9.1 Popular Mac Font Sites Site
Address
Description
MacFonts.com
http://www.macfonts.com/
A directory to a host of font sites
Fonts.com
http://fonts.com/
A commercial site with hundreds of Mac fonts to buy
FontFreak
http://www.fontfreak.com/
A repository for free and shareware Mac fonts
Old English Pages
http://www.georgetown.edu/cball/ oe/oe-fonts.html
A free collection of esoteric fonts for English, Germanic, and Nordic languages
Adobe Euro Fonts
http://www.adobe.com/type/ eurofont.html
A collection of Euro fonts from Adobe
The Macintosh Font Vault
http://www.erik.co.uk/font/
A repository for free and shareware Mac fonts
It’s nice to examine all of your fonts in detail, to get an idea of how they look. Unfortunately, there is no handy font viewer application. There is, however, a workaround.
Task: Viewing Fonts with Key Caps 1. Start the Key Caps application, which is in the \Applications\Utilities folder. The Key Caps window appears (see Figure 9.7). 2. Type a phrase in the Text field. 3. Click on the Font menu and select a font option. Both the phrase and the keys on the virtual keyboard change to the selected font.
Figure 9.7 This little app lets you view your fonts.
231
232
Part II
Printing, Graphics, and Multimedia
TIP If you want something a little more robust to view your fonts, you can use a great shareware application called FontViewer (http://www.creativebox.net/software/ fontviewer.html). FontViewer lets you view fonts easily and even project them onto various elements of the OS X interface, such as dialog boxes, menus, and buttons.
Printing Basics All this work with fonts is a prelude to getting the characters from the screen to paper. The journey that a document takes from screen to printed page is convoluted, but the process ensures that the information gets there properly. When the user clicks the Print button in an application, the application uses Quartz to pass data to the print spooler. A job ticket describing any special printing instructions (such as multiple copies or grayscale only) is sent along with the main print data. Once the data gets to the print spooler, the spooler converts the data to a PDF file, which locks in the document’s fonts and layout. The job ticket is sent by the spooler to the print job manager, which handles the new PDF file. The print job manager examines the job ticket to determine which printer the job is headed for. It then checks the printer’s driver module to find out what data format the printer needs. If the printer needs the data to be converted, the print job manager calls in a converter program to transform the PDF file into a format the printer can handle. Once the data is in the correct format, the computer sends it to the printer driver (also called the printer module). The module accepts the incoming data and converts it to the commands the printer uses to render the data. If any errors occur in the process, each component in the printing process sends a message back to the print server, which sends a message back to the user.
Using the Print Center When you plug a printer into your Mac, you may notice something rather strange: nothing. Unlike other operating systems, which announce their successes every
Fonts and Printing
Chapter 8
chance they get, OS X won’t notify you of your printer connection unless there’s a problem. The primary tool for users to manage their print jobs is the new Print Center application, which is in the \Applications\Utilities folder. You see the Print Center’s icon on the Dock when you print from any application. The Print Center monitors active print jobs and all printers connected to your Mac, either locally or over a network. Most people have just one printer connected to their machine, but this is the world of the network, after all, and you can simply plug into a networked printer in your home or office. You can even connect to a printer on the Internet. Just be sure you have permission to do so! When you start the Print Center while not printing, you can quickly locate and add a printer to your machine’s collection.
Task: Adding a Printer 1. Start the Print Center application, which is in the \Applications\Utilities folder. The Printer List window appears (see Figure 9.8). 2. Click the Add Printer button. The Add Printer sheet drops down (see Figure 9.9). 3. Click on the options menu, and select a location. You can choose AppleTalk network, LPR Printers Using IP, USB (local) printers, and printers connected through any Apple-compatible Directory Services. When OS X detects a printer that it can use, the printer appears in the list.
Figure 9.8 The Printer List window in the Print Center lists all connected
printers.
233
234
Part II
Printing, Graphics, and Multimedia
Figure 9.9 You can select from various local and network locations to find a
printer.
4. Click on a printer to select it, then click Add. The Add Printer sheet closes and the printer appears in the Printer List window. After you set up more than one printer, you must define one of them as a default printer—the go-to printer for most of your printing needs. Meaning, once you add a new printer, it becomes the new default printer until you add another printer or set your preferred printer as the default. You can set another printer as the default.
Task: Setting the Default Printer 1. Click the printer you want to make the default. 2. Click on the Printers, Make Default menu command. The selected printer becomes the default.
TIP You can also type Å+D to set a selected printer as the default.
If you decide that you no longer need access to a printer, you can quickly remove it using the Print Center.
Fonts and Printing
Chapter 8
Task: Removing a Printer 1. Click the printer you want to remove. 2. Click on Delete to remove the printer from the Printer List. A lot of USB and PostScript printers are difficult to configure or even work at all under OS X. The print process architecture is so new, you may have to wait until a new printer drive specifically for your printer shows up before you can use your printer.
Printing a Document You can always start printing from any printable application by clicking on the File, Print menu command (or, if you prefer keyboard shortcuts, typing Å+P). This is not to say, however, that the printing processes are identical for all applications. The more robust the application, the more printing choices you must make. Figures 9.10 and 9.11 illustrate the differences between applications. Figure 9.10 shows the Print sheet from the Help Center application, and Figure 9.11 shows the Print dialog box from the Word X application. Word has several more options to choose from, even on the Copies & Pages page of the Print panel. Word’s Print tool has more Print panel pages than Help Viewer’s since Word is dedicated to document production. You will find these disparities throughout OS X’s applications. But across the board, the Print panel is well-organized and it’s pretty easy to find settings you need to change. Printer Options List Presets Options List Page Options List
Figure 9.10 The Help Center has a simplistic Print sheet…
235
236
Part II
Printing, Graphics, and Multimedia
Figure 9.11 …and Word X has a more complex set of options.
Changing Print Settings The most commonly changed print settings are the number of copies that are printed. Another frequently changed setting is the paper type, because many people use color printers for printing digital photographs.
Task: Making Basic Print Setting Changes 1. In the application you wish to print from, click on File, Print. The Print sheet or dialog box appears. 2. Click on the Page options list, and select Copies & Pages. That page appears. 3. In the Copies field, enter the number of prints you want. 4. Click on the Page options list, and select Print Settings. That page appears (see Figure 9.12). 5. Click on the Media Type options list, and select a paper option. 6. Click and drag the Quality/Speed slider until it is next to the Quality end. 7. Click on Print. The document prints according to your specifications, and the Print sheet closes.
Fonts and Printing
Chapter 8
Figure 9.12 You can change basic printer settings here.
Printing to a File As you learned in the “Printing Basics” section earlier in the chapter, one of the first things that happens in the printing process is the conversion of the document’s graphic settings to a PDF file. You can halt the process at that point to create a PDF version of your document. Using PDF documents to transport information gets around a lot of file compatibility issues. The ubiquitous Acrobat Reader makes PDF document sharing a simple proposition. And, if you have a PostScript printer, you can use the printer module to convert your documents to PostScript format, which is universally recognized.
Task: Printing to a PDF File 1. In the application you wish to print from, click on File, Print. The Print sheet or dialog box appears. 2. Click on the Page options list, and select Output Options. That page appears. 3. Click on the Save As File check box to select that option (see Figure 9.13). 4. Confirm that the Format options list is set to PDF.
237
238
Part II
Printing, Graphics, and Multimedia
Figure 9.13 You don’t always have to print to a printer.
TIP If you have a PostScript printer, you can set the Format option to Post Script.
5. Click on Save. The Save to File dialog box appears. 6. Enter a file name in the Save As field. 7. Choose a location to save the document in the Where field. 8. Click on Save. The Print panel closes.
TIP Another way to create a PDF file is by setting OS X to use Acrobat Reader as the Print Preview application. (Normally this is done with the Preview application.) When a preview is opened in Acrobat, the print job becomes a PDF that can be saved and viewed as needed.
Previewing a Print Job Once you have made all the settings changes for a print job, you might want to see what the printed job will look like before you use up paper. Again, because part of the print process is to create a PDF file, OS X can show you that PDF file onscreen before you send it to the printer. Click the Preview button on any page of the Print panel. This starts the printing process, but it stops after creating the PDF file. Then the Preview application displays the PDF file, as shown in Figure 9.14.
Fonts and Printing
Chapter 8
Figure 9.14 OS X’s PDF layer makes print previewing easy.
The neat thing here is that you can save this preview as a PDF file on your hard drive for later use!
Setting Printer Preferences If you make the same settings changes over and over again, take advantage of the option to save your settings in the Print panel. You can save just one set of custom settings, but that can make the difference between one mouse click or a whole bunch of them. To save a preset, click on the Page options list, then select the Save Custom Setting option. This creates a new settings collection called Custom, which appears in the Presets field. When you need to access these custom settings, simply click on the Presets options list and select Custom. To reset the options, click on the Standard option in the same list.
Mobile Printing If you are using a portable OS X platform, you may not be connected to a printer, either locally or through a network. You can place the print jobs in the printer’s print queue for later printing, as shown in the following Task.
239
240
Part II
Printing, Graphics, and Multimedia
Task: Holding Print Jobs for Later Printing 1. Start the Print Center application. The Print Center window appears. 2. Click on the printer you will want to print to later. 3. Click on Queue, Stop Queue to set the printer’s status to Stopped. 4. Print to that printer as you normally would. Your computer saves each job indefinitely in the print queue. 5. When you connect your machine to the printer, open the Print Center again. 6. Click on the stopped printer to select it. 7. Click on Queue, Start Queue to activate the printer. The stored jobs start printing.
Summary In this chapter, you learned about the intricacies of fonts and printing, two areas of computing that represent our technological past. In Chapter 10, “Multimedia,” you will learn more about the future of information technology. You will see how much better, faster, and easier it is to deal with light, sound, and action in OS X than in other operating systems.
Chapter 10 Multimedia
242
Part II
Printing, Graphics, and Multimedia
ntil the last couple of years, polls of new and potential computer owners revealed that the primary interest in getting a computer was (if they had children) as an educational and entertainment tool for the kids, and (if they did not have children) as an educational and entertainment tool for the kids. No grownups want to admit that all they want to do is play Myst with a $1,000 machine.
U
As the Internet becomes a common presence in homes and office, the motivation for buying computers shifted towards going online for entertainment. Curiously, recent polls show that as the novelty of the Internet wears down, people are using it (and their computers) less for entertainment and more for work, even at home. The computer is becoming less of a source of entertainment, it seems, and more of a tool to work with. This is not to say that computer users are moving to an all-work environment; they’re still having some fun along the way.
What is QuickTime? QuickTime’s capabilities go far beyond simple playback of multimedia files. It is an entire multimedia architecture that plays media files on its own, and allows other applications to play multimedia files. QuickTime is an API, a set of tools that application programmers can use to give extra capabilities to their software. Most of us associate QuickTime only with the ubiquitous QuickTime Player. But the Player is only a shell that can access the QuickTime API, which is what calls up and plays the requested media files. This is why Apple’s developers have included QuickTime in OS X’s display layer. Just as Quartz displays two-dimensional images and OpenQL displays three-dimensional ones, the QuickTime API displays multimedia files. Before I delve into this much farther, you must understand multimedia. Most people associate the term with video clips, since moving images and sound qualify as multimedia. Video clips and movies are multimedia, but they are not the entirety of multimedia. All computers want to do is process little 1s and 0s. So, in a sense, any image or audio file is multimedia, because it is a type of media that is over and above the singular form of media that a computer would normally display, which would be text. It would be more accurate to call these media files, but multimedia was the term used to describe those postage-stamp sized video clips, and the term has
Multimedia
Chapter 10
stuck. In fact, multimedia now includes any kind of audio or visual display from a computer. Any application that needs to use QuickTime’s APIs can. In the past, Adobe Acrobat, Eudora, and FileMaker Pro were just a few of the 18,000+ applications that tapped into QuickTime to view images or play back sounds. QuickTime’s core technology is so popular because it works across platforms. Starting with version 3.0, the QuickTime architecture was designed to work with Microsoft Windows as well as the Mac OS. Thus, a whole new QuickTime user base opened. The other reason for QuickTime’s huge popularity is that it can play so many different media types. It plays audio, video, animation, graphic, text, 3D, and virtual reality files. This is especially amazing when you consider that QuickTime does not limit media files in these six categories to QuickTime proprietary files. The field is wide open. You can use QuickTime to create and display dozens of file formats. Table 10.1 lists the formats that you can manage, view, or save with QuickTime. Table 10.1 QuickTime File Formats Format
View?
Save As?
3DMF
X
AIFF
X
X
AU
X
X
Audio CD Data (Macintosh)
X
AVI
X
X
BMP
X
X
Cubic VR
X
DLS
X
DV
X
DV Stream
X
FlashPix
X
FLC
X
X
243
244
Part II
Printing, Graphics, and Multimedia
Table 10.1 QuickTime File Formats (continued) Format
View?
Save As?
GIF
X
Image Sequence movie exporters
X
X
JPEG/JFIF
X
X
Karaoke
X
MacPaint
X
X
Macromedia Flash 4
X
X
MIDI
X
MPEG-1(Playback/Streaming)
X
MP3(MPEG-1, Layer 3)
X
M3U(MP3 Playlist files)
X
Photoshop
X
PICS
X
PICT
X
PLS
X
PNG
X
X
QuickTime Image File
X
X
QuickTime Movie
X
X
SF2 (SoundFont 2)
X
SGI
X
X
System 7 Sound
X
X
Targa
X
X
Text
X
X
TIFF
X
X
TIFF Fax
X
Virtual Reality (VR)
X
WAV
X
X
X
X
Multimedia
Chapter 10
QuickTime can access some additional formats that use separate pieces of software called codecs. Codecs are third-party plug-ins to the QuickTime API. They are not officially a part of the API, but the API can use them to play certain file types. Software developers provide codecs with their file formats so that multimedia players like QuickTime Player can use their formats. Table 10.2 lists these codecs. Any Carbon- or Cocoa-based application can tap right into the QuickTime layer to display images, audio clips, or video clips. This extends to Classic applications as well, since the QuickTime API predates OS X. But never before has the delineation between this API and the other layers of the system architecture been this pronounced. This delineation lends OS X a lot of flexibility in showing off multimedia files. Table 10.2 QuickTime Codecs for Audio and Video Audio
Video
24-bit integer
Animation
32-bit floating point
Apple BMP
32-bit integer
Apple Video
64-bit floating point
Cinepak
ALaw 2:1
Component video
AU
DV NTSC and PAL
IMA 4:1
Graphics
MACE 3:1
H.261
MACE 6:1
H.263
MS ADPCM
Microsoft OLE
QDesign Music 2
Microsoft Video 1
Qualcomm PureVoice
Motion JPEG A and B Photo JPEG Planar RGB Sorenson Video 1, 2, and 3
245
246
Part II
Printing, Graphics, and Multimedia
Using QuickTime This API information is all well and good, but surely you want to get down to viewing multimedia files. For this, you use three primary tools: the QuickTime Player, the QuickTime plug-in for Internet Explorer or Netscape Navigator, and the Preview application. Each of these applications is a doorway to the power behind QuickTime: the API. The QuickTime Player is the primary tool for the playing of QuickTime-compatible files, particularly audio and video files. The QuickTime player’s default behavior is to start automatically whenever you download such a file from the Internet. The QuickTime plug-in performs in a similar way, except it always works within the browser. It quietly turns itself on in the background whenever you open a Web page that has a QuickTime file embedded in it. It works with the browser to display the contents of that file on that same page. To the user, it looks as if the browser is doing all the work, but the browser has just cleared a hole for QuickTime to show the multimedia clip. The third commonly used QuickTime application in OS X is Preview. It is the image display application that directly accesses the QuickTime API (and Quartz) to display image files, including PDF files. You will learn about this in more detail in the “Using Preview” section later in the chapter. For now, take a look at how QuickTime can view a movie that you have saved on your hard drive.
Task: Playing a Saved Movie 1. Start the QuickTime Player by clicking its icon in the Dock. The QuickTime window opens and shows the current Hot Pick movie splash screen (see Figure 10.1) if the user is connected to the Internet.
NOTE A Hot Pick is a QuickTime presentation that piques the user’s interest. Essentially, Hot Picks are billboards for new or upcoming news or entertainment events. You can turn this feature off if you don’t want it to appear upon start up. You’ll learn to do this in the “Configuring the QuickTime Player” Task later in this chapter.
Multimedia
Chapter 10
View Window
Timer
Scrubber Bar TV Control Resizing Handle Volume Return to Rewind Play Fast Advance Beginning Forward to End Figure 10.1 The opening QuickTime Player screen.
2. Click on File, Open Movie in New Player. The Open dialog box appears.
TIP You can also get to the Open dialog box by typing Å+O.
3. Navigate to the file you want to open, and click on it to select it. 4. Click on Open. The movie appears in the View window (see Figure 10.2). 5. Click on the Play button. The movie begins to play and the Play button changes to a Pause button. 6. To adjust the volume for the movie, click and drag the Volume slider.
TIP To mute the sound on any playing media file, click the small speaker icon. Click it again to restore the sound.
247
248
Part II
Printing, Graphics, and Multimedia
Figure 10.2 A movie ready to be played.
7. To advance the movie, click and hold the Forward button. The movie advances onscreen until you release the mouse button.
TIP To advance the movie by only one second, click the Forward button, but do not hold it.
8. To place the movie at a certain point, click and drag the timer control on the scrubber bar until you reach the desired point in the movie (see Figure 10.3).
Playhead
Figure 10.3 You can drag the playhead to access the scenes you want to see.
Multimedia
Chapter 10
9. To view the movie at a preset size, click the Movie menu and select one of the size options. 10. Click on the Close Window button to close the Movie window. The method for using the Player for non-visual files is pretty much the same. For instance, if you wanted to use the QuickTime Player to listen to an audio file (instead of using iTunes, which you’ll examine in Chapter 11, “The Mac Sound Machine”), you would open the file in exactly the same way you opened the movie file in the preceding Task. The only difference is in the Player window’s appearance. As you can see in Figure 10.4, the Player’s View window is not present, but the rest of the controls are.
Figure 10.4 When playing an audio file, the Player window is much more
compact.
If you chance upon a QuickTime movie embedded in a Web page, any browser that supports the QuickTime plug-in can use the plug-in to display the media file in the browser window. Typically, the control set for the plug-in is much simpler than for the Player, as you will see in the next Task.
Task: Playing a Web Movie 1. Navigate to a Web page with an embedded QuickTime-compatible file.
TIP The fastest way to get to such a page is to click on the Hot Picks window that appears when the QuickTime Player starts.
2. If you see an option for setting your connection speed, click on the appropriate speed option (see Figure 10.5). The movie starts downloading. 3. Once a certain percentage of the movie has downloaded, the movie begins playing (see Figure 10.6).
249
250
Part II
Printing, Graphics, and Multimedia
Figure 10.5 Choose your connection speed; 56k is for dial-up modems.
Volume Play/Pause Control Button Figure 10.6 Viewing a rock concert online.
Multimedia
Chapter 10
TIP The amount of time it takes for the movie to start depends on your bandwidth. The slower the connection speed, the more of the movie will be downloaded before QuickTime begins playing it. Also, dial-up users should be aware that even downloading low-bandwidth specific trailers can take over 15 minutes.
4. To pause the movie, click on the Pause button. 5. To start the movie again, click on the Play button. 6. To adjust the volume, click and hold the Volume control. The Volume slider bar appears. 7. Click and drag the Volume slider bar until the volume is at the desired level. 8. Navigate to another page, or close your browser when you are finished viewing the movie. Sometimes a downloaded feature takes fuller advantage of the QuickTime API, and makes more tools visible. In Figure 10.7, you can see a more robust control area, including an Advance to End and Return to Beginning control.
Volume Play/Pause Scrubber Download Control Button Bar Progress Figure 10.7 The Force? No, just QuickTime.
Return to Advance Beginning to End
Menu Control
251
252
Part II
Printing, Graphics, and Multimedia
TIP If you upgrade to QuickTime Pro, you can use the Menu control shown in Figure 10.7 to save Web-based media files such as the one in this example onto your hard drive. For more information, see http://www.apple.com/quicktime/download/qtpro_faq.html.
The QuickTime Player and plug-in are pretty easy to master. The trickiest part of the whole operation might be finding content to view and listen to. Fortunately, Apple has users covered.
QuickTime TV The Internet will never be completely indexed. It simply grows too fast for any search engine or index to keep up. Thus, finding decent content can be a bit of a challenge. The Sherlock search tool, reviewed in Chapter 8, aids you in locating information and content. But when it comes to finding multimedia content for your QuickTime Player, Apple provides a built-in way to get some very good content as fast as you can download it. QuickTime TV, or QTV for short, helps users rapidly navigate to content from various media outlets. In keeping with the TV motif, these prepackaged bits of news and entertainment are organized into channels. You can access these channels directly from the QuickTime Player, and even add channels as you find them. Some of this content is ordinary files that you download and play, and some is streaming media, where video is compressed and fed to the QuickTime Player on the fly. Once the information is displayed on the screen, it is immediately deleted to make room for the rest of the content coming from the Internet. Streaming media allows users to view huge media files with little to no download time or disk space.
Task: Accessing a QTV Channel 1. Start the QuickTime Player by clicking its icon in the Dock. The QuickTime window opens and immediately shows the current Hot Pick movie splash screen.
Multimedia
Chapter 10
2. Click on the TV button. The QTV screen appears (see Figure 10.8).
Figure 10.8 Twenty channels of news and entertainment.
3. Click on a channel. A new Player window appears with a splash screen for the channel (see Figure 10.9).
Figure 10.9 Supporting public television.
253
254
Part II
Printing, Graphics, and Multimedia
4. Click on something that appeals to you in the channel’s splash screen. A new Player screen appears, and the downloading and viewing process begins.
NOTE Depending on the channel you’re accessing and the speed of the connection, it may take a few moments for either streaming or downloading content to appear in the Player window. Be patient.
Channels are automatically added (and removed, if need be) from the QTV lineup during a Software Update session. If you want to access certain channels even faster, you can add them to your Favorites. This is especially useful when the number of channels grows, and you’re dealing with a lot of content on the main QTV screen.
Task: Making a Favorite QTV Channel 1. Start the QuickTime Player by clicking its icon in the Dock. The QuickTime window opens. 2. Click on the TV button. The QTV screen appears. 3. Click and drag a channel on to the Favorites tab, denoted by the heart symbol. 4. Click on the Favorites tab. The channel appears in the Favorites collection.
TIP You can also access the Favorites channels by using the QTV, Favorites menu command.
5. To remove a Favorites channel, click and drag the channel to the Trash in the Dock.
Multimedia
Chapter 10
QuickTime VR About three years and one month after Apple released QuickTime 1.0 in December, 1991, Apple introduced a new addition to the QuickTime tools: QuickTime VR. The year was 1995, a pivotal time in the history of the desktop computer thanks to the release of a new operating system out of Redmond, Washington. Apple was trying to assert itself as the superior player in the graphics and multimedia arenas, and QuickTime VR was one way of highlighting that superiority. VR is shorthand for virtual reality, where computers display three-dimensional interactive environments that update themselves to meet any point of view. Many software developers have created stunning VR environments that never existed on this planet, and others have introduced human avatars as players in large-scale VR games. QuickTime VR (QTVR) plays in a field that usually focuses on reality (though not always). QTVR allows two-dimensional photographs of a particular scene to be “stitched” together to create a wrap-around environment on the screen. As the user adjusts his point of view, the scene shifts to match that new point of view, as if the user were actually standing and moving within that environment. In the early days of QTVR, only side-to-side movements were possible, as if all the pictures wrapped around you like a giant cylinder. Today, all points of view are possible: up, down, left, right, and even (using a clever zooming perspective) forward and backward. As QTVR technology improves, graphics developers create environments both mundane and magical. Imagine being able to take a virtual look at the inside and outside of a car you’re thinking about purchasing. For the more fanciful among us, QTVR has been used to create 360-degree view of the bridges of the starships Enterprise and other ships from Star Trek. Right now, the use of QTVR mostly falls into the nebulous area between education and entertainment. As the use of QTVR authoring tools becomes more prevalent and the tools become faster, QTVR can be used as a medical aid, a military instructional tool, and many other practical applications. Finding QTVR presentations on the Web is not difficult; a quick search with Sherlock will point your to many QTVR pages on the Internet. But the best place to look is the Apple QuickTime VR Authoring page at http://www.apple.com/ quicktime/qtvr/. Our next Task starts from here.
255
256
Part II
Printing, Graphics, and Multimedia
Task: Manipulating a QTVR Environment 1. In the VR Showcase sidebar of the QuickTime VR Authoring page, click on the Cubic VR Gallery link. The Cubic VR Gallery page appears. 2. Click on one of the displayed environments. The QTVR presentation of that environment (in this case, Times Square in New York City) begins in the browser (see Figure 10.10).
Back button
Zoom Zoom Show Hot Drag Zoomed out in Spots Object
Point of View cursor
Figure 10.10 The city that never sleeps.
3. To move about in the environment, click and drag the Point of View cursor in the direction you want your perspective to move: up, down, left, or right. 4. To look at an object in this environment, click and hold the Zoom In (+) button. The perspective moves in closer to the center of the screen.
TIP While the Point of View cursor is active, you can press Shift to zoom in.
Multimedia
Chapter 10
5. To pull back from an object, click and hold the Zoom Out (-) button. The perspective moves out from the center of the screen..
TIP While the Point of View cursor is active, you can press Control to zoom out.
If the QTVR presentation has interactive areas within the environment, you can click on these Hot Spots and access the information they will provide. A Hot Spot is easily identified by the change of the Point of View cursor to a hyperlink cursor while the cursor is being moved through the environment. You can also make them more visible by clicking the Hot Spot button in the control bar of the QTVR presentation.
Configuring QuickTime Right out of the proverbial box, QuickTime is configured pretty well, both as a Player and an API. This is an important distinction to make; because the Player is only one small aspect of everything QuickTime-related, you access the settings for each of the QuickTime aspects separately. It is very simple to make changes to how QuickTime behaves in OS X. You can alter QuickTime settings from two locations in OS X: within the Player application, and within the System Preferences. The simpler of the two settings deals with the Player itself. The settings for the Player only address how the application behaves when it’s running. You cannot change the basic behavior of QuickTime from here.
Task: Configuring the QuickTime Player 1. In the QuickTime Player application, click on the QuickTime Player, Preferences, Player Preferences menu command. The General Preferences dialog box appears (see Figure 10.11). 2. To prevent the Hot Picks window from appearing upon startup of QuickTime Player, click on the Show Hot Picks Movie Automatically check box to clear it.
257
258
Part II
Printing, Graphics, and Multimedia
Figure 10.11 The simple preferences for the QuickTime Player.
3. To start movies as soon as you open them, click the Automatically Play Movies When Opened check box to select it. 4. Continue to configure the Player as you desire. When finished, click on OK to close the General Preferences dialog box and apply the settings. When you want to make deeper changes to QuickTime, you must access the QuickTime panel of the System Preferences application.
Task: Configuring the QuickTime Player 1. In the QuickTime Player application, click on the QuickTime Player, Preferences, QuickTime Preferences menu command. The QuickTime panel of the System Preferences appears (see Figure 10.12). 2. To confirm your connection speed, click on the Connection tab. 3. Click on the Connection Speed options list, and select the appropriate speed. 4. Click on the Update tab to reveal that page of the panel (see Figure 10.13). 5. Click on the Install New 3rd-Party QuickTime Software option button.
Multimedia
Chapter 10
Figure 10.12 The more robust QuickTime preferences.
Figure 10.13 Updating QuickTime.
6. Click on the Update Now button. The QuickTime Component Install application starts (see Figure 10.14). 7. Click on Custom. The custom window appears (see Figure 10.15).
259
260
Part II
Printing, Graphics, and Multimedia
Figure 10.14 You can update QuickTime or add new components from here.
Figure 10.15 Choose the components you want to add.
8. Click on the check boxes for the components you want to install. 9. Click on Update Now. A download progress window appears. 10. If any End User License Agreements appear, click on Accept.
CAUTION Installing third-party updates does not require administrator’s rights, so users should be careful not to unknowingly damage QuickTime by installing updates willy-nilly. Check with your administrator.
Multimedia
Chapter 10
11. When the installation is complete, click on OK in the notification dialog box. 12. Quit System Preferences. 13. If QuickTime Player is running, close the application and restart it to have the changes take effect.
Using Preview Earlier in this chapter, you learned how QuickTime Player could open any media file, not just an MOV file. You also learned that you can use QuickTime to open everyday image files, such as GIFs and JPEGs. But this would be sort of like using a sledgehammer to drive a thumbtack into a bulletin board; it would work, but it would be overkill. Instead of using QuickTime player, Apple’s developers have applied the QuickTime API in a new, lighter way. The Preview application taps into the API to display compatible image files. Preview is the OS X replacement for the Picture Viewer application. If you still want to use Picture Viewer, it is available as a Classic application on your OS X system. But for practicality’s sake, you will probably use the Preview application from now on. It is the default viewer for many image file formats, so it appears automatically. It is also the default viewer for print previews in many applications, such as Word X. You hardly ever have to start Preview manually.
TIP Preview is simply a viewer application for image files and PDF files. Adobe Acrobat is a much more robust viewer of PDF files. In fact, since Acrobat 5 is installed by default in OS X, you are going to want to use that instead, since it gives you much more control over your PDF viewing.
To start Preview, double-click a compatible image file. The application launches and displays the image for you (see Figure 10.16).
261
262
Part II
Printing, Graphics, and Multimedia
Figure 10.16 Displaying an image with Preview.
Preview only allows you to magnify, shrink, rotate, or flip the picture. All of these commands are in Preview’s Display menu. If you want to save a flipped or rotated image, you can do that in Preview as well. You don’t need to spend a lot of time learning about the Preview aspect of QuickTime, because it is so simple to work with. Instead, you’ll learn about one of the biggest selling points for an OS X platform: the ability to import and edit digital movies on your Mac, (almost) like a Hollywood technician would.
Creating Digital Movies with iMovie 2 Most of us have seen a video camera in action: images are captured through a lens and (after some fancy compression routines) transferred to a magnetic tape. That tape can then be taken out and put into a VCR for the whole family to enjoy. Unless it’s a video of Uncle Bob lighting his famous flambé again. Then all bets are off. This is a very simplistic way of describing an analog camera, where the colored light waves coming into the cameras are divided among three colors (red, green, and blue), and then recorded in analog form on the video tape.
Multimedia
Chapter 10
In a digital camera, almost the same thing happens, except the camera pixelates the visual information. Each pixel is assigned a certain combination of the three colors and then stored on a medium such as a portable memory card or a digital tape. The difference in information from the two methods is quite startling. Both video cameras and digital cameras use the three-color method (with devices called charge-coupled device, or CCDs) for imaging. An analog camera equivalent CCD has from 300,000-450,000 elements. A 3.1 megapixel digital camera has about 3.1 million elements or pixels—about nine times the resolution of an analog camera. This huge number of pixels takes up a lot of memory. But now that memory is getting fairly cheap, the cost of making a digital movie is not as high as it once was. Knowing this, Apple developed iMovie, a basic video capture and editing package that connects to any digital video (DV) camera, imports the video from that camera, and then creates QuickTime movies or edited video data that the user can transfer back to the digital camera for playback elsewhere. What makes this all work is the FireWire networking protocol.
Working with FireWire and Digital Cameras Apple developed FireWire as a high-speed method for connecting devices to a personal computer. The technology was so well-received that by late 1995, FireWire was accepted as an official industry standard. Today it is also called Institute of Electrical and Electronics Engineers (IEEE) 1394 High Performance Serial Bus. If you hear the terms “IEEE 1394” or just “1394” you’ll know it means FireWire. FireWire has four advantages over connective methods such as Universal Serial Bus (USB). First, it’s darn fast: about 400 Mbits/second. This means that large amounts of information (such as video) can be shuffled around quickly. Second, the cabling is very simple to use—no pins or tiny little pin sockets, just a smooth rectangular port. Third, FireWire is hot swappable, which means that when you want to use a FireWire device you just plug it in—no need to reboot the machine to have it recognize the new peripheral. FireWire brings to the table one more huge advantage. All devices that can use FireWire use the same protocols to communicate. That means that OS X does not need drivers for each camera model that comes along. If the camera can use FireWire, the iMovie application can access and control the camera.
263
264
Part II
Printing, Graphics, and Multimedia
Importing a Movie The first stage in creating a movie in iMovie is getting the information from the camera to the computer. Before you begin, however, make sure a few things are in order. First, make sure you have a FireWire/1394-compatible camera. If you do not, don’t panic. You can get an analog video/FireWire converter jack that will allow you to plug an AV camera into your computer, such as the Dazzle Hollywood converter or the Formac Studio converters. You may have to use the camera’s controls instead of iMovie’s to control the camera, but that depends on the camera. Second, make sure you have a lot of room on your hard drive to store (even temporarily) the data coming from your camera—especially if you are using a highresolution digital camera. Stored at high resolution, a 15-minute digital video can take up to 1–2 GB of memory! Third, give yourself some time. Movies import in real time: a 60-minute clip takes 60 minutes to import. For that reason, I like to import the movie in the evening and then work on the clip the next morning. Fourth, if your camera has a power jack, use it while you’re working with the camera. Importing and exporting video data takes time, and you don’t want your battery running down in the middle of the process. Once you’re all set, plug your camera into the FireWire port on your Mac, and start the iMovie application.
Task: Importing a Movie 1. Start the iMovie application by clicking its icon in the Dock. The application window fills the screen (see Figure 10.17). 2. Click on the File, New Project menu command. The Create New Project dialog box open. 3. Type a name for your project in the Save As field. 4. Click on Create to save the project under the new name. 5. Turn your camera on. The Camera control switch immediately changes to DV, and the Camera Connected screen appears in the video area (see Figure 10.18).
Multimedia
Clip Shelf
Monitor
Camera/Video Scrubber Player Control Bar Controls
Chapter 10
Volume Control
Effects pane
Shelf Control Bar
Figure 10.17 The iMovie interface.
6. Using the onscreen buttons, move your camera’s tape to the beginning of the clip you want to import. 7. Click on the Pause button to stop the clip at that point.
TIP Don’t worry about being exact here; you can crop off the beginning using iMovie’s editing tools.
8. When the clip is correctly positioned in the viewing area, click the Pause button and then the Import button. Playback begins again, and video clips fill the Shelf area (see Figure 10.19).
265
266
Part II
Printing, Graphics, and Multimedia
Import Control
Camera Controls
Figure 10.18 Ready to import a movie.
Scene Clips
Figure 10.19 Importing a movie.
Multimedia
Chapter 10
TIP As you import a video, the amount of free space decreases on the iMovie interface. Keep an eye on this; you don’t want to run out of disk space. Video-editing quality may also be affected by disk fragmentation, especially if you have a small amount of space to play with (under 4 GB). If this is the case, consider investing in a disk repair/optimization utility, such as Norton Utilities.
9. When you have imported enough of the video, click on the Import button once more. The import action stops. 10. Click on the Stop button to halt playback. If you are finished importing data, turn off your camera but don’t unplug it. You may need to import video again if you make a mistake during the editing process.
Editing Your Work Once you have pulled in the video from your camera, you can begin putting the movie together. You may have noticed that there were a lot of clips dropped on the Shelf as you were importing the video. iMovie creates a new clip every time it senses a break on the videotape. Usually that’s when there’s a scene change, but for digital cameras, it could be a break in the timecode embedded on the digital tape. To prevent spurious breaks, put the cap on your video camera’s lens, and then record the entire tape’s worth of nothing but black. This sets up one continuous timecode on that tape, insuring better clip/scene synchronization. iMovie divides your work into clips to allow you to put them in any order you wish, remove clips that did not turn out very well, and add transitions between scenes. iMovie uses a building block methodology to put together movies. You can simply drag and drop the clip “blocks” into the Effects Pane to build a series of events in the order you want. From there, you can add effects such as transitions and titles. You can also split a clip at any point, as well as crop out things you don’t need. You can even add and remove sound from your clip. And you don’t need to go to film school to do so.
267
268
Part II
Printing, Graphics, and Multimedia
The first thing to do when you are organizing a new movie is to get your clips set up in the approximate order you want to show them. Don’t worry about getting things perfectly set at first; you’ll have time to change your mind.
Task: Organizing Video Clips 1. In the iMovie application, click on a video clip block in the Shelf area, and drag it down to the Effects Pane area. 2. Click on another clip, and drag it to the Effects Pane. A transparent placeholder denotes where you are placing your clip in relation to the others (see Figure 10.20).
Figure 10.20 You can place video clips in any order.
3. Repeat step 2 until you have all of the video clips you need in place in the Effects Pane. 4. To review a clip’s contents, click on the clip in either the Shelf or the Effects Pane. The selected clip turns yellow. 5. Click on the Play button to review the clip’s contents.
Multimedia
Chapter 10
6. If you decide to discard a clip, click and drag it to the Trash icon within the iMovie interface, just below the Effects Pane. 7. To play all the clips in the Effects Pane at once, click on the caption immediately above the Effects Pane to select all of the clips. 8. Press Play to watch the clips in the order in which you placed them (see Figure 10.21)
Playhead
Clip Markers
Figure 10.21 The scrubber bar gives you lots of positional information.
9. To advance to any part of the movie, click and drag the playhead to the scene you want to review. 10. To rename a clip, click on the caption for the clip to select it, and then type the new name. After you get the clips in rough order, you can begin fine tuning by cutting and pasting clips or sections of clips, cropping and trimming unwanted sections of clips, and splitting clips in certain places to make room for new video.
269
270
Part II
Printing, Graphics, and Multimedia
Task: Cutting and Pasting Video Clips 1. In the iMovie application’s Effects Pane, click on the video clip that you want to cut or copy. The selected clip turns yellow. 2. Drag the cursor just underneath the scrubber bar to make the crop marks appear (see Figure 10.22). 3. Drag the begin and end crop marks to select a section of video. Click on each crop mark to see the point where it resides in the video. 4. Click on the Edit, Cut menu command to cut the video section.
TIP As with most documents in OS X, you can use Å+X to cut, Å+C to copy, and Å+V to paste.
5. Click on the clip into which you want to place the cut section. The selected clip turns yellow.
Crop Marks
Selected Video
Figure 10.22 Crop marks are the selectors for a video.
Multimedia
Chapter 10
6. Click and drag the playhead until you reach the insertion point in the video clip. 7. Click on Edit, Paste. The current video clip is split, and the cut section is placed between the sections of the split clip. Cutting and pasting clips automatically splits the destination clip at the insertion point. If you want to insert an entire clip block within a segment of video, you would be better off manually splitting the destination clip, and then dropping the new clip block in place.
Task: Splitting Video Clips 1. In the iMovie application’s Effects Pane, click on the video clip Effects Pane that you want split. The selected clip turns yellow. 2. Click and drag the playhead until you reach the insertion point in the video clip. 3. Click on the Edit, Split Video Clip at Playhead menu command. The section of video splits at that point (see Figure 10.23).
Original Clip New Split Clip
Figure 10.23 Splitting makes it easy to insert whole video clips.
271
272
Part II
Printing, Graphics, and Multimedia
TIP You can type Å+T to initiate the split command in iMovie.
4. Click and drag the video clip you want to insert between the split clips in the Effects Pane. Other editing techniques include cropping and trimming. Both of these methods remove sections of video from your clips, but you must understand the difference between the two. When you use the crop marks to select a video scene and then crop the video, everything inside the crop marks remains and everything outside the markers is deleted. If you select some video and then trim it, everything inside the crop marks is removed and everything else remains. In short, trimming is the opposite of cropping. If this is too confusing, pick one method of removing unwanted video, and stick with it.
Task: Cropping Video Clips 1. In the iMovie application’s Effects Pane, click on the video clip Effects Pane that you want to crop. The selected clip turns yellow. 2. Drag the cursor just underneath the scrubber bar to make the crop marks appear. 3. Drag the begin and end crop marks to select the video section you want to keep. Click on each marker to see the point where it resides in the video. 4. Click on the Edit, Crop menu command. Everything outside the selected area is removed and placed in the iMovie Trash.
TIP You can type Å+K to initiate the crop command in iMovie.
Multimedia
Chapter 10
Trimming is just about the same set of steps, though you have to remember that in iMovie there is no “Trim” command per se—the actual command is Clear.
Task: Trimming Video Clips 1. In the iMovie application’s Effects Pane, click on the video clip Effects Pane that you want to trim. The selected clip turns yellow. 2. Drag the cursor just underneath the scrubber bar to make the crop marks appear. 3. Drag the begin and end crop marks to select the section of video you want to remove. Click on each marker to see the point where it resides in the video. 4. Click on the Edit, Clear menu command. Everything inside the selected area is removed and placed in the iMovie Trash. Once you get all of the clips in the order you want them, you can start adding effects to them. One of the more popular effects is a transition between scenes. Transitions prevent sharp cutaways that can have a jarring effect on the viewer. Smoother transitions, such as fades and slides, can make things a lot easier on the viewer.
Task: Adding Transitions 1. In the iMovie application, click on the Transitions button. The Transition control appears in the Shelf (see Figure 10.24). 2. Click on a transition to select it and display the effect in the Preview window. 3. Click and drag the Speed control to adjust the total length of the transition. Transition effects can range from one-tenth of a second to four seconds. 4. Click and drag the transition between the clips where the transition is to appear. The transition is placed between the clips in the Effects Pane, and the rendering process begins (see Figure 10.25).
273
274
Part II
Printing, Graphics, and Multimedia
Preview Window Duration of Transition Speed Control
Figure 10.24 Transitions between scenes are easy to manage.
Rendering Progress
Figure 10.25 You must render all effects before you can view them.
Multimedia
Chapter 10
NOTE Whenever you add an effect to raw video, the iMovie application has to work to smoothly insert that effect. This process is called rendering. If you add a lot of effects, you need to wait for them all to finish rendering before you can view the effect or export the movie in its final form.
5. Repeat steps 2–4 until you have inserted all of the necessary transitions. Not only can you add nifty visual effects to a video, but you can also add your own title to the clip, giving it a very professional look.
Task: Adding Titles 1. In the iMovie application, click on the Titles button. The Transition control appears in the Shelf (see Figure 10.26). Title Direction Duration of Title Speed Control Pause Control Font Controls Title Text
Figure 10.26 Title insertion is easy.
275
276
Part II
Printing, Graphics, and Multimedia
2. Click on a title effect to select the title and display the effect in the Preview window. 3. Click and drag the Speed control to adjust the length of time it takes the title to move onto the screen. Title entrance speeds vary between title effects. 4. Click and drag the Pause control to adjust the length of time the title pauses on the screen. Pause duration varies between title effects.
TIP The total time for the title effect appears in the Preview window.
5. Click on the font controls to change the title’s font, size, and color. 6. Click on the text entry field to change the content of the title. 7. Click and drag the title to just before the first clip in the series within the Effects Pane. The title is rendered onto that clip. You can, of course, do much more with your movie in iMovie. You can add sound effects, voiceovers, and even music. These tasks are beyond the scope of this chapter, but you are invited to check out iMovie 2 Fast and Easy (Premier Press, 2001) to further explore this really cool app.
Presenting Your Work Now that you are finished with your masterpiece, it’s time to share it with the world. There are three ways you can share a video that you have edited. The first way is to convert the entire thing to a QuickTime movie that you can burn to a CD or place on the Internet. If the people you intend to share with don’t have computers, you can send the video back to the camera. Most digital video cameras have hookups to analog video equipment, so you could hook the camera up to a TV and display the video that way, or hook the camera up to a VCR and record the video to a VHS tape.
Multimedia
Chapter 10
The third way is for owners of Macs with DVD-R drives. Those users lucky enough to have DVD recording capability can export the finished video to the iDVD application (which comes with DVD-R-equipped iMacs), and burn it to DVD from there. Most people will use one of the first two ways, which are illustrated in the next two Tasks.
Task: Exporting to a Camera 1. Connect your camera to the computer and make sure the camera is powered on. 2. Using the camera controls, advance the tape to the place where you want to record the movie. 3. In the iMovie application, click on File, Export Movie. The Export Movie dialog box appears (see Figure 10.27).
TIP You can type Å+E to initiate the Export Movie command in iMovie.
Figure 10.27 Exporting a movie to the camera.
4. Confirm that the Export options list reads To Camera. 5. Click on Export. The video begins to play, and the camera begins to record. When the video is over, the record/playback process stops automatically.
277
278
Part II
Printing, Graphics, and Multimedia
Task: Exporting to a QuickTime Movie 1. In the iMovie application, click on File, Export Movie. The Export Movie dialog box appears. 2. Click on the Export options list and select To QuickTime. The QuickTime options appear (see Figure 10.28).
Figure 10.28 QuickTime has its own set of options for exporting.
3. Click on the Formats options list, and select the option that suits your needs.
TIP Remember, the larger the movie display size, the more memory the movie takes up. Don’t make your movies too big, or they could take people way too long to download—and they might not fit on a CD!
4. Click on Export. The Export QuickTime Movie dialog box appears. 5. Type a new name for the movie in the Save As field. 6. Click on Save. The rendering process begins. When complete, the movie is saved in the specified location on your hard drive.
Multimedia
Chapter 10
Summary You have seen the OS X tools that you can use to handle video and sound presentations, as well as the tools to make your own videos with almost no experience necessary! OS X has a lot more to offer in the multimedia department than just video management. In Chapter 11, you’ll see how your OS X machine can sing, talk, and even listen to what you have to say.
279
Chapter 11 The Mac Sound Machine
282
Part II
Printing, Graphics, and Multimedia
he last few years have comprised a digital revolution in terms of how people record, mix, deliver, play, and listen to music. Because of their graphical user interface and inherent usability, Macintosh computers have always been able to create sophisticated graphics and multimedia, including audio. Artists, such as Todd Rundgren, are well-known Macintosh fanatics, using Macs in almost every phase of producing sophisticated audio recordings.
T
Mac OS X continues the grand tradition of the Macintosh as a powerful platform for creating, editing, and playing music. Today’s Macs running Mac OS X not only play CDs, but they also retrieve music for you over the Internet, record music from CDs, edit audio files that are stored on disk, and much more. In addition, your Mac can talk to you, reading documents, Web sites, and almost any selected text out loud using built-in voices. As if that weren’t enough, your Mac can also accept voice commands through a built-in or external microphone, and can automatically open files, run programs, and do almost everything except make your dinner (reserved for an upcoming release of Mac OS X, perhaps).
A Sound Primer Regardless of where you store digital audio information, it consists of 1s and 0s, just like any other file on your computer. Creating and editing audio files on your computer is easy, because they are just files like everything else. As you’ll see later in this book, OS X extends this “it’s just a file” idea to just about everything on your computer, but you’ll learn about that later. For now, you’ll focus on how computers store and manipulate audio files. Any application that can read and write files stores its data in a specific format in the files it uses. For example, Microsoft Word stores its data in files that contain internal information about the application that created them. This extra information is known as standard file type and creator information. Macintosh applications use file type information to determine whether they can open a specific file. OS X uses the creator information to determine which application to use to open a file. Together, the file type and creator information identify those files as Word files, and cause the Word icon to be displayed when you view those files in the Finder. Files that are intended for general use, rather than for use by a specific application, have generic file type and creator information that more generally identifies them—their creator information generally maps to a default application, but does not uniquely identify the specific applications that created them. This enables many different applications to create, open, and use those files.
The Mac Sound Machine
Chapter 11
Unlike previous versions of the Mac OS, Mac OS X also uses file extensions to identify the application that should be used to open files with that extension. This isn’t quite as sophisticated as the file type and creator information that previous versions of the Mac OS depended on, but is a simpler mechanism that users of other operating systems, such as Microsoft Windows and Linux, are already familiar with. You can see the extensions associated with most Mac OS X files by selecting the Always show file extensions checkbox in the Finder’s Preferences dialog.
TIP Mac OS X doesn’t provide a way of directly modifying file type and creator information because this information is designed to be set by the applications that create files on your Mac. If you want to manipulate this information yourself, you can use various shareware and commercial applications to easily change the type and creator of Macintosh. One of the best applications is Super Get Info, which is available from Bare Bones Software at http://www.barebones.com/products/supergetinfo.html. You can access the app any time using a keyboard shortcut. It adds itself to the Finder’s context-sensitive menus, and it even provides a command-line tool for OS X terminal windows. TypeShuffler is another popular package for examining and modifying file type and creator information in OS X. You get it from Bubble Pop Software at http://www.bubblepop.com/typeshuffler/. TypeShuffler provides a Dockable drag-anddrop interface for viewing and modifying file type and creator information.
You can store audio information in computer files in a number of ways. Each audio file format is someone’s idea of the optimal way of storing audio information and preserving detail about the audio information. Some audio file formats provide acceptable sound quality while minimizing the size of the file, whereas others focus on providing the highest audio quality possible, regardless of the size of files that result. For example, AIFF files are huge but contain an accurate representation of recorded sounds. (AIFF files sizes are approximately 10 megabytes per minute of music.) This is great for high-quality audio recording, but it isn’t so great if your goal is to convert your CD collection into audio files that you can listen to on your computer. For this reason, other file formats have emerged that attempt to strike a balance between file size and sound quality. The most popular is the MPEG-3 (MP3) file format, which generally works out at around one megabyte per minute
283
284
Part II
Printing, Graphics, and Multimedia
of audio, and provides sufficient sound quality for all but the most discriminating audiophiles.
TIP The Ogg Vorbis compressed audio file format is an up-and-coming format that is getting a lot of press. This format provides discriminating listeners with high quality audio with 8,000 to 48,000 samples per second, 16 or more bits per sample, and multiple channels. Ogg Vorbis is an open source, non-proprietary, patent- and royalty-free audio file format that provides high quality audio without any possibility of squabbles over usage or royalty payments. For more information about Ogg Vorbis, visit http://www.xiph.org/ogg/vorbis.
Table 11.1 shows some of the most common file formats for storing audio information on Macintosh systems and elsewhere, their Macintosh file and creator types, and a quick summary of each format’s features. Table 11.1 Common Audio File Formats Format
Type
Creator
Extensions
Meaning/Use
AIFF
AIFF
SCPL
.aif, .aiff
Audio Interchange File Format
AIFF
AIFF
SCPL
.aifc
Compressed AIFF audio data
AU
ULAW
TVOD
.au
Sun MicroSystems audio format
HCOM
FSSD
SCPL
.hcom, .sox
Huffman-compressed 8-bit audio
MIDI
Midi
TVOD
.mid, .midi
Musical Instrument Digital Interface
MIME
MIME
MIME
.mime
Multimedia Internet Mail Extension
MOD
Strk, 6669
SCPL
.mod, .nst, .669 Amiga modulated sound file
MPEG-1
MPEG
TVOD
.m1a, .mp1
MPEG-1 audio stream
MPEG-2
MPEG
TVOD
.mp2
MPEG-2 audio/video stream
The Mac Sound Machine
Chapter 11
Table 11.1 Common Audio File Formats (continued) Format
Type
Creator
Extensions
Meaning/Use
MPEG-3
MPEG3
TVOD, hook
.mp3, .mpg
MPEG-3 audio
MP3 VBR
MPEG
TVOD
.mp3, .vbr
MPEG-3 Variable Bit Rate audio
MultiMOD
MIM
SNPL
.mtm
Multi-Mod Music (PlayerPro)
OGG
OGG
TVOD
.ogg
Ogg Vorbis Sound Files
RA
PNRM
PNst
.ra, .ram, .rm
Real Audio sound file
SND
BINA,ULAW
SCPL
.snd
SoundApp sound file
SVX
8SVX
SCPl
.svx
Amiga Interchange File Format sound
Mu-Law
ULAW
TVOD
.ul
MoviePlayer sound file
VOC
VOC
SCPL
.voc
SoundBlaster sound file
WAV
WAVE
TVOD
.wav
Microsoft Windows sound file
WVE
BINA
SCPL
.wve
Psion PDA sound file
These formats each have features, benefits, and drawbacks. Regardless of the format in which they are stored, all audio data files contain the following types of information: ◆ Bits Per Sample: The number of bits used to store the information at each sampling interval. ◆ Number of Channels: The number of separate channels of audio data that were captured (one for mono sound, two for stereo sound, four for quadraphonic sound, and so on). ◆ Sampling Rate: The number of times per second that the original sound was captured. Sampling rates are usually expressed in terms of the frequency of the audio samples (Hz or kHz), or the number of samples captured per second. Sampling rates are always expressed per channel, which means that stereo data captured at 1,000 samples per second actually consists of 2,000 samples per second, for example.
285
286
Part II
Printing, Graphics, and Multimedia
TIP Chris Bagwell’s Audio File Format FAQ at http://home.sprynet.com/~cbagwell/ audio.html is an excellent Internet source for information on audio file formats. This FAQ provides exhaustive information about audio standards, file formats, and associated technical details that are beyond this book’s scope.
Despite the variety of audio file formats in Table 11.1, using sound on the Macintosh is not a Tower of Babel experience of confusing and incompatible file formats—in fact, the opposite is true. As discussed in the previous chapter, Apple’s QuickTime application plays many of the most popular audio file formats. You can upgrade to the professional version of QuickTime to use it as an encoder to convert audio files in other formats to more standard formats, such as MP3. More importantly, as you’ll see later in this chapter, Apple’s iTunes makes it easy for Mac users to create and play MP3 files in OS X—no additional software required. OS X provides excellent audio capabilities with QuickTime and iTunes, but there is also a number of shareware and commercial audio players, recorders, and format converters for the Macintosh. Some, such as Norman Franke’s excellent SoundApp (http://www.spies.com/~franke/SoundApp), have been around for years and are still popular. SoundApp is still a valuable application for converting audio files in an incredible number of formats into more standard or modern formats. Plus it’s free, which is a hard price to beat! Writing an application that records and plays audio files is a tremendous amount of work, and writing one that only understands a single format dooms it to obsolescence. For this reason, many audio applications use a flexible architecture that enables developers (and sometimes users) to plug in support for new audio file formats. The process of creating an output file in any audio (or video) format is called encoding. As with QuickTime, the small plug-ins that support different audio file formats are called codecs, which is short for compression/decompression modules. By adopting support for different plug-in codecs, an audio application can guarantee stability because it does not need to be recompiled and re-released whenever a new audio format appears, and it has the flexibility that helps overcome obsolescence. This section provided an overview of the different ways that sound files can be stored on any computer system, the most popular audio file formats used on Macs, and introduced some of the most common applications used to play audio files
The Mac Sound Machine
Chapter 11
under OS X, including applications that could help you convert existing sound files into more modern audio file formats. Chapter 10 introduced QuickTime, Apple’s “one application fits all” solution for playing almost any kind of audio or multimedia file. We’ll discuss Apple’s stellar iTunes application later in this chapter to show how OS X provides you with a complete out-of-the-box audio and video solution that should satisfy everyone but the most discriminating user. However, before exploring iTunes, let’s step back for a second and look at the audio hardware that comes with your OS X system, and see what other audio hardware options are available.
Sound Hardware and Mac OS X As part of Apple’s goal of providing the world’s most usable computer, Macintosh computers have come with built-in audio inputs and outputs suitable for home use since the late 1980s. All OS X-capable Macintosh systems have built-in audio hardware that is suitable for most home audio playback and recording purposes. Apple first began including the Digital Signal Processing (DSP) chips required for serious audio processing on the motherboards of some of its Centris and Quadra models, but these were only the basis of the audio requirements for the professional musician or sound person. Though the first high-end Macintosh audio cards appeared in the ancient NuBus days, Apple’s adoption of the industry-standard PCI bus (also used in Windows systems and some workstations) opened the market for affordable, high-quality audio cards that you could use with a Mac to provide studio-quality audio recording and playback. All of today’s Mac G3 and G4 desktop systems have at least one PCI slot that you can use to add a higher-quality audio card than the one built into your Mac. The built-in hardware should suffice unless you’re a serious musician, audiophile, or a compulsive computer user.
Easy Expandability Using USB Like the adoption of the PCI bus, an industry standard that gave hundreds of existing hardware manufacturers instant access to millions of Mac users, Apple’s adoption of the Universal Serial Bus (USB) standard in its G3 and G4 systems has paved the way for another generation of open and crossover hardware. A few years ago, many PCI hardware vendors didn’t provide Macintosh drivers for their hardware, but this is not the case in the USB universe.
287
288
Part II
Printing, Graphics, and Multimedia
NOTE Early versions of OS X supported a relatively small number of USB devices. Each subsequent release of OS X has broadened the spectrum of supported USB devices; now, it is surprising to find a USB device that is not immediately compatible with OS X. Free OS X software such as iPhoto uses USB as its primary mechanism for retrieving photos from digital cameras and Compact Flash storage devices.
Because USB is a standard, system-independent interface, there are huge numbers of USB devices that enhance your Macintosh audio experience. The most common are USB microphones for audio input and USB speaker systems that provide high quality output. USB provides significant opportunities for improving the audio input and output experience for Macintosh users who simply want to record or play music, but it provides even more exciting opportunities for professional musicians, who can use this standard to communicate between and control electronic musical instruments. USB opens a world of digital music creation that was formerly limited to serial communication between a computer and a single device, or to communication between multiple devices using high-priced interfaces designed specifically to communicate between digital music devices.
MIDI Hardware and OS X MIDI (Musical Instrument Digital Interface) is a standard way for different pieces of electronic musical equipment to communicate with each other. Drum machines, keyboards, mixers, samplers, sequencers, synthesizers, and samplers commonly exchange information using MIDI. Roland and Sequential Circuits, two of the biggest synthesizer manufacturers in the 1980s, created the MIDI standard early in that decade to replace a number of proprietary standards that prevented much of the equipment of the time from communicating with equipment from other manufacturers. MIDI also expanded the capabilities beyond those of previous proprietary standards, enabling any MIDI interface to carry data controlling up to 16 devices. Users can employ computers that support MIDI to write music, and control musical equipment using programs called sequencers. MIDI does not transfer audio data; it controls attached MIDI devices by sending digital signals that tell them what and how to play rather than sending them
The Mac Sound Machine
Chapter 11
actual music. MIDI information consists of timed sequences of events rather than the actual sounds. Users can integrate actual sounds with MIDI events through other hardware and software. Traditionally, MIDI communication took place over either special MIDI interface hardware or serial ports. The advantage of dedicated MIDI interfaces over standard serial ports was that most MIDI interfaces provided input and output ports that enabled the user to chain together multiple MIDI devices and have them all interact simultaneously. Instead of the serial interfaces of yesteryear, most of today’s standard MIDI hardware communicates using USB connections. USB MIDI devices combine the advantages of a standard communication connection with the ability to interconnect a series of devices and have them cooperate.
MP3 and the Mac Near the end of the 20th century, cassette tape players were all the rage, and music stores also sold music on quaint analog devices called records. Records physically generated sound using a needle that scratched along grooves on the record’s surface. People who needed to take their music with them would either buy tapes or copy their records onto tape. Fast forward a few years, and tapes and records are history, replaced by compact discs (CDs), which provide digital audio in a portable, virtually indestructible format. CDs still share one thing with their analog predecessors—you have to visit a physical or online store before you can listen to the music a CD contains. Today, people’s expectations of where and how to get and play music are much different than they were a few years ago. Because CDs store digital audio and are also the most common mechanism for software delivery, people began recording their music CDs onto their computers (called “ripping” them), making their CD collections as portable as their laptops or MP3 players. Many people buy CDs nowadays, and physically use them only once—to copy the music from the CDs to their computers. Then they put the CD on a shelf forever. After a few years of experimentation with various audio file formats, most people have settled on the MPEG-3 audio file format, more popularly known as MP3. The MPEG (Motion Pictures Expert Group) standard is the result of an industry effort to decide upon certain standard algorithms for audio and video compression. MPEG-1, the first MPEG standard, provides a fairly simple compression scheme
289
290
Part II
Printing, Graphics, and Multimedia
comprising three layers of increasingly complex audio compression algorithms. These are backward compatible, meaning that an MPEG-1 layer 3 decoder can decode both MPEG-1 layer 2 and MPEG-1 layer 1 audio files. Files compressed using the MPEG-1 layer 3 algorithm are called MPEG-3 or MP3 files. MPEG-1 layer 3 compression uses two primary techniques to reduce the size of audio files: ◆ Psychoacoustic modeling: Eliminates redundancies and irrelevant portions of audio signals—the parts of an audio signal that are beyond the human ear’s hearing range, portions of the signal that are masked by other parts of the signal, and so on. For example, if an extremely highfrequency and an extremely low-frequency sound occur at the same time, the higher-frequency sound typically masks the lower-frequency sound. In such a case, the lower frequency sound could be eliminated. Eliminating portions of a signal is called lossy compression because the result has less quality than the original, but the goal of psychoacoustic modeling is to eliminate only the parts of the audio signal that are not significant to most listeners. ◆ Huffman encoding: Compresses audio signals based on the frequency with which certain values occur in the audio file. Values that appear most often are replaced with simple tokens that are stored in a lookup table and are expanded when the file plays back. Because these tokens are smaller than the actual signal values that they represent, using the Huffman encoding mechanism to compress audio files substantially reduces their size. The actual size reduction, however, depends on the number of times that tokenized signals occur in the audio input. Many people’s computers are now their primary audio playback and storage devices. Unfortunately, finding an optimal online audio player can still be a challenge—except for those of us who use OS X. Apple provides a high-power, good looking, and functional solution with its free iTunes audio player.
Introducing iTunes “Why bother doing anything if you’re not going to do it well?” seems to have been Apple’s mantra for years. This might explain why the first releases of OS X didn’t come with a player for music files. Many early OS X users felt this was a serious omission. However, around the time of the first OS X upgrade (10.0.1), Apple unveiled its iTunes audio player, which was initially only available by downloading
The Mac Sound Machine
Chapter 11
from Apple’s Web site. iTunes is a standard part of OS X 10.1, and updates are frequently available at http://www.apple.com/itunes/. At the time of this writing, iTunes 2 is the standard version of iTunes, and is therefore the version pictured in the figures in this chapter. Unless referring to the features of a specific iTunes version, I’ll use the generic term “iTunes” throughout this chapter. Apple’s iTunes is a digital audio player that lets you record MP3 files from CDs and import MP3 files that you have obtained from other sources. To manage your online music library, iTunes makes it easy for you to create playlists, which are lists of songs that you can save and replay together at any time—playlists are a way of identifying subsets of your music collection that you may want to replay in a certain order. iTunes also lets you listen to Internet audio—streaming (that is, continuous) audio that is broadcast over the Internet 24 hours a day from as radio stations and other sources.
NOTE If you’re lucky enough to own an iPod—Apple’s sexy, hi-tech, and portable MP3 player—you can use iTunes 2 to upload and download MP3 files to the iPod using your Macintosh’s FireWire port (if it has one). The iPod can play music in MP3, variable bit rate MP3, AIFF, and WAV formats, and it is firmware-upgradeable, meaning that it will support additional formats in the future. For more information about the iPod, see http://www.apple.com/ipod/.
iTunes 2 comes with new standard features such as the ability to create (burn) your own MP3 CDs, a built-in 10-band equalizer with 22 EQ presets, and crossfading between songs. Figure 11.1 shows iTunes displaying the contents of an audio CD that is in my system’s CD drive, ready to be recorded. The next few sections explain how to use iTunes’ basic features to create a customized, online music library. First, make it easy to start iTunes by adding it to the OS X Dock.
TIP Installing iTunes automatically associates it with newly inserted audio CDs and MP3 files. If you install other software that plays CDs or MP3 files, that software may replace iTunes as the program that automatically opens music files. Therefore, putting an iTunes icon in the Dock is very convenient.
291
292
Part II
Printing, Graphics, and Multimedia
Figure 11.1 iTunes displaying a CD listing.
Task: Adding an Icon for iTunes to the Dock 1. Double-click the Applications icon in the toolbar of your current Finder window. If no Finder window is open on your desktop, click the desktop’s background to make the Finder your current application, then press Å+N to open a new Finder window. If the Finder toolbar is not displayed in your current Finder window, click Å+B to display the Finder toolbar. After selecting the Application icon, the OS X Applications folder appears in the Finder window. 2. Use the scroll bar at the right of the Applications window to scroll down until you see the iTunes icon. 3. Click the iTunes icon and hold the mouse button or the button below the touchpad on your iBook or PowerBook. 4. Drag the iTunes icon to where you want it to appear in the Dock. 5. After you position the iTunes icon, release the mouse button. You can now start iTunes at any time by clicking on its icon in the Dock.
Starting iTunes for the First Time The first time you start iTunes, a setup assistant helps you configure the application. The first Setup Assistant dialog box, shown in Figure 11.2, is just a welcome
The Mac Sound Machine
Chapter 11
Figure 11.2 The first iTunes Setup Assistant dialog box.
screen. When running the iTunes setup assistant, click Next to proceed to the next dialog box, and Back to return to the previous dialog box. Click Cancel at any time to exit the setup assistant and start iTunes. If you do this, you can configure iTunes at any time by selecting the iTunes menu’s Preferences (or by pressing Å+Y ). Figure 11.3 shows the second iTunes Setup Assistant dialog box. Here you can specify whether you want to use iTunes to play Internet audio. The Yes, Use iTunes for Internet Playback option is selected by default, which means that clicking on any Internet audio link in a Web browser automatically launches iTunes. If you want to use another application (or a browser plug-in) to play Internet audio, click the No, Do Not Modify My Internet Settings button. When playing or ripping CDs, iTunes can connect to the Internet to look up the CD in the Internet CD Database (CDDB) to display artist and song title. The Yes, Automatically Connect to the Internet button is selected by default. If you want iTunes to prompt you before attempting to connect to the Internet, select the No, Ask Me Before Connecting button. After making any changes you want, click Next to proceed to the final iTunes Setup Assistant dialog box, shown in Figure 11.4. The third and final iTunes setup assistant dialog lets you select whether you want iTunes to automatically search your hard drive(s) for MP3 files and add them to its library. iTunes doesn’t move any MP3 files that it finds; it just adds entries for
293
294
Part II
Printing, Graphics, and Multimedia
Figure 11.3 The second iTunes Setup Assistant dialog box.
Figure 11.4 The final iTunes Setup Assistant dialog box.
them to its library so you can use your existing MP3 files in any playlists that you create. Depending on the amount of disk space and the number of files on your Mac, searching your entire system for MP3 files can take a few minutes, so you may want to skip this step by selecting No, I’ll Add Them Myself Later instead of the default option. You can always add MP3 files to your iTunes library. Click Done to close the iTunes setup assistant and display the iTunes application, as shown in Figure 11.5.
The Mac Sound Machine
Player Controls
Playlist Controls
Player Status Information
Sources
Track Listing
Search
Chapter 11
Source-Specific Control
Equalizer Visualizer
CD Eject
Figure 11.5 The main iTunes dialog box.
The main iTunes dialog box has the following controls and sections: ◆ Player Controls: The controls in the upper-left portion of the iTunes dialog box enable you to play songs, move between songs, and pause playback. The volume control is directly below the player controls. ◆ Player Status Information: The window in the top-center of the iTunes dialog box displays information about the audio source and the song that is currently playing. By default, this window displays the name of the artist whose music is playing, and displays the elapsed time of the current track. You can change the type of information that is displayed by clicking on it—clicking the artist or source entry displays the name of the song that is currently playing, and clicking on the elapsed time displays the remaining and total time for the current track. ◆ Search: Enables you to find all of the songs in the current playlist or your entire library that contain the specified characters. ◆ Source-Specific Control: Differs depending on whether you are listening to a CD, an Internet radio source, a playlist, or files from your library: ◆ Library: When viewing your song library, clicking this button toggles between two modes for browsing the library tracks. The first mode
295
296
Part II
Printing, Graphics, and Multimedia
displays a one-line-per-track listing, and the second mode displays a multi-column track listing organized by artist and album, and also lists the individual tracks on the album. ◆ Radio Tuner: When viewing a list of Internet radio sources, clicking this button redraws the display and reloads the list of available stations. ◆ Playlist: When viewing a playlist, clicking this button begins burning a CD that contains the tracks in that playlist. If your Mac does not have a CD-RW drive, an error message displays in the Status Information window. ◆ CD: When an audio CD is inserted, clicking this button begins encoding all of the tracks on the CD into MP3 files on your Mac. ◆ Visual Effects: When you have configured iTunes to display visual effects triggered by the current audio source, clicking this button enables you to set various visual effect configurations. ◆ Sources: Lists all of the audio information sources that are available on your Mac, including any playlists. ◆ Track Listing: Lists the tracks on the current CD, or in the current playlist or Internet audio source. ◆ Playlist Controls: Enables you to create and manipulate playlists. The three buttons, from left to right, let you create a new playlist, randomize song play within the selected playlist, and control whether the playlist or current song repeats continuously. ◆ Equalizer: Enables you to toggle whether the iTunes graphic equalizer is displayed. The equalizer lets you boost or reduce the intensity of various sound ranges within the audio source. ◆ Visualizer: Enables you to toggle whether the main iTunes window displays visual effects or the current song list. ◆ CD Eject: Ejects the CD that is in your CD drive. Now you know how to configure iTunes to your specifications. The next few sections explain how to perform specific tasks in iTunes.
Playing CDs Using iTunes Playing CDs using iTunes is a snap. Installing iTunes on your OS X system automatically makes iTunes the default application associated with audio CDs and
The Mac Sound Machine
Chapter 11
MP3 files. Whenever you insert an audio CD, OS X automatically starts iTunes (as long as the “Begin Playing” option is selected in the iTunes Preferences, as it is by default).
Task: Playing a CD in iTunes 1. Insert a CD in the CD drive. iTunes starts automatically. If it doesn’t, click the iTunes icon in the Dock or in the Applications folder.
NOTE If you selected Yes, Automatically Connect to the Internet when you set up iTunes, iTunes automatically connects to the Internet and queries the CDDB for artist, title, and track information for your CD. If iTunes finds the CD in the CDDB, your computer will download the playlist, artist, and song titles for iTunes to display. If there’s no entry for your CD in the CDDB, iTunes displays a generic source labeled Audio CD, and displays placeholder titles for the tracks. (See Figure 11.6).
Figure 11.6 The iTunes dialog box after inserting a CD that isn’t in the
Internet CD Database.
2. If you want to enter the names of the tracks on the CD, slowly click twice (not double-click) on each of the generic track titles (the first time to select the track, and the second to edit its name). Then type the track name.
297
298
Part II
Printing, Graphics, and Multimedia
NOTE If you accidentally double-click on a song title, that song begins playing. This is OK, but not what you wanted to do!
TIP You do not need to enter song title and artist to play a CD. However, entering this information is good if you have the time, because it simplifies playing back specific tracks. It can also make the artist/title information available to anyone else who consults the CDDB for artist/title information. For information about entering artist/title information for a CD that is not in the CDDB, see the “Encoding an Audio CD” Task in the next section.
3. To begin playing the CD, click Play. To play a certain track, select that track in the Track Listing window, and click Play. If you select multiple tracks, iTunes plays the first selected track.
Recording from CDs Using iTunes The process of recording CDs or selected tracks and saving them as MP3 files on your system is called encoding or ripping. (Ripping is meant to be evocative of the process of extracting the music from the CD, and not of any legal or moral issues). When you insert an audio CD, iTunes starts automatically, creating an entry with the CD title in the Source window and displaying a track listing of the current CD. Inserting an audio CD also automatically sets the source-specific control in the upper right-hand corner of the iTunes dialog box to a small musical note icon. The Import label displays below that icon. Now you’ll learn how to use iTunes to make a copy of the files on a CD, so that you can play those songs using your Mac.
Task: Encoding an Audio CD 1. Start iTunes by clicking its icon in the Dock. The iTunes window opens. If you selected the Yes, Automatically Connect to the Internet button when you first started iTunes, iTunes automatically connects to the
The Mac Sound Machine
Chapter 11
Internet and queries the CDDB for artist, title, and track listing information. iTunes automatically creates a entry with the CD title in the Source window, and displays the CD’s track listing. If iTunes finds the CD in the CDDB, it displays the playlist, artist, and song titles in the Track Listing window. 2. If there’s no entry for your CD in the CDDB, iTunes displays a generic source labeled Audio CD, and displays placeholder entries for the track titles, as shown in Figure 11.7. 3. If you want to enter the names of the tracks on the CD, slowly click twice (not double-click) on each of the generic track titles (the first time to select the track, and the second to edit its name). Then type the track name.
TIP If you want to enter song title and artist information for a CD that is not in the Internet CDDB, do so before encoding the CD—this information is stored in a special portion of each MP3 file. Once you have entered the track titles, select Submit CD Track Names from the Advanced menu. After entering artist, title, genre, and year information, click OK to submit this entry to the Internet CDDB. This saves the next person that plays this CD from having to enter the same information. When you successfully submit a CD’s information, iTunes displays the dialog box in Figure 11.8.
Figure 11.7 Entering information for a CD that is not in the Internet
CD Database.
299
300
Part II
Printing, Graphics, and Multimedia
Figure 11.8 The Status dialog box after a successful submission to the Internet
CD Database.
4. To begin encoding an audio CD, click the Import button. iTunes begins playing the CD and encoding its the tracks into MP3 files. To encode a CD without hearing it at the same time, use the player controls’ volume slider to turn off the volume. The track that is being ripped is highlighted in the Track Listing window, and a small orange icon displays beside the tracks’ name. The name of the track that is currently playing displays in the Track Listing window at the top center of the iTunes dialog box.
NOTE Ripping the tracks from a CD is faster than simply playing the CD, so the highlighted track is not the same as the track that is playing. This is perfectly normal.
5. As iTunes encodes each track, the orange icon is replaced by a small green check mark. When iTunes has ripped all of the tracks, click the Eject button in the lower right-hand corner of the iTunes dialog box to eject the CD. iTunes automatically switches to using the MP3 files that you just encoded as its playback source.
Creating Playlists in iTunes Playlists are sets of songs that you want to hear in a specific order. Whether you’re choosing music for a romantic evening or just want to keep a party moving, playlists are a great way to hear your favorite songs in the order you’d like.
Task: Creating a Playlist in iTunes 1. Start iTunes by selecting its icon from the Dock or by inserting an audio CD.
The Mac Sound Machine
Chapter 11
2. Create a new playlist by selecting the File menu’s New Playlist command (or pressing Å+N). This creates a new untitled playlist. 3. Type a title into the Source window, and press Return. You can change the name of your playlist later by slowly clicking the name twice in the Source window, entering a new name, and pressing Return to save the name.
TIP iTunes can only create playlists of songs that are encoded into MP3 files on your computer. If you want to add a track from a CD that you have not encoded, iTunes automatically encodes the track when you drag it into your playlist.
4. To find the songs that you want to add to your new playlist, select Library in the Source window. The Track Listing window splits into two windows; the top one shows the CDs that are currently in your library, organized by artist, then by album. The bottom window shows an alphabetical listing of the songs in your Library. 5. To add songs to your playlist, select them in the Track Listing window, then drag and drop them into a playlist. iTunes automatically saves the updated playlist.
TIP You can add songs that aren’t already in your iTunes library by dragging them from a Finder window and dropping them into your playlist. iTunes displays a reminder but it adds the songs to your playlist.
6. To reorganize the songs in a playlist, simply drag the song titles to their new locations in the playlist. Once you’ve created a playlist, you can modify or expand it by dragging additional audio files into that playlist in the Source window. You can also reorganize songs within a playlist by clicking that playlist in the Sources window to display its contents, and then selecting and dragging tracks within the track listing window.
301
302
Part II
Printing, Graphics, and Multimedia
Adding Existing MP3 Files to Your Library You may want to add MP3 files from other sources to your iTunes library so that you can use them in playlists or simply keep your musical library as portable as your iBook or PowerBook. iTunes lets you search your local or networked hard disk(s) for MP3 files from other sources and create entries for them in your iTunes library.
TIP By default, iTunes stores any audio files that it creates in the Documents, iTunes folder in your home directory. You can add MP3 files from any directory to your iTunes library, but if the files are outside the Documents, iTunes folder, iTunes warns you that relocating music files outside this directory may confuse iTunes’ notion of how and where to find these files. The safest way to permanently add audio files to your iTunes music library is to copy them into your Documents, iTunes directory and then add them to your iTunes music library.
Task: Adding MP3 Files from Other Sources to your iTunes Library 1. Start iTunes by selecting its icon from the Dock. 2. Select File, Add to Library. The dialog box shown in Figure 11.9 displays.
Figure 11.9 Selecting a drive or folder to search for existing MP3 files.
The Mac Sound Machine
Chapter 11
3. Navigate to the drive or folder that you want to search for existing MP3 files. 4. Click Choose to begin searching the selected drive or folder. If the drive or folder is outside your iTunes music folder, iTunes displays the warning dialog box in Figure 11.10. Audio files outside iTunes’ own directory are more prone to being moved or accidentally deleted, which may invalidate playlists entries that reference external files.
Figure 11.10 It’s time to play music. Do you know where your audio files are?
5. iTunes adds to its library any MP3 files that are not already there.
NOTE As you learned in the “Encoding from CDs Using iTunes” section, iTunes includes information about a song’s artist and album when it encodes them. Audio files that other applications produce may not have that information in the MP3 file headers. Your imported audio files may appear in iTunes without artist or album information, as shown in Figure 11.11. In this case, you can either reencode the songs from their original source media, or you can simply add the missing information in iTunes by slowly double clicking on the missing field and typing the missing information. (Hint: Use Cut and Paste if you’re entering the same information for an entire album that’s missing information.) After you save the file in iTunes with the new information, the correct artist and title information display each time you add the file to a playlist.
303
304
Part II
Printing, Graphics, and Multimedia
Figure 11.11 An MP3 file with incomplete MP3 header information.
Creating CDs in iTunes Being able to play CDs, create and import MP3 files, and customize MP3 file sets for playback makes iTunes an extremely powerful and useful application. Nonetheless, sometimes you may want to play music without your friendly OS X system. iBooks and PowerBooks are extremely powerful, but having to carry one belted into your passenger seat isn’t convenient all the time. For these situations, iTunes gives you the ability to create audio CDs that you can play in any CD player. iTunes reduces the complexity of burning CDs to a few mouse clicks. Audio CDs require files to be in a different audio format than MP3, but don’t worry—iTunes automatically converts files for you, creating your CD in two basic steps. First, iTunes converts all of your MP3 audio files into AIFF format, and then quickly writes them, in order, to your CD. The two-step process guarantees that your Mac can supply a constant stream of data to the CD while writing it. Not being able to supply data to a CD writer as quickly as the writer needs it is one of the most common causes of incorrectly written CDs in other applications.
Task: Creating Your Own CDs Using iTunes 1. Start iTunes by selecting its icon from the Dock. 2. Insert a blank CD-R into your CD-RW drive. The dialog box in Figure 11.12 appears.
The Mac Sound Machine
Chapter 11
Figure 11.12 The iTunes CD format selection dialog box.
TIP If you are using an external USB or FireWire CD writer, and iTunes says, “No CD Recordable Device Found,” eject and reinsert the CD. If iTunes still cannot find the drive, disconnect and reconnect the drive. This causes Mac OS X to search again for attached devices, which causes iTunes to recognize the drive. If your Mac still doesn’t recognize the drive, consult http://www.apple.com/itunes/notes.html to make sure that Mac OS X supports your external drive.
3. Enter a title for the CD that you are creating, and select the format in which you want to create it. The dialog box provides three format options and shows the amount of information that each can hold. Choose iTunes (Audio) to create a CD that you want to play in a standard CD player. Some CD players support the MP3 CD (ISO 9660) format, but most don’t. Create an MP3 CD only if you never plan to play it in a standard CD player. The third option, Standard (HFS+/ISO 9660), is for creating data CDs rather than audio or MP3 CDs. Click Prepare to continue. 4. Select or create a playlist containing the songs that you want to put on the new CD. The source-specific icon in the upper right-hand corner of the iTunes dialog box turns into a Burn CD icon that looks like a camera shutter. 5. Click the Burn CD icon. The shutter opens, displaying a black-and-yellow icon. If you selected Audio CD as the format, the status region displays a progress bar and a message that it is preparing the CD (see Figure 11.13). iTunes converts the MP3 files in the playlist to the correct format for an audio CD. This step is unnecessary when creating MP3 CDs or data CDs. 6. The status window displays a “Burning CD” message and progress bar while iTunes creates the CD (see Figure 11.14).
305
306
Part II
Printing, Graphics, and Multimedia
Figure 11.13 Preparing to burn a CD from an iTunes playlist.
Figure 11.14 Burning a CD from an iTunes playlist.
7. When the CD is complete, the status window displays the message “Burning CD…finishing” and plays the “Done” sound. An icon for the Audio CD appears on your desktop. Drag the icon into the Trash to eject the CD. iTunes makes playing, managing, and creating CDs easier than any other audio application—and it’s free! As you’ll see in the next section, the combination of
The Mac Sound Machine
Chapter 11
iTunes and the Mac’s Internet-readiness further extends the audio possibilities of your OS X system by serving as a streaming audio player.
Playing Internet Radio in iTunes iTunes is a complete solution for most of today’s audio requirements, including playing online audio. It can play continuous streamed audio over the Internet, which is often found on Web sites and Internet radio stations. Traditional radio stations are limited to the audience that their radio signal can reach, but now radio stations can broadcast streaming audio over the Internet. As explained in Chapter 10, streaming audio is a constant stream of audio or video information. Any compatible audio player can simply “tune in” to this stream usually by selecting an appropriate URL. Because the Internet provides such a vast amount of information, it is sometimes hard to find exactly what you’re interested in. For this reason, iTunes includes a set of Internet audio sources. This list is automatically updated whenever you select an Internet audio source.
Playing Music From an Internet Audio Source Using iTunes to select and play streaming audio is as easy as selecting and playing an MP3 file from your local audio library.
Task: Playing Internet Audio Using iTunes 1. Start iTunes by selecting its icon from the Dock. 2. Select Radio Tuner from the iTunes Source window. The Playlist window displays a list of available genres (categories), as shown in Figure 11.15.
NOTE You must be connected to the Internet to play Internet Audio, and you need a connection that reliably supports steady transmission rates of 16 kbps (kilobits per second) or better to listen to Internet audio with reasonable quality. When you first select the Radio Tuner in the Source window (or when you expand any available genre listing), iTunes uses the Internet to update its list of available Internet audio sources, and may display a message to this effect.
307
308
Part II
Printing, Graphics, and Multimedia
Figure 11.15 iTunes Internet audio sources.
3. Select the genre of music that you want to listen to. iTunes obtains a list of available stations over the Internet, and expands the genre listing to display the available choices in that genre, as shown in Figure 11.16.
Figure 11.16 iTunes Internet audio sources within a genre.
4. Double-click the station you want to listen to. iTunes displays the URL of the selected Internet audio source in its Status window, displays a separate Status dialog box as it opens the URL for the selected station, and begins reading data from the selected Internet audio source. iTunes
The Mac Sound Machine
Chapter 11
automatically maintains an incoming audio buffer to minimize delays due to slow or congested Internet connections. 5. Streaming audio plays from the selected source. Use the standard iTunes volume controls (or the volume controls on your audio hardware) to adjust the volume.
NOTE Internet audio sources come and go, and iTunes error messages aren’t always the greatest. iTunes can only recognize a problem, rather than the reason for it. Some stations will play slowly or sound choppy, whereas others display an error message when loading information or when you attempt to access them.
Saving Internet Audio Sources Internet audio is a great convenience in today’s connected universe, but not all Internet audio sources are created equal—like any other Internet connection, some are less reliable than others. This is not iTunes’ fault—even the best player is only as good as its audio sources. As you experiment with Internet audio sources, you will find some that you prefer for their consistent transmission quality, their material, or both. Many of the Internet radio listings in iTunes Radio Tuner look similar to each other, so you may want to “bookmark” some sites for easy reference later.
Task: Saving Internet Radio Stations in iTunes 1. Start iTunes by selecting its icon from the Dock. 2. Create a new playlist, and give it a title that is easy to spot in the Source window. 3. Select the Internet audio source that you want to bookmark, and drag and drop the listing from the Playlist window onto the playlist you just created. You can now easily find your favorite Internet audio sources by opening the playlist and selecting from a much shorter list.
309
310
Part II
Printing, Graphics, and Multimedia
Talking Things Over with Your System Not all that long ago, the idea of talking to your computer and having it react was a futuristic notion only seen in cartoons and science fiction films. (We’ve all talked to our computer at one time or another, but I’m not talking about profanity in this case.) Apple has provided the ability to read selected text aloud since Mac OS 7.0, but Mac OS versions 8.5 and later also include the ability to have your Mac respond to spoken commands using Apple’s PlanTalk technology. In Mac OS X, you can access these abilities through the System Preferences Speech control panel; the options are divided into panels that enable you to activate and customize Speech Recognition (having your Mac recognize and respond to spoken commands) and Speech-to-Text (having your Mac read selected text aloud). Now you’ll learn how to configure your Macintosh to read selected text aloud, select and manipulate the voice your Mac uses, and configure your system to respond to spoken commands.
Letting OS X Read to You The Mac’s Text-to-Speech feature is more than just an amusing party game or an aide for optically-challenged users. In OS X, Speech-to-Text is always active, but the system only uses them automatically when error or warning dialog boxes remain on the screen for more than a few seconds. Most Macintosh applications feature a menu option or Preferences selection that enables you to read selected areas of text. You can customize the voice used by Apple’s Speech-to-Text technology, and the rate at which your Mac reads messages or selected text, as explained in the following Task.
Task: Customizing Text-to-Speech in OS X 1. Activate the OS X System Preferences application by selecting its icon from the Dock, and select the Speech icon from the System section. The Speech Preferences panel appears (see Figure 11.17). The Text-to-Speech panel displays by default. 2. To have your Mac read selected text using a different voice, choose a different entry in the Voice selection box. (“Victoria” is the default voice for Textto-Speech.) As you select each voice, a description of that voice appears to the right of the selection box, and that voice speaks a sample phrase.
The Mac Sound Machine
Chapter 11
Figure 11.17 Customizing Text-to-Speech in OS X.
3. To slow down or speed up the rate at which the voice speaks selected text or warning and error dialog boxes, use the Rate slider. After modifying the rate, click Play to hear the sample phrase associated with that voice spoken at the new rate. 4. To keep your selections, simply close the Speech preferences panel. To return Text-To-Speech to its default voice and rate, select “Victoria” and position the Rate slider at the Normal rate. Apple’s Text-to-Speech technology is extremely useful and quite entertaining. As you’ll see in the next section, Mac OS X complements Apple’s speech technologies with sophisticated voice recognition technology that enables your Macintosh to do what you say.
Speaking to OS X Anyone who is a Star Trek fan remembers the scene from Star Trek IV: The Voyage Home in which Scotty picks up a mouse and talks into it to try to make a twentieth-century computer system do his bidding. This isn’t quite as funny as it used to be, because the Mac OS has provided integrated speech recognition since Mac OS 8.5—but it requires a microphone, not a mouse.
311
312
Part II
Printing, Graphics, and Multimedia
Mac OS X’s sophisticated speech recognition technology allows you to easily activate and customize it. Many speech recognition systems can accidentally react to ambient sounds or even casual conversation. As explained in the following Task, Apple’s Speech Recognition module provides configuration options to help you control how and when it is active to prevent such problems.
Task: Activating and Customizing Speech Recognition in OS X 1. If your system OS X system does not have an integrated microphone, connect an external microphone to your Mac’s audio input or USB port. 2. Activate the OS X System Preferences application by selecting its icon from the Dock, and select the Speech icon from the System section. The Speech Preferences panel appears. 3. Click the Speech Recognition tab to display the Speech Recognition preferences. The On/Off panel appears (see Figure 11.18). 4. Click On to activate the Speech Recognition system. A circular microphone appears, as shown in the upper right-hand corner of Figure 11.18.
Figure 11.18 Activating Speech Recognition.
The Mac Sound Machine
Chapter 11
NOTE At the moment, Apple’s Speech Recognition system is the only speech recognition system that Apple provides with OS X. The dropdown menu at the top of the Speech Recognition panel’s On/Off dialog box enables you to switch between different speech recognition systems as they become available from Apple or other software vendors.
5. To automatically start the Apple Speakable Items speech recognition system when you log onto on your Mac, click the Open Speakable Items at Login checkbox. 6. To see a list of all of the phrases the Apple Speakable Items can understand, click the Open Speakable Items button. A Finder window opens, displaying the contents of the folder in which these command are stored. This folder also contains folders that hold lists of Apple Speakable Items commands that are specific to the Finder, OS X Mail, and Microsoft’s Internet Explorer. 7. To modify the sound that plays when your computer recognizes a Speakable Items command, click the selector beside Play Sound When Recognized, and select the sound you want to use. 8. To have your OS X system provide spoken feedback when it recognizes a command, click the Speak Text Feedback checkbox. 9. Select the Listening tab to display the Speech Recognition panel that enables you to control how and when your OS X system listens for spoken commands. The dialog box shown in Figure 11.19 appears. 10. Apple Speakable Items has two basic modes: responding to spoken commands only when you press a specific key, or using a specific key to activate and deactivate Speech Recognition. Select the listening mode that you want to use. You can change the key that activates and deactivates Speech Recognition by clicking Change Key, pressing the key or key sequence that you want to use, then clicking OK. 11. If you selected the option to toggle listening on and off with a specific key stroke or combination, you can specify that the computer only respond when you speak a specific word (which the computer interprets as its name), or within a specified amount of time after you speak that word. If you want to use this option, enter the name by which you want to address your computer, and select how you want your system to react to the name.
313
314
Part II
Printing, Graphics, and Multimedia
Figure 11.19 Customizing when speech recognition occurs.
At this point, your computer is ready to respond to spoken commands. Speak your commands normally but distinctly, waiting a second or so after activating Speech Recognition for the system to fully initialize. You’ll be impressed how useful (and accurate) this technology is, and it’s certain to improve even further with subsequent releases of Mac OS X.
Summary This chapter explained the audio capabilities of Mac OS X. When combined with the graphical and video multimedia capabilities discussed in previous chapters, you can now see that Mac OS X gives you a powerful platform for creating, storing, and playing back audio, movies, presentations, and just about anything else. And all this with the ease of use and built-in power that Macintosh users expect as part of their out-of-the-box experience. Of course, having a great audio and video library and a disk full of multimedia presentations isn’t very exciting if you can’t share them. Mac OS X brings the same transparent usability to networking that it brings to personal computers. It’s easier than ever before to do what you want without worrying about the internals of your hardware or networking configuration.
PART 12 File Sharing 13 Network Administration 14 E-mail 15 The Personal Web Server 16 The Internet
III Networks and Internet
This page intentionally left blank
Chapter 12 File Sharing
318
Part III
Networks and Internet
omputer networks are everywhere. Almost all businesses use an internal network to provide access to shared resources, such as mail servers, printers, and file servers. Before networks, the most common way to exchange data was “sneaker-net”—copying files to floppies or other removable media and physically giving a copy of that data to someone. This had some obvious synchronization problems—if everyone modified his or her copy, merging all of those files back into a single coherent one required patience, creativity, and lots of time.
C
Networking gives multiple people access to the same copy of the same data. Although synchronizing access to a single file is still an issue, having multiple users change the same file or work from the same data increases productivity. This chapter introduces basic networking terminology, explores how to set up a simple network, discusses the different types of systems that Mac OS X can access over the network, and then delves into the details of actually sharing files, folders, and volumes in a variety of ways. The Unix underpinnings of Mac OS X give OS X a truly revolutionary spectrum of connectivity to most other types of computers, providing built-in capabilities that required purchasing third-party software packages in previous versions of the Mac OS. The OS X Aqua interface puts these capabilities at your fingertips, with all of the usability and intuitive design that you’ve come to expect from Macintosh operating systems.
Getting Started Any network, no matter how complex, basically consists of networking cable connected to various computer systems and peripherals. Networking wasn’t always this simple—many older networks required special cabling configurations and multiple network connectors per host. Today’s Ethernet networks have so simplified networking that network cards, cables, and other accessories can be sold off the shelf. This section provides an overview of some types of networks. You’ll then learn about the most common types of networking hardware and networking buzzwords, such as hubs and switches. After covering physical networking using cables, you’ll learn about today’s wireless networks and explore how systems, such as Apple’s AirPort, let you use your laptop almost anywhere without sacrificing network connectivity. This section concludes by providing a firm foundation in networking concepts, such as clients, servers, and peer-to-peer networking. By the end of this section, you may not be a certified network engineer, but you should be able to play one on TV.
File Sharing
Chapter 12
Wiring Everything Together Networking is second only to the U.S. government in terms of its APS (acronyms per sentence) density. Computer networking features a bewildering variety of types of cables, network layouts, competing and complementary protocols, and supposed standards, all of which have complex names that have been shortened into acronyms. In the following sections, I’ll explain the most common and popular acronyms but stick to English whenever possible. The most common types of networks are LANs (local area networks) and WANs (wide area networks). The difference between the two is their geographic or logical scope. Home and small business networks are typically LANs because they serve the needs of a specific, local community. The Internet and large business networks, where a single network serves multiple offices or factories, are WANs because they serve a wide geographical area. Think of a WAN as a number of interconnected LANs. Networking topologies, the ways in which networks are physically laid out, have changed over the years. As Figure 12.1 shows, some of the earliest networks were Star networks, where the computers in a network are organized around a central file server, and Token Ring networks, which are essentially circular. LocalTalk, Apple’s original networking scheme for Lisa and Macintosh computer systems, was a linear network that provided a quick, plug-and-play solution for network connectivity. Although LocalTalk was very forgiving of network communication errors, it was also incredibly slow by today’s standards, maxing out at something like 230 Kbps on a lightly used network with a heavy tailwind. Today, Ethernet is the most common network scheme. Ethernet networks are linear, requiring only that the cable be terminated at each end with a resistor that prevents signals from reflecting back through the network. The primary advantage of a linear network is that breaking the network at any one point only divides it into multiple pieces, known as segments, rather than disabling the whole thing as would have occurred in ancient networks, such as Star or Token Ring networks. Over the years, Ethernet networks have used a variety of cable types, each with an associated and unique way of connecting systems to the network. The first Ethernet networks, known as thick-net networks, operated at a transfer speed of 3 Mbps (megabits per second). Each host connected to these extremely thick cables using a vampire tap and a drop cable. (Vampire tap evokes the connection method—you used a small twist drill to drill through the cable shielding, exposing
319
320
Part III
Networks and Internet
Figure 12.1 The Star, Token Ring, LocalTalk, and Ethernet network topologies.
the network cable, and then clamped on a network transceiver with a single long spike that penetrated the cable and made the connection.) The term transceiver combines transmit and receive, and was the original Ethernet controller because most systems featured a simple, undifferentiated Ethernet connector. A drop cable connected each vampire tap to a single workstation. Primitive, no? The next common type of Ethernet cable was thin-net, also known as RG-58 or TN-58 cable. Each workstation connected to the Ethernet with T-shaped BNC (barrel nut connector) connectors or through BNC transceivers that clipped onto oldstyle workstation Ethernet connectors. By the time thin-net was introduced, Ethernet was gaining popularity, and many systems internalized transceivers by putting a BNC T-connector on the back of their machines. Thin-net networks, also known as 10Base-2 networks, operated at a maximum transmission speed of a whopping 10 Mbps. Thin-net cables are unwieldy to stuff through conduits or cabletrays, so the next revolution in Ethernet cabling was the 10Base-T network. It featured twisted pair wires within a shielded network cable called CAT-5 cable (for Category 5, which describes the level of protection from interference). Systems connect to 10Base-T
File Sharing
Chapter 12
networks using RJ-45 (registered jack #45) connectors. These crimp-on plastic connectors look similar to the RJ-11 (registered jack #11) jacks used for telephones. As 10Base-T network cabling grew more popular, and more systems provided 10Base-T connections with internal transceivers, hubs also became popular. A hub is a small box to which the RJ-45 Ethernet connections from multiple computer systems directly connect. Inside the hub, a short Ethernet segment connects the systems. Hubs usually feature 4, 8, 12, or 16 network ports. Multiple hubs can be connected using 10Base-2 or 10Base-T connections. If 10Base-T connections are used, the port that links two hubs or connects a hub to a primary Ethernet network is called an uplink port. Although 10Base-T cabling is easier to work with than 10Base-2 cabling, 10Base-T networks operated at a measly 10 MBPS. The next generation of Ethernet networks, and the one most commonly used today, is the 100Base-T network, which looks exactly like a 10Base-T network but boasts a maximum speed of 100 Mbps. Today, businesses and upscale homes use 1 GB (gigabit, or 1,000 megabits Ethernet) networks. These are sometimes called 1000Base-T networks to match the 10/100Base-T nomenclature. The standard Ethernet ports on most home computer systems are still 10/100Base-T ports, meaning that they work on a 10Base-T or 100Base-T network. The network ports on iBooks, PowerBooks, G3s, and most G4 Macintosh systems are 10/100Base-T ports, although 10/100/1000Base-T ports are available for top-of-the-line G4 systems. Various technologies have emerged to optimize network connections. The most common is switching technology, known simply as switches. Ethernet network connections are essentially point-to-point, meaning that each connection links a single computer to a single networked resource. Network traffic from one computer to another typically goes out over the entire Ethernet, which wastes resources. However, with switching technology, once a connection is made between two systems, the switch maintains knowledge about that connection, and requests are routed directly between those two. This maximizes the network bandwidth available to other users who are listening to MP3s, playing networked games such as
Quake, or downloading large graphic files. Switches look like hubs, but they cost more because of their additional smarts. With the growing popularity of laptops, PDAs (personal digital assistants), such as Sharp Zaurus, Palm Pilot, Handspring Visor, and other portable computing devices, a networking problem arose: How portable is a machine that needs to connect to a network using a physical cable? Today’s truly connected mobile warrior
321
322
Part III
Networks and Internet
needs constant connectivity—hence the growing popularity of wireless networks, where your system contains a network card that communicates with a network base station using radio or IR (infrared range) optical signals. Wireless networks are the wave of the future because they largely eliminate connectivity problems, maximize connectivity, make it simple to move desks and people without worrying about where their network ports are located, and do away with the rat’s nest of cables that plague most networks. For these reasons, wireless networking is the default networking solution for business travelers in hotels all over the world. Wireless networking is still being developed and will continue to improve. Many network device manufacturers use their own wireless networking protocols, though these are quickly becoming standardized due to high demand for interoperability. The most popular wireless networking protocols now are 802.11a and 802.11b, which are official IEEE (Institute of Electronic and Electrical Engineers) standards. These differ largely in communication speed and the maximum distance between the wireless network card and the base station (802.11b is slower, but supports communication over larger distances). Security is a real concern because wireless networks are inherently open. With physical networking, you can control who has access by limiting physical access to your building and by using firewalls and gateways to manage access from other networks. Because wireless networks don’t require a physical connection, drive-by hacking of an insecure wireless network is a very real possibility. AirPort is Apple’s 802.11b wireless networking scheme for G3 and G4 systems. AirPort provides extremely high (128-bit) security and is certified to interoperate with a tremendous variety of 802.11b devices.
Protocols and Cabling—What’s the Difference? Up to this point, you’ve focused on networks’ physical cabling. But networking protocol—the way information is communicated over those networks—is as significant as the type of connection. Wires (or wireless networks) provide the transport mechanisms, but the construction, organization, and sequencing of the information communicated over networks is the true requirement for interoperability. Connecting multiple computer networks is much like connecting multiple telephone networks—you can call someone in China quite easily, but if they don’t speak English, and you don’t speak Chinese, there isn’t much point in being connected. Networking protocols are the languages that different computer systems use to speak to each other and exchange information.
File Sharing
Chapter 12
The roots of all modern personal computer and workstation networking lie in the networking protocols invented by Xerox Corporation at its Palo Alto Research Center (Xerox PARC), where Ethernet itself was invented. The original networking protocols used over Ethernet at Xerox PARC were the XNS (Xerox Network System) protocols. Later protocols used by Novell NetWare to provide preMicrosoft networking on PCs, such as the IPX (Internetwork Packet Exchange), SPX (Sequenced Packet eXchange), and NCP (NetWare Core Protocol), were based on earlier XNS protocols. As Microsoft slowly crushed Novell, its NetBIOS (Network Basic Input/Output System) NetBEUI (Network Basic Extended User Interface), and SMB (Server Message Block) protocols became popular. SMB is now known as CIFS (Common Internet File Sharing Protocol). CIFS is Microsoft’s attempt to convince everybody that SMB is a standard because it now has the words command and Internet in its name. Apple has its own set of network communication protocols, called AppleTalk. The emergence of the Internet as the one true network has established its communication protocol, TCP/IP (Transmission Control Protocol/Internet Protocol) as the winner of the network protocol wars. All other protocols have either faded away or been adapted to work over TCP/IP, often through a technique called encapsulation, in which packets of a particular proprietary type are placed inside TCP/IP packets before being sent from one host to another. The recipient then unpacks the packet and handles it in its traditional way.
What about AppleTalk? AppleTalk network communication protocol was originally developed for Apple’s LocalTalk networks. Older Macintosh systems that have only LocalTalk connectors must communicate using AppleTalk because that is the only supported protocol on a LocalTalk cable. This isn’t a problem with Macintoshes running Mac OS X, because these systems communicate over Ethernet through standard RJ-45 network connectors that easily connect to standard 10/100/1000Base-T networks. Macintosh systems connected to an Ethernet use AppleTalk over TCP/IP, which is handy because it’s the connection standard for most Unix machines and the Internet. Macintosh systems connected to an Ethernet network still use AppleTalk protocol to communicate with printers, or when communicating with an Apple file sharing server using AFP (Apple File Protocol).
323
324
Part III
Networks and Internet
Background: Peer-to-Peer and Client/Server File Sharing Just as networks and communication protocols have their own languages, so do the different ways of sharing files between computer systems. For the most part, these semantic differences reflect how different types of computer systems are intended to be used. The most common way of sharing files over a network today is known as “client/server” computing. Client systems access and manipulate data that is physically stored on server systems. Client systems are typically desktop computers loaded with end-user software. File servers are usually specifically designed for managing large amounts of data and delivering it quickly. Client systems focus on good display and the mouse and keyboard. Server systems require large amounts of disk storage, fast disk drives, and fast network connections, and are usually equipped with tape drives, writable CD drives, and other devices for operational tasks, such as backups. Some file servers, such as the Novell networks used in PC environments, store data on disk differently than client systems do in order to manage, access, and deliver it more quickly. Client/server computing provides significant operational advantages in many computing environments, because file servers can be stored in secure areas and have provisions for backing up and restoring files. Client/server computing divides computer systems in two classes, and assumes that client computer systems can be quickly and easily replaced because the majority of the data that they access is stored on file servers. Peer-to-peer file sharing takes a slightly different (but not incompatible) approach. It is a way of sharing files between computers without making one of them a file server. Simply put, peer-to-peer file sharing is the ability to make files, folders, and directories available from any computer on the network to any other computer on the network, without requiring special software, voodoo, or rocket science. Mac OS users have been able to share volumes and folders with their peers over the network for years. Microsoft Windows shared directories contributed heavily to the demise of other Windows networking technologies, such as Novell’s NetWare and Artisoft’s LANtastic. OS X’s peer-to-peer file sharing is amazing, and it supports higher levels of off-the-shelf connectivity than any other operating system.
File Sharing
Chapter 12
Connecting to Networked File Servers The combination of the Unix underpinnings of Mac OS X and Apple’s existing experience with networking protocols, such as AppleTalk make OS X one of the most connected operating systems around. Your out-of-the-box Mac OS X system can access files shared from other Macintosh systems and fileservers using AppleTalk, files shared from a Microsoft Windows system via SMB or CIFS, and files shared from Linux and Unix systems via NFS or AppleTalk. This level of connectivity requires significant configuration, compilation, and operational gymnastics on any other kind of computer system. Mac OS X provides built-in support for the following protocols, each of which is explained in more detail in the upcoming sections: ◆ AFP: The Apple File Protocol used by Apple file servers ◆ CIFS: Microsoft’s Common Internet File System Protocol ◆ NFS: The Network File System protocol used on all Unix and Linux systems ◆ SMB: Microsoft’s Server Message Block format, the old name for CIFS ◆ WebDAV: The Web Distributed Authoring and Versioning protocol used by many modern Web servers Regardless of the type of volume or the protocol that you are using to access it, the Finder’s Connect to Server dialog box lets you enter the name of the remote volume as a URL, beginning with the protocol and followed by the name of the remote host that exports the volume or directory that you want to mount and the name of the directory itself. You can configure your OS X system to automatically display network directories as desktop icons (using System Preferences, Finder Preferences), or you can explicitly access mounted drives by traversing the OS X filesystem beginning with the /Volumes directory, where OS X stores the entry points for all local and networked devices. The next few sections explain how to use commands that are built-in to the Mac OS X Finder to connect to various types of file servers. Thanks to OS X’s power and flexibility, it really doesn’t matter what type of computer system your coworkers use. You can quickly, easily, and transparently connect to almost any modern, popular computer system.
325
326
Part III
Networks and Internet
Connecting to Unix Servers Most Unix and Linux systems export volumes over the network using the NFS (Network File System) protocol originally developed by Sun Microsystems. The specification for NFS was made publicly available in the early 1980s, which resulted in every Unix workstation manufacturer providing an NFS implementation. This quickly made NFS the de facto standard for networked filesharing on Unix systems, though more modern and powerful Unix filesharing systems, such as OpenAFS (also available for Mac OS X) are also freely available nowadays.
TIP OpenAFS is a powerful, sophisticated client/server network filesystem that is freely available for Mac OS X, Unix, Linux, FreeBSD, NetBSD, Microsoft Windows, and many other operating systems. For more information about obtaining and using OpenAFS for Mac OS X, see http://www.openafs.org.
NFS clients and servers communicate using RPCs (Remote Procedure Calls), an extremely clever way of executing commands and exchanging resulting data between systems whose architectures, byte order, and other technical details may not be the same. RPCs use a technique called marshalling, which means packaging up all the arguments to the RPC on the client into a system-independent format. The downside of using RPCs to transfer data is that the RPC subsystem must be able to look up the network address of each system involved in the transaction via DNS (the Domain Name Service) or a file (/etc/hosts) that lists the IP addresses and corresponding names of all hosts that it knows about. If your OS X system gets its IP address via DHCP (that is, dynamically from your ISP), NFS may not work for you unless DHCP is fully integrated into DNS on your system.
NOTE OS X uses NFS version 3. The NFS servers that export the volumes that you want must also support this version of the NFS protocol, or you will be unable to mount NFS volumes on your OS X system.
File Sharing
Chapter 12
The following task explains how to use the Finder’s Connect to Server command to connect to a directory exported by NFS running on a remote computer system.
Task: Mounting an NFS Volume 1. In the Finder, select Connect to Server command from the Go menu. The Connect to Server dialog box shown in Figure 12.2 displays.
Figure 12.2 The Finder’s Connect to Server dialog box.
2. Position the cursor in the Address field of the Go to Server dialog box, and enter the URL of the NFS volume that you want to mount. This should be of the form nfs://hostname/volume. For example, to mount an NFS directory named /opt that is exported from the host distfs. vonhagen.org, you would enter nfs://distfs.vonhagen.org/opt. 3. Click Connect. The Go to Server dialog box closes, and an icon for the NFS volume appears on your desktop. Mounting an NFS volume using the Finder is quite simple, but this method poses one additional problem for users who want to write data to NFS-mounted volumes. NFS uses a networked authentication mechanism called NIS (Network Information Service) that is not actively supported for Mac OS X systems. Mac OS X uses the NetInfo network authentication mechanism that was originally pioneered by NeXT Computer, Inc. NetInfo is discussed in Chapter 13. If you
327
328
Part III
Networks and Internet
want to read and write to network-mounted volumes, you should mount those volumes using the SMB or AFP protocols, as explained in the next two sections.
TIP If you absolutely must write to NFS volumes mounted on a Mac OS X, see http://www.bresink.de/osx/nis.html for more information. The information on this site is detailed and accurate, but Apple doesn’t support using NIS as Mac OS X’s underlying authentication mechanism, and doing so may result in your rendering your Mac OS X system unusable, requiring complete reinstallation.
Connecting to Windows Servers Connecting to a folder or drive exported by a Windows system (known as a Windows share) is very similar to mounting an NFS volume on your OS X system, as described in the previous section. The Mac OS X support for SMB/CIFS volumes is integrated with OS X authentication because you must supply your authentication credentials when mounting a remote Windows share on your OS X desktop.
NOTE If the Windows account you authenticate as doesn’t have sufficient privileges to access the folder, OS X will still display an icon for it, but the contents of the folder will not be displayed—it will appear to be empty.
The following task explains how to mount a Windows share on your OS X desktop so you can read from and write to that volume.
Task: Mounting a Windows Share Under OS X 1. In the Finder, select the Go menu’s Connect to Server command. The Connect to Server dialog box shown in Figure 12.2 displays. 2. Position the cursor in the Address field of the Go to Server dialog box and enter the URL of the Windows shared directory that you want to mount. This should be of the form smb://hostname/share. For example,
File Sharing
Chapter 12
to mount a shared Windows directory named wvh that is exported from the host distfs.vonhagen.org, you would enter smb://distfs/wvh. The SMB/CIFS Authentication dialog box shown in Figure 12.3 appears.
Figure 12.3 The SMB/CIFS authentication dialog box.
3. Enter the name of the Windows workgroup or domain to which the specified host belongs, and press Tab to move to the Username field. 4. If your Windows username differs from your OS X login, erase the current contents of the Username field, enter your Windows username, and press Tab to move to the Password field. If your Windows username is the same as your OS X login, press Tab to move the cursor to the Password field. 5. Enter your Windows password and click OK. The Go to Server dialog box closes, and an icon for the Windows shared directory appears on your desktop.
Connecting to AppleShare Servers AppleTalk was the original file sharing protocol for Macintosh systems, and it still works under OS X. However, AppleTalk file sharing is limited to sharing files on the same network, which isn’t flexible, powerful, or secure enough for file sharing over WANs such as the Internet. Apple developed the Apple File Protocol (AFP) as a fast, modern file-sharing protocol. You can run AFP over AppleTalk, the AppleTalk Datagram Delivery Protocol (DDP), or over TCP/IP. AFP over TCP/IP is faster than AFP over AppleTalk.
329
330
Part III
Networks and Internet
The AFP file sharing services implemented on Macintosh systems are known as AppleShare. AFP removes many of the limitations of older AppleTalk file servers, such as restrictions on volume size, type, and so on. AFP also includes robust support for user authentication and an access control mechanism that lets you control access to servers, filesystems, and even directories. The following task explains how to mount a Macintosh volume on your OS X desktop so that you can read from and write to that volume. This task explains accessing both AppleTalk and AFP-over-IP servers—the former will only be listed if you’ve activated AppleTalk in your Network Preferences.
Task: Mounting a Networked Macintosh Volume Under OS X 1. In the Finder, select the Go menu’s Connect to Server command. The Connect to Server dialog box shown in Figure 12.2 displays. 2. Click AppleTalk in the left portion of the Connect to Server dialog box to browse the local AppleTalk network. (You can view only AFS over IP servers by searching the Local Network rather than the AppleTalk section of this dialog.) A list of the AppleTalk systems that are available on your network displays, as shown in Figure 12.4. 3. Select the name of the system that exports the volume that you want to mount in the right panel of the Connect to Server dialog box, and click Connect. The Connect to Server dialog box closes, and an authentication dialog box displays, as shown in Figure 12.5.
Figure 12.4 The Connect to Server dialog box, showing AppleTalk systems.
File Sharing
Chapter 12
Figure 12.5 The Remote Server Authentication dialog box.
4. To mount one or more volumes from the remote server if you are a registered user on the remote system, enter your username in the Username field, and your password in the Password field. If you are not a registered user on the remote system, click the Guest radio button. This button may not be active (may be grayed out) if the file sharing on the remote system does not support unauthenticated access.
NOTE If you are accessing a remote Mac OS X system as a guest user, only the home directories of users on your system are listed in the AFP Volume Selection dialog. Selecting any of these user names mounts the Public folder in that user’s home directory. You can access other directories on the remote system only if you authenticate as a registered user with administrative privileges on that system. If you are a registered user, you can view authentication preferences for the connection by clicking Options. The dialog box shown in Figure 12.6 appears. This dialog box enables you to control whether the password for the remote system will be added to your keychain (which will bypass the authentication dialog the next time you connect to that server), control whether the password is visible in the packets you send over the network or encrypted, and lets you change your password on the local system. Once you have made any changes to your preferences, or to simply close this dialog box, click OK.
5. Click OK in the Remote Server Authentication dialog box. The Go to Server dialog box closes, and a new dialog box lists the volumes being exported from the selected server, as shown in Figure 12.7.
331
332
Part III
Networks and Internet
Figure 12.6 The Password Options Dialog
Figure 12.7 The AFP Volume Selection Dialog
6. Select the names of one or more volumes that you want to mount. Select multiple volumes by holding down the Command key when selecting. Click OK. An icon for each shared volume that you selected appears on your desktop.
Connecting to WebDAV Servers Mac OS X also provides built-in support for mounting and accessing WebDAV volumes. WebDAV stands for “Web Distributed Authoring and Versioning,” and is a set of extensions to the HTTP protocol that enables collaborative access to files and directories that a Web server exports. WebDAV’s goal is to make it easy for people to work on files in a distributed environment without having to rely on
File Sharing
Chapter 12
a specific set of file-sharing protocols such as AppleTalk, SMB/CIFS, or NFS. Because the WebDAV protocol is supported by Web servers rather than operating systems, WebDAV allows filesharing at the application or server level, rather than the operating system level.
NOTE Apple’s own iDisk free network service for iTools members uses WebDav. IDisk is explained in more detail in Chapter 15.
WebDAV can be viewed as a distributed Web authoring solution, the foundations of a Web CMS (Content Management System), a network filesystem that happens to run over HTTP, and just about anything else. Mac OS X provides built-in support for WebDAV, just as it does for AppleTalk, NFS, and SMB/CIFS.
NOTE The administrator of the remote server controls WebDAV authentication, just like he does all distributed file-sharing mechanisms. You must make sure that the WebDAV server is properly configured for you to be able to log in, read files, write files, and so on. You cannot control this from Mac OS X (unless you are a system administrator and have activated and configured the WebDAV portion of the Apache Web server on your Mac OS X system).
The following task explains how to mount a WebDAV volume on your OS X desktop so that you can read from and write to that volume.
Task: Mounting a WebDAV Directory Under OS X 1. In the Finder, select the Go menu’s Connect to Server command. The Connect to Server dialog box shown in Figure 12.2 displays. 2. Position the cursor in the Address field of the Go to Server dialog box and enter the URL of the WebDAV directory that you want to mount. This should be in the form http://server-name/directory. For example, to mount a WebDAV directory named /dav/wvh that is exported from a Web server running on the host distfs.vonhagen.org, you would enter http://distfs.vonhagen.org/dav/wvh. The WebDAV Authentication dialog box shown in Figure 12.8 appears.
333
334
Part III
Networks and Internet
Figure 12.8 The WebDAV authentication dialog box.
3. Enter your username on the WebDAV server, and press Tab to move to the Password field. 4. Enter your WebDAV password and click OK. The Go to Server dialog box closes, and an icon for the WebDAV shared directory appears on your desktop.
Unmounting Shared Volumes and Directories As previously explained, the mechanisms for connecting to different types of file servers differ depending on the file sharing protocol being used and the type of authentication that a remote system requires. A handy reference text such as this one saves you from having to remember the nuances of each type of system. After remote volumes are successfully mounted on your Mac OS X system, they are displayed and accessed identically thanks to the Mac OS X Aqua interface (unless you have disabled this in the Finder Preferences dialog, which I do not suggest). This consistency is most obvious in the mechanism used to disconnect from shared volumes once you’ve finished accessing their contents. The following task explains how to disconnect a shared volume from your Mac OS X system, regardless of the protocol used to connect to it.
Task: Unmounting Shared Volumes and Directories 1. In the Finder, select the icon for the shared directory or volume that you want to disconnect from. The Trash Can icon in the Dock changes into an up-arrow icon.
File Sharing
Chapter 12
2. Holding down the mouse button, drag that icon onto the Trash Can icon in the Dock. The word “Disconnect” displays once you position the icon for the shared volume over the new Trash Can icon. 3. Release the mouse button. The shared directory is unmounted, and its icon disappears from your desktop.
TIP A convenient short cut for unmounting network volume is to hold down the control key while clicking on the icon for the networked volume or directory. This displays a popup contextual menu from which you can select the Eject command to unmount the disk. If you are using a multi-button mouse, you can simply right-click on the icon to display this contextual menu.
Sharing Files, Folders, and Volumes Mac OS X provides out-of-the-box support for all of the popular file-sharing protocols that I’m aware of, including cutting-edge and system-independent protocols such as WebDAV, without requiring third-party software packages. It’s all well and good to be able to access shared directories and volumes that other people have made available on the network, but the real fun is being able to quickly and easily export volumes and directories from your own OS X system. This section provides background information on basic file sharing concepts; explains different aspects of sharing applications, data, directories, and volumes; and then explains how to control file sharing on Mac OS X systems.
Sharing Data versus Sharing Documents Sharing files once meant physically giving people their own copies of the files. This works for exchanging read-only data and letting others review things at their leisure, but it is hardly suitable for collaborative projects where you expect multiple people to modify the same file and you need to be able to coherently merge all of their changes. Mac OS X offers two ways of sharing your system’s data over the network: File Sharing and Web Sharing. These differ in the type of access that they give remote users, and also in the location of the shared files:
335
336
Part III
Networks and Internet ◆ File Sharing enables users who can authenticate on your system to have read/write access to any of your system’s shared resources. By default, every user’s home directory contains a folder named Public whose contents are always shared when file sharing is enabled. ◆ Web Sharing enables users to have read access to HTML files in the Sites directory in each user’s home directory.
You must have administrative privileges to enable or disable File and Web Sharing on your Mac OS X system. The next section explains how to enable File Sharing and discusses related administrative issues. For more information on sharing files over the Web from your Mac OS X system, see “Setting Up Personal Web Sharing” in Chapter 15.
Activating File Sharing Sharing information via the Web is the most common way to give people read access to information without requiring any special configuration at their end. The true power of file sharing under Mac OS X lies in how easily you can give remote users access to files. You don’t have to enable access for specific users, set permissions, or do any of the things that make file sharing complex on other platforms. The “Connecting to AppleShare Servers” section earlier in this chapter explained that you can connect to Macintosh file servers in two ways—either as a guest or as a registered user. To connect to a Mac OS X server as a registered user, you must have an account either on that machine, or in a NetInfo domain that is a parent of that machine’s NetInfo domain. (For more information about NetInfo, the Mac OS X distributed authentication and administration environment, see Chapter 13.) Activating File Sharing as discussed in this section is an alternative—it allows anyone to access the Public folder in the home directory of any user on your machine without requiring an account on the machine. In addition to simply being able to view and copy files in your login directory’s Public folder, OS X guest file sharing lets remote users give you copies of files by dragging and dropping them into the Drop Box folder in your Public folder. No one but you (or an administrative user on your machine) can see the files in your Drop Box, so this is a convenient way to give files to other people without making them accessible to other users of your public folder.
File Sharing
Chapter 12
NOTE Like Web Sharing, activating File Sharing on your system activates File Sharing for all users on your OS X system.
The following task explains how to activate File Sharing on your OS X system.
Task: Activating File Sharing 1. Click the System Preferences icon from the Dock or your Application folder. The System Preferences application displays, as shown in Figure 12.9.
Figure 12.9 The System Preferences application.
2. Click the Sharing icon, located in the Internet & Network section. The Sharing Preferences panel displays, as shown in Figure 12.10. 3. If File Sharing is currently inactive, “File Sharing Off ” displays in the File Sharing portion of the File & Web panel. Click the Start button in the File Sharing section to activate file sharing on your system, enable remote users to access files stored in the Public directory of your home
337
338
Part III
Networks and Internet
Figure 12.10 The System Preferences application’s Sharing pane.
directory, and enable remote users to give you copies of files by dragging them into the Drop Box in your Public folder. 4. As File Sharing initializes, the message “File Sharing starting up…” displays. Once File Sharing is completely activated, the message File Sharing On displays in the File Sharing portion of the File & Web dialog.
TIP On Mac OS X systems, you can only share volumes and users’ Public directories by default. This differs from previous versions of the Mac OS, where you could control sharing on any folder on your system. Because Mac OS X is a true multiuser system, it must apply default sharing policies evenly across the entire system. You can use a freeware utility named SharePoints, available from Mark Horn Software (http://homepage.mac.com/mhorn/sharepoints.html) to enable you to share other folders. Activating File and Web Sharing is only necessary if you are actively sharing files using those mechanisms—for that reason, you should only turn them on if you are using them.
File Sharing
Chapter 12
Summary As you’ve seen in this chapter, Mac OS X deserves an award for the “Best Connected” operating system around. Previous versions of the Mac OS required a variety of third-party utilities to even approach the level of networked file sharing that is available out of the box on every Mac OS X system. Mac OS X is a wellconnected, network-aware, multiuser computer system. As a multiuser computer system that supports multiple user accounts and multiple users performing tasks on the system at the same time, Mac OS X requires a greater degree of system administration than previous Mac OS systems. The down side of a more powerful computing system is that it requires a higher degree of sophistication. It’s harder to drive a Ferrari than it is to drive a Volkswagen, but you can have a lot more fun in a Ferrari. Throughout this chapter, I’ve referred to situations in which you need administrative privileges. These privileges let you perform tasks that only users who are truly in the know should be able to do. The next chapter discusses NetInfo, the network-aware, system administration environment that gives you complete control over every aspect of your Mac OS X system.
339
This page intentionally left blank
Chapter 13 Network Administration
342
Part III
Networks and Internet
s stated in the previous chapter, Mac OS X deserves an award for being the “best connected” out-of-the-box operating system. It owes much of its connectability to its Unix underpinnings—and while plenty of Unix-like operating systems exist, they can’t match the traditional expertise in usability and graphical user interface design that Mac OS X offers.
A
However, Mac OS X requires more system administration than previous versions of the Mac OS did. System administration is necessary on any computer system, but as a system’s connectivity increases, well-designed and coherent administration becomes more important. Being on a network makes it easy for you to retrieve resources, but it also allows others to attempt to access your systems— whether or not you want them to. System administration on Mac OS X is as graphically oriented as its other aspects. OS X system administration centers on a unique network-oriented directory service called NetInfo, which provides graphical administration tools that simplify viewing, updating, and managing administrative information on your OS X system. You need to be aware of system administration issues, but this doesn’t mean that your Mac OS X system has mutated into Pandora’s box. This chapter provides “forewarned is forearmed” information to help you decide if and when OS X system administration is a serious concern for you. This chapter introduces NetInfo, explains how to use the administrative tools provided with Mac OS X to explore and manage information in NetInfo, and shows how to configure some of the basic connectivity applications.
Using NetInfo Traditionally, Unix systems have managed user, group, and most other system configuration information in text files with arcane names such as /etc/passwd (the Unix password file), /etc/shadow (where encrypted passwords are actually stored on many Unix systems), /etc/group (a file listing the administrative groups and their members), /etc/printcap (a listing of available printers and their capabilities), and many more. After you crack the secret code, it’s quite convenient to manage administrative information using your favorite text editor. However, this system was designed for networks with relatively few computer systems and users. If administrative information were still based on text files, synchronizing those files across all of the computer systems on your network would quickly become an error-prone administrative nightmare. If you had a network containing 10 OS X
Network Administration
Chapter 13
machines, you wouldn’t want to manually create an account for each new user on all 10 machines, let alone guarantee that the new user’s account information was identical on each machine. You could migrate a master set of password and group files across all machines each night, but suppose that the user changed his password on a computer other than the one on which you stored the master password file? Can you spell “frustration”? This section provides detailed information about NetInfo, the networked administration mechanism used on Mac OS X. The next section explains NetInfo’s basic concepts and organization. The section entitiled “Graphical Tools for NetInfo Administration” explores the NetInfo manager, delves into the relationship between NetInfo and many of the stand-alone administrative utilities provided with every Mac OS X system, and shows an example of using the NetInfo Manager.
How NetInfo Is Organized Networked computer systems with a common user pool, a common set of administrative groups and privileges, and common resources such as printers require a common pool of administrative information. The first networked administration mechanism popular on Unix systems was NIS, the Network Information Service used by computers that typically share filesystems using NFS, the Network File System introduced in Chapter 12. NIS was created because all networked systems that shared files using NFS needed a common set of users, numeric user identifiers, group, and so on. This way, files created on any filesystem would be owned by the proper user, regardless of which machine they were being accessed from. The centralized, networked administrative mechanism used by OS X systems is NetInfo. Originally written by an Australian company named Xedoc to address some of the limitations of NIS, NetInfo was popularized by NeXT Computer, Inc., which used it as the unifying administrative mechanism for its original workstations and its OpenStep operating system. Apple Computer acquired NeXT Software to serve as Mac OS X’s foundation. Nowadays, these networked mechanisms for consolidating administrative information are called directory services, because they contain various types of information—any information people need to access from multiple systems, not just user, group, and other administrative information. The term directory service also evokes how these services organize information. Like files and directories (folders) on a computer system, directory services organize information hierarchically,
343
344
Part III
Networks and Internet
as shown in Figure 13.1. All the users and groups information specific to an administrative unit is stored under a directory for that unit, which is known as a “domain” in NetInfo terminology. Any NetInfo domain that multiple systems can access is a shared domain. The hierarchical organization of information in a NetInfo domain makes it easy to find information. For example, you know that user information is under “User” in the hierarchy, so you don’t have to search the entire directory structure.
Figure 13.1 How information is organized in NetInfo.
NOTE Mac OS X systems still have simple versions of the /etc/passwd and /etc/group files. These are used only if a Mac OS X system is started in single-user mode (done by holding Å+S when booting, or started automatically after major filesystem problems). The calls used to access user and group information in NetInfo can fall back to using these Unix files if the NetInfo directory is unavailable or damaged.
The hierarchical organization of directory services such as NetInfo naturally lends itself to a hierarchical administrative model within a company. Consider a business with separate accounting, personnel, sales, support, and product development organizations, a shown in Figure 13.2. Each department might have separate resources, such as printers, that only people in that department should be able to access. However, any company system administrator needs to be able to access and recognfigure those resources. In NetInfo, as in most directory services, privileges flow downhill—users with an identity in a higher-level NetInfo domain have that same identity in any subordinate domain. By organizing
Network Administration
Chapter 13
Figure 13.2 A hierarchical set of NetInfo domains.
administrative information about those different departments into a hierarchical set of domains, NetInfo allows some people access to everything, while still making it easy to create and manage domain-specific information. The terms parent domain and child domain reflect the relationships between shared NetInfo domains. For example, in Figure 13.2, the accounting, personnel, sales, support, and product development domains are all child domains of the company domain. Further down the hierarchy, the local NetInfo domains on the machines Luke and Alice are both child domains of the Sales NetInfo domain. When you install Mac OS X, you automatically create a local NetInfo domain that holds all your system’s configuration information: the initial account that you create, any printers that you configure, and so on. This NetInfo domain is local to your machine, and only your OS X system can see the information in it. Once you put your OS X system on a network, you probably will want to configure your system to consult your network’s NetInfo domains.
345
346
Part III
Networks and Internet
When you log in on an OS X system, that system first checks the local NetInfo domain for account information. If the system doesn’t find that information in the local NetInfo domain, NetInfo moves up to any shared NetInfo domain identified as the parent of the current (local) domain. If the login information still isn’t found, NetInfo automatically continues up the hierarchy until it reaches the root domain. This root domain has no parent domain, and it fills the role of the / directory, the root of any Unix filesystem. When you first boot a Mac OS X system, it checks the hierarchy of NetInfo domains and keeps track of the IP addresses of computers containing parent domains of your local machine. This process is called binding, because it establishes the relationship between any relevant NetInfo domains for future reference. Storing information in a directory service provides other advantages beyond centralization. Most significantly, it enables applications to use a single set of function calls to create, access, and store various types of information. On older Unix systems, an application that needed to determine whether a user could access a specified file needed to look up that user’s ID in the /etc/passwd file, the person’s group ID in the /etc/group file, and so on. Because each file was organized differently, specialized knowledge about the file format was required to retrieve the information. In contrast, accessing that same sort of information in a directory service can use the same function call to retrieve a user’s “ID” attribute as to retrieve a group’s “members” attribute.
Graphical Tools for Managing NetInfo The previous section provided a significant amount of background and overview information—perhaps enough to make you worry that working with NetInfo will be some herculaean task that will force you to wear thick glasses, thin ties, and carry a PDA in a holster. That’s not the case at all. While OS X does include command-line utilities for extracting and managing information stored in NetInfo, their use isn’t mandatory. Apple has always provided intuitive, usable interfaces that make it easy to perform sophisticated tasks. Managing information in NetInfo is no exception. Figure 13.3 shows the OS X NetInfo Manager, software provided with every Mac OS X system. NetInfo Manager allows you to quickly and easily manipulate administrative information in NetInfo—if necessary.
Network Administration
Chapter 13
Figure 13.3 The Mac OS X NetInfo Manager, showing user information.
The phrase “if necessary” is key—most people will never have to touch NetInfo, because OS X provides other tools that manipulate NetInfo information for you. A good example is the User pane within the OS X System Preferences application. This pane makes it easy for you to create user accounts with a few mouse clicks—and even though all of this information is stored in NetInfo, the User pane does all the work for you. To show how user information is stored in NetInfo, you’ll first create a new user account on an OS X system. Then you’ll examine and modify the NetInfo information about that user account using the NetInfo Manager.
Task: Creating a New User Account in Mac OS X 1. Click the System Preferences icon in the Dock. The System Preferences application displays its startup dialog box, as shown in Figure 13.4. 2. Double-click the Users item in the system section. The Users pane displays, as shown in Figure 13.5.
347
348
Part III
Networks and Internet
Figure 13.4 The initial System Preferences dialog box.
Figure 13.5 The System Preferences application’s Users pane.
3. If the small lock icon in the lower left corner of the Users pane looks like a closed padlock and the message beside it reads “Click the lock to make changes,” click the lock icon. The dialog box shown in Figure 13.6 displays. Enter the password and, if necessary, the name of a user with administrative privileges on your machine so you can make administrative changes. 4. Click New User. The dialog box shown in Figure 13.7 displays.
Network Administration
Chapter 13
Figure 13.6 The System Preferences authorization dialog box.
Figure 13.7 The New User dialog box.
5. Enter the name of the new user, and a short name for that user. The short name is an alternate name for the user. The short name does not contain spaces, which simplifies some network tasks such as accessing files in that user’s personal Web server. 6. Select a login picture if you want a specific graphic to display on the login panel beside the new user’s name. Use the slider below the row of images to see the images that are available, and click one to select it.
349
350
Part III
Networks and Internet
Figure 13.8 The New User dialog box’s Password panel.
7. Click the Password tab at the top of the New User dialog box to display the Password panel, as shown in Figure 13.8 8. Enter the new user’s password in the Password field, press Tab to move the cursor to the Verify field, and retype the password to ensure that you’ve typed it correctly. The characters that you type are represented by bullets. This security measure prevents anyone looking over your shoulder from seeing the password. Remember that only the first eight characters of your password are actually used by Mac OS X. Press Tab again to move to the Password Hint field. 9. Password hints are optional but convenient. On the System Preferences application’s Login pane, you can configure the OS X Login screen to automatically display a password hint after the user has typed the wrong password three times. The password hint should help the user remember his password, but not allow others to guess the password. 10. If you want the new user to have administrative privileges on your OS X machine, check “Allow user to administer this computer” option. 11. Click Save to create the new account. The New User dialog box closes, and the Users pane displays the new account, as shown in Figure 13.9. 12. Select the System Preferences menu’s Quit System Prefs command (or press Å+Q) to exit System Preferences.
Network Administration
Chapter 13
Figure 13.9 The Users pane, showing the new account.
That’s all there is to creating a user account using System Preferences. Now, you’ll return to the NetInfo Manager and examine the information about that account. In the following task, you’ll also use the NetInfo Manager to correct some of the account information—let’s assume that the new user’s name should have been Alice instead of Elise.
NOTE The rest of the example in this section is slightly artificial. It’s intended to show how many of the utilities provided with OS X manipulate NetInfo information for you without requiring you to become a NetInfo expert. You can create accounts manually in NetInfo, but utilities such as System Preferences’ Users pane do more than just create NetInfo entries—they create the user’s home directory and the other directories that a user expects to find in the home directory. We could more easily correct the new user account’s name using the Edit User button in the System Preferences’ Users pane. However, I wanted to show how to use NetInfo directly in case you ever have to.
Task: Editing User Account Information in the NetInfo Manager 1. Click the Applications icon in the toolbar of a Finder window to display an Applications window, double-click the Utilities folder to open it, and double-click the NetInfo Manager icon to start the NetInfo Manager. The initial NetInfo Manager dialog box displays, as shown in Figure 13.10.
351
352
Part III
Networks and Internet
Figure 13.10 The initial NetInfo Manager dialog box.
2. When you first open the NetInfo Manager, the small lock icon in the lower left corner of the NetInfo Manager dialog box looks like a closed padlock, and the message beside it reads “Click the lock to make changes.” Click the lock icon to enable changes—the dialog box shown in Figure 13.11 displays. Enter the password and, if necessary, the short name of a user with administrative privileges on your machine so you can make changes in NetInfo.
Figure 13.11 The NetInfo Manager’s authentication dialog box.
Network Administration
Chapter 13
3. Scroll down in the center window of the NetInfo Manager’s Directory Browser section, and click the users entry to make your NetInfo Manager dialog box look like the one in Figure 13.12. Note that the information for the new user we just created (elise) is now visible in the /users panel on the right. (Compare this dialog box to the one in Figure 13.3.)
Figure 13.12 The NetInfo Manager, showing user entries.
4. Click the entry that you want to work with. In this case, we’ll click the /users entry for elise, which is the account that we want to modify. The NetInfo Manager dialog box now looks like Figure 13.13. 5. The bottom part of the NetInfo Manager window now displays all of the information stored in NetInfo for the user elise. Though NetInfo is generally organized hierarchically, information about each specific entity in NetInfo (whether it’s a printer, a person, or an administrative group) is stored in its own directory, as a set of property/value pairs. The property describes the type of information in a specific property/value pair, and its value is what NetInfo returns if queried for that property. For example, in the realname property, the value is the user’s real name: Elise Platz in this case.
353
354
Part III
Networks and Internet
Figure 13.13 The NetInfo Manager, showing information for the user
named Elise.
NOTE Our goal is to correct the user’s name, changing it from “Elise Platz” to “Alice Platz.” If this were a real situation, we would modify all of the related user information, such as the short name and home directory’s name, but in this example, we’ll just change the user name.
6. Double-click the value portion of the realname property and change the name to Alice Platz, as shown in Figure 13.14. 7. Select the Domain menu’s Save command (or press Å+S) to save the changes. The dialog box in Figure 13.15 displays, asking you to verify that you want to update NetInfo. This might seem like a pain, but this is your system’s primary administrative information, so you’re better safe than sorry. 8. Select the NetInfo Manager menu’s Quit NetInfo Manager command (or press Å+Q) to exit. If you have made changes to NetInfo and you attempt to exit without saving them, the dialog box in Figure 13.16
Network Administration
Figure 13.14 The NetInfo Manager, showing updated information for the
user “Elise.”
Figure 13.15 The NetInfo Manager’s confirmation dialog box.
Figure 13.16 The NetInfo Manager’s warning dialog box about unsaved
changes.
Chapter 13
355
356
Part III
Networks and Internet
displays. Click Review Unsaved to see the property/value pair(s) that you have modified. A dialog box such as the one shown in Figure 13.17 displays for each one you have modified.
Figure 13.17 A sample warning dialog box for an unsaved but modified
property/value pair.
You may never need to use NetInfo Manager, but like any tool from Apple, it’s easy enough to use if you do need it. However, because NetInfo houses the primary administrative information for your machine (and perhaps others, if you are hosting a sharing NetInfo domain), be careful when using the NetInfo Manager. The Unix underpinnings of Mac OS X provide increased power, functionality, and stability. One easily overlooked aspect of Unix (at least for Mac users) is that much of Unix is command-line based. It isn’t usually necessary to use commandline tools in Mac OS X. However, the command-line is an alternate way to perform many tasks. The next section summarizes the command-line tools in Mac OS X. They can help you access, manage, and manipulate information stored in NetInfo.
Command-Line NetInfo Utilities A significant OS X feature is the ability to enter certain commands from the command-line, just as on DOS systems and Unix workstations. This provides an alternate way of accomplishing many tasks on a Mac OS X system. Mac OS X provides a number of command-line utilities that can access and manipulate information in NetInfo. These commands are as follows: ◆ nicl: NetInfo command line utility ◆ nidomain: NetInfo domain utility ◆ nidump: Extract text or flat-file-format data from NetInfo ◆ nifind: Find a directory in the NetInfo hierarchy
Network Administration
Chapter 13
◆ nigrep: Search for a regular expression in the NetInfo hierarchy ◆ niload: Load text or flat-file-format data into NetInfo ◆ nireport: Print tables from the NetInfo hierarchy ◆ niutil: NetInfo utility Unless you’re the system administrator of a Mac OS X network, you will probably never need to use any of the command-line utilities for accessing and managing NetInfo, but it’s nice to know that Mac OS X includes an application suite for working with NetInfo. For more information on any of these utilities, use the command-line “man” command, which is explained in “Using Unix Utilities” in Chapter 19.
Connecting to Mac OS X over the Network As a true multiuser operating system based on Unix, Mac OS X provides higher levels of connectivity to other networked computers than any previous version. As explained in Chapter 12, “File Sharing,” Mac OS X makes it easy to mount volumes that are shared from other computer systems using a variety of different protocols. Mac OS X also makes it easy for you to share files and folders from your system using AppleShare or over the Web. This section explores a type of connectivity that is new to the Macintosh platform with Mac OS X—being able to log on to your Mac OS X system over the network. This type of access works at a totally different level than logging in on the console of your Mac OS X system. Using the monitor and keyboard that are directly connected to your Mac OS X system enables you to take advantage of the full power of the Mac OS X Aqua interface, because your Mac knows how to maximize access to the graphical capabilities of your hardware. When logging in on your Mac OS X system over the network, you can only log in and access your Mac OS X system through the standard command-line interface. You can therefore access your files from any other computer using your Mac OS X login and password. While not as elegant as using the Mac GUI, this type of networked access to your Mac provides a number of new opportunities, such as the ability to access your files and directories and work with them using the built-in command-line utilities. The section of Chapter 19 entitled “Using Unix Utilities” explains how to work with the Unix command line and introduces many of the Unix utilities that are
357
358
Part III
Networks and Internet
included with Mac OS X. The following two sections explain how to activate two basic types of networked access to your OS X system and explores the advantages of each.
Activating and Using SSH In today’s network-oriented computing universe, security is a primary concern. The most popular, secure method of logging in to Unix systems over a network is SSH, the Secure Shell. As explained in more detail in Chapter 19, the commandline interface provided on Unix systems is called the shell, a generic term for a number of different command-line interpreters and interfaces. When connecting to Unix systems over the network, older applications (such as telnet, discussed in the next section) do not encrypt data, including your password. On Mac OS X systems, SSH provides a variety of encryption levels and uses reasonable defaults. Like any network-oriented mechanism, SSH consists of two parts—the SSH server (a daemon in Unix terms), which is a process that must be started on every machine that you can connect to over the network via SSH, and the SSH client application, which is the command you execute to log in on a remote machine. The following task explains how to activate the SSH server on your Mac OS X system so that you can log in on your OS X system over the network.
Task: Activating SSH on Your Mac OS X System 1. Click the System Preferences icon from the Dock or your Applications folder. The System Preferences application displays, as shown in Figure 13.18. 2. Click the Sharing icon, located in the Internet & Network section. The Sharing Preferences panel displays, as shown in Figure 13.19. 3. Click the Application tab to display the settings for remote access to your system. The Application Sharing dialog box displays, as shown in Figure 13.20. 4. Click the “Allow remote login” checkbox. Your system displays the colored busy wheel icon as it activates the SSH server. 5. Select the System Preferences menu’s Quit System Preferences command or use the Command-Q hot key combination to exit the System Preferences application.
Network Administration
Figure 13.18 The main System Preferences panel
Figure 13.19 The Sharing Preferences Panel
Chapter 13
359
360
Part III
Networks and Internet
Figure 13.20 The Sharing Preferences panel’s application dialog box.
The following task explains how to connect to your system from any other system that supports SSH.
Task: Connecting to Your Mac OS X System Using SSH 1. Start or select a shell window on the system from which you want to connect to your Mac OS X system. On Mac OS X systems, start a shell using the Mac OS X Terminal application by selecting its icon from the Utilities folder, located in your Applications folder. 2. Type the command “ssh account@system-name”; account is the short name of the account that you want to log in as, and system-name is the name or IP address of your Mac OS X system. 3. If this is the first time that you have connected to that system using ssh from the machine that you are using, a message such as the following displays:
Network Administration
Chapter 13
The authenticity of host 'lime.vonhagen.org (192.168.6.247)' can't be established. RSA key fingerprint is a1:4e:61:08:f0:95:98:72:e8:85:ae:c5:c6:41:58:d2. Are you sure you want to continue connecting (yes/no)?
4. Type “yes” and press Return to add an entry for the system that you are connecting to in the file .ssh/known_hosts in your home directory.
NOTE The file ~/.ssh/known_hosts contains an encrypted key entry for each system you have connected to using SSH. It’s a security measure to verify the identity of each host. If you try to connect to a remote host and its identity differs from the key information recorded in the .ssh/known_hosts file, your system will refuse to connect unless you manually correct its entry in the .ssh/known_hosts file. This prevents machines from masquerading as other machines.
5. The SSH command prompts you for your password on the remote system. Enter the Mac OS X password for the account that you are logging in as, and press Return. 6. The SSH command establishes a secure connection to the remote system and displays your shell prompt on that system. Once you have connected to a Mac OS X system using the SSH command, you can execute any OS X command-line utility on that system. When you have finished accessing the remote Mac OS X system, type the “exit” command and press Return. This terminates the remote shell and returns you to the system you connected from.
Setting Up and Using Telnet Telnet (Network Virtual Terminal Protocol) is an old, established protocol supported by almost all modern computer systems. The Telnet command is much like the SSH command, but lacks the security of the latter. So why use it? Simply because SSH may not be available on every remote computer system from which you wish to connect to your OS X system. Like SSH, there are two parts to the Telnet application—the Telnet server (a “daemon” in Unix terms), which is a process that must be started on every
361
362
Part III
Networks and Internet
machine that you can connect to over the network via the Telnet protocol, and the telnet client application, which is the program you execute to log in on a remote machine using the Telnet protocol. The following task explains how to activate the telnet daemon on your Mac OS X system so that you can log in on your OS X system over the network using the Telnet protocol. Because Telnet is a less secure protocol than SSH, Mac OS X does not provide a graphical user interface for activating the telnet daemon. However, you can activate the telnet daemon on your OS X from a terminal window, as explained in the following task.
Task: Activating Telnet on Your Mac OS X System 1. Start the Mac OS X Terminal application by selecting its icon from the Utilities folder, located in your Applications folder. 2. Type the command “sudo vi /etc/inetd.conf ” and press Return. The system prompts you for an administrative password on your machine, which is typically the password you set when creating the first administrative user as part of the Mac OS X installation process. 3. Enter this password and press Return. The Unix “vi” text editor starts in your terminal window, displaying the contents of the file /etc/inetd.conf, which controls whether some available network services start automatically when you boot. 4. Use the arrow keys to move the cursor to the beginning of the line that starts with “#telnet.” Position the cursor over the hash mark (#) at the beginning of the line and type the letter ‘x’ to delete that character. 5. Type the letters “ZZ” (in upper case) to save your modifications to this file and return to the terminal window prompt. 6. Restart your Mac OS X system by selecting the “Restart” command from the Apple menu. After your machine restarts, the telnet daemon will be enabled automatically whenever anyone uses the telnet command to initiate a networked terminal connection to your OS X system. Establishing a telnet connection to a remote computer system presents you with the same login and password prompts that you would see if you were logging in on a terminal that was physically connected to that system. The following task explains how to connect.
Network Administration
Chapter 13
Task: Connecting to Your Mac OS X System Using Telnet 1. Start or select a shell window on the system from which you want to connect to your Mac OS X system. On Mac OS X systems, start a shell using the Mac OS X Terminal application by selecting its icon from the Utilities folder, located in your Applications folder. 2. Type the command “telnet system-name”, where system-name is the name or IP address of your Mac OS X system. 3. Output such as the following displays in your terminal window, and the telnet application displays the remote system’s login prompt: Trying lime.vonhagen.org... Connected to lime.vonhagen.org. Escape character is '^]'. Darwin/BSD (localhost) (ttyp2) login: wvh
4. Enter your login name (the short name of the account that you want to log in as) and press Return. The remote system prompts you for the password for the account that you are using to log in. 5. Enter your password and press Return. A terminal prompt from the remote Mac OS X system displays. Once you have connected to a Mac OS X system using the telnet command, you can execute any OS X command-line utility on that system. When you have finished accessing the remote Mac OS X system, terminate the telnet connection by typing the “exit” command and pressing Return. This terminates the remote shell and returns you to the system you connected from.
Running the Apache Web Server When you activate Personal Web Sharing as explained in Chapter 15, you are actually activating the Apache Web server on your OS X system—and in traditional Macintosh fashion, “the right thing just happens.” Previous versions of the Mac OS supported personal Web sharing, but at a much more minimal level by using a simple built-in Web server.
363
364
Part III
Networks and Internet
The Apache Web server is the open source movement’s biggest success story, a high-quality Web server that delivers an estimated 60% of the pages and services on the Web. Apache was born when a dedicated set of Web system administrators and wizardly programmers began enhancing free Web server source code through a series of patches. In fact, the name is a takeoff on the phrase “a patchy Web server.” When the patches exceeded the size of the original code, the source code for Apache began being distributed as a standalone entity. The Apache Web server has gone through a tremendous number of rewrites and upgrades, and enhancements are continually being developed. Apache is the most powerful and flexible Web server available, and a copy comes with every Mac OS X system. By using Apache, Mac OS X provides users with an out-of-the-box copy of a fully functional Web server that can even execute programs. It also enables any Mac OS administrator to fine-tune and extend the capabilities of their local Web server by modifying the Apache configuration files. Many excellent (and thick) books describe how to modify and extend Apache. These books are valuable to any Mac OS X system administrator who wants to increase the horsepower of the default Apache configuration provided on Mac OS systems. It would be pointless to duplicate this information here. Instead, the remainder of this section focuses on providing an overview of the files and directories used by the Apache Web server, including its main configuration file, the source for information about the capabilities and configuration of Apache on your OS X system. For detailed information about Apache (and an online reference manual), see the Apache Web site at http://www.apache.org. The files and directories that are used by the Apache Web server fall into four main categories: ◆ Configuration files that provide the information that Apache uses when it starts. ◆ Log files where Apache keeps track of access to the Apache server, errors encountered during that access, and so on. ◆ The base directory from which server-wide Web pages and applications are made available. ◆ Each user’s personal Sites folder that provides a basic Web site for every user with an account and home directory on an OS X system. These types of files are discussed in the next few sections.
Network Administration
Chapter 13
NOTE On standard Unix systems, most system configuration files are located in the /etc directory. Similarly, most system files used by applications or by the system itself, such as log files, are located in subdirectories of the /var directory. On Mac OS X systems, these directories appear to exist, but they are actually symbolic links to directories by those names in the Mac OS X /private directory. Symbolic links are simply files that point at other files or directories. The use of symbolic links and the nonstandard (in Unix terms) directory organization is due to the support for diskless workstations that was originally present in the NeXTStep operating system. These conventions have been carried forward into Mac OS X and are used by the Mac OS X server’s NetBoot mechanism. Throughout the remainder of this chapter, I refer to files and directories using the names of any symbolic links in their filenames, rather than the specific location to which those symbolic links resolve. The symbolic links could be modified to point to any location, but the starting points of the path names that programs use to locate their default configuration files (i.e., the names of the symbolic links) can not, without requiring that you recompile the application.
Apache Configuration Files On Mac OS X systems, the Apache configuration files are located in the directory /etc/httpd. The primary Apache configuration files in this directory are the following: ◆ /etc/httpd/httpd.conf: This file is Apache’s primary configuration file, controlling all aspects of Apache initialization and configuration. This file also contains statements that include platform-specific configuration files such as httpd_macosxserver.conf and mime_macosxserver.types. You can freely modify the contents of this file, but always create a backup copy before making any changes. This file is directly modified by some of the administrative tools provided with the Mac OS X and the Mac OS X Server. ◆ /private/etc/httpd/httpd_macosxserver.conf: This file contains Mac OS X-specific configuration information. The contents of this file are automatically manipulated by the Mac OS X Server Admin tool and other Apache configuration applications such as Webmin, which should rarely be edited manually. This file is explicitly included by the /etc/httpd/httpd.conf file. ◆ /private/etc/httpd/mime_macosxserver.types: This file contains Mac OS X-specific configuration information about the MIME
365
366
Part III
Networks and Internet
(Multi-Media Internet Mail Extensions) types that are supported by Apache under Mac OS X and the applications that should be used to open files of these types that are read or downloaded over the Web. The contents of this file are automatically manipulated by the Mac OS X Server Admin tool—this file should rarely be edited manually. This file is explicitly included by the /etc/httpd/httpd.conf file. ◆ /etc/httpd/tomcat.conf: This is the configuration file for the Apache application (serlet) that enables the use of Java and Java Server pages with Apache.
Apache Log Files The Apache Web server logs two different types of information: information about each time the Apache Web server is accessed, and information about any errors that occur when trying to access any Web page, graphics file, or other resource requested from that Web server. The format of the log entries in these files, as well as the names and locations of these files, are specified in the main Apache configuration file, /etc/httpd/httpd.conf. On Mac OS X systems, the Apache log files are located in the directory /var/log/httpd. The Apache log files in this directory are the following: ◆ /var/log/httpd/access_log: This file tracks each access to the Apache Web server, and therefore contains an entry for each HTTP request, whether for a Web page, graphic, script, or application. ◆ /var/log/httpd/error_log: This file contains an entry for each error that occurs on your Apache Web server. The majority of these occur when a remote Web browser attempts to retrieve a Web page that does not exist, either because an external URL was incorrect, or because a page that was successfully retrieved contained a reference to a local file that did not exist.
The Apache Server’s “Home Directory” The Apache Web server traditionally organizes the files that it executes and delivers into two directories: one to serve as the root of the Web server itself and the highest directory level from which the Web server can deliver files, and a second that contains programs that the Web server can execute, such as CGI scripts, shell
Network Administration
Chapter 13
scripts, other Perl applications, and so on. Keeping executables in a directory outside the top-level directory prevents malicious users from attempting to retrieve or modify the applications that the Web server uses internally. On Mac OS X systems, the home directory of the Apache Web server is the directory /Library/WebServer. The top level directory from which the Web server can deliver files is the directory /Library/WebServer/Documents. If you request a file from a remote Web server using a URL such as http://server-name/foo.html, a standard Mac OS X Apache Web server will look for that file in the directory /Library/WebServer/Documents. This directory is known as the DocRoot (document Root) in Apache-speak—its location is defined in a directive in the Apache configuration file /etc/httpd/httpd.conf. On Mac OS X systems, the directory that contains executable applications that can be run by the Apache Web server is /Library/WebServer/CGI-Executables. By default, the name of this directory on an Apache Web server is /cgi-bin, relative to the Web server’s home directory (not the DocRoot). On Mac OS X systems, the Apache configuration file /etc/httpd/httpd.conf uses the ScriptAlias command to map the default /cgi-bin directory to the directory /Library/ WebServer/CGI-Executables.
Personal Web Site Folders The Apache Web server can export personal Web sites for any user with an account and a home directory on the system where it is running. This is known as Personal Web Sharing on Mac OS X systems, and is explained in detail in Chapter 15. Once a personal Web site has been created and Personal Web Sharing has been enabled, users can access that Web site by typing a URL in the form http://servername/~username, where servername is the name of the Web server hosting that user’s Web site, and username is that user’s short login name. For example, my real name on my Mac OS X systems is “William von Hagen,” but my short name is “wvh.” Use the short name when attempting to access a user’s Web site because the Apache Web server cannot deal with URLs containing spaces. The tilde (‘~’) character is a Unix and Apache shortcut that refers to the user’s home directory. The directory that serves as the root of each user’s personal Web sites is Sites, located in each user’s home directory. The name of this directory is controlled using the UserDir directory in the Apache configuration file /etc/httpd/httpd.conf.
367
368
Part III
Networks and Internet
Summary This chapter provided an overview of the design and organization of the NetInfo authentication mechanism used on Mac OS X systems, providing examples of how some user-friendly administrative applications provided with Mac OS X manipulate information stored in NetInfo. This chapter also explained how to enable remote access to your OS X system using the SSH and Telnet protocols, and provided an overview of the configuration and other files used by the Apache Web server on OS X. The design and elegance of the Mac OS X utilities and interface enable you to be a system administrator without making you buy a pocket protector. The integration of networking into the Mac OS X operating system is mandatory for enabling things like NetInfo’s networked administration model. More important to most of us is that OS X’s “network readiness” makes it easy for us to send e-mail, create Web sites, and surf the Web in general. The next chapter explains how to use the Mac OS X Mail application, a powerful yet easy-to-use mail client included with every copy of Mac OS X.
Chapter 14 E-mail
370
Part III
Networks and Internet
very successful computer system and technology has a certain capability that makes it popular. Such capabilities are called killer applications, or more commonly, killer apps. For the Macintosh itself, the original killer app was desktop publishing—until the Macintosh, no personal computer system came with things such as a high-resolution display that enables you to do true WYSIWYG (What You See Is What You Get) document creation and previewing, and a mouse to give you the fine-grained control needed to manipulate high-quality, high-resolution images.
E
While the Internet is fun and surfing the Web is a great way to do research, the true killer application is electronic mail, usually abbreviated to e-mail. Everyone uses e-mail to correspond and communicate, and many businesses simply wouldn’t run without it. In most offices, e-mail messages have replaced interoffice memos, and the only time you get a piece of paper is when regulations require it. Applications for processing and managing electronic mail are divided into two general classes: mail servers, which are system applications that handle the actual sending and delivery of e-mail messages, and mail clients, which are the applications that users execute to send, receive, and manage their personal e-mail. Discussing the mail server built into Mac OS X is outside the scope of this book— like any good Macintosh system-level application, all most people really need to know about the Mac OS mail server is that it exists and does the right thing. As you’ll see in this chapter, Mac OS X includes an excellent, free mail client that provides a rich set of features for sending, receiving, and managing e-mail. You may already be familiar with mail clients such as Netscape Communicator, but OS X Mail provides some significant advantages over other free mail clients. Most obviously, OS X Mail is smoothly and completely integrated into Mac OS X. More important for day-to-day use is the fact that OS X Mail is more modern than many mail clients, and therefore provides out-of-the-box support for things such as multiple e-mail accounts. This means that you can use OS X Mail to read and manage both your personal and business e-mail, or even manage multiple personal e-mail accounts.
NOTE Although Apple calls its OS X e-mail application “Mail,” I’ll refer to it throughout this chapter as OS X Mail to differentiate it from the verb mail and other similarly-named applications such as Unix mail, Netscape Mail, and so on.
E-mail
Chapter 14
An e-mail account is different than a Mac OS X user account—each Mac OS X user may wish to send or receive e-mail from multiple e-mail addresses. Either you or your system administrator created your Mac OS X user account when installing Mac OS X, but you can create (and delete) e-mail accounts yourself, at any time. An e-mail account is just a combination of an e-mail user name, a password, and the names of the e-mail servers that the account uses to send and receive e-mail. Most people have e-mail accounts provided by their Internet service providers (ISPs), such as AOL, CompuServe, and so on. Many people also have more generic e-mail accounts at sites such as Yahoo! or Hotmail, as well as email accounts associated with their businesses. OS X Mail makes it easy to use a single application to read and send all of your e-mail, regardless of the e-mail account that you want to use.
Setting Up Mail Whenever you log in on your Mac OS X system, an icon for the OS X Mail application is already located in the Dock (unless you’ve removed it). The OS X Mail icon looks like a postage stamp that shows a picture of an eagle. If this icon is not present, add it to the Dock by opening the Applications folder from the Finder toolbar and dragging the OS X Mail icon to the Dock. Once you’ve located the OS X Mail icon, double-click it to start the OS X Mail application.
Starting OS X Mail for the First Time Like most Macintosh applications, OS X Mail walks you through its configuration steps the first time you execute the program. Its configuration dialog boxes prompt you for all of the information necessary to sucessfully communicate with your mail server and send and retrieve your personal e-mail. Once OS X Mail is configured for your initial e-mail account, you can modify those settings or add additional e-mail accounts at any time, as described later in this section. The following task shows you the dialog boxes used by OS X Mail to create your initial e-mail account. It also explains the settings needed to configure that e-mail account to send and retrieve e-mail from a specific e-mail provider.
371
372
Part III
Networks and Internet
Task: Setting Up Your First E-mail Account in OS X Mail 1. Double-click the OS X Mail icon in the Dock to start OS X Mail. 2. If this is the first time you’ve started OS X Mail, its license agreement displays. Read the license agreement and click Accept to accept the license agreement and close its display window. 3. The Mail Setup dialog box displays, as shown in Figure 14.1. This dialog box displays only when you first start OS X Mail and have not yet created an e-mail account.
Figure 14.1 The initial OS X Mail configuration dialog box.
4. Enter the information requested on this form. The fields on the form require the following information: ◆ Your Name: The full name that you want to appear in the From field of any e-mail that you send. This can be anything, but is usually your actual name. ◆ E-mail Address: The e-mail address that any e-mail you send will appear to be from. This is also the return address of any e-mail you send from this account. ◆ Incoming Mail Server: The name of the computer system that OS X Mail will contact to retrieve your e-mail. ◆ Mail Server Type: The protocol that OS X Mail should use to retrieve your e-mail from the specified computer system. You can
E-mail
Chapter 14
obtain this information from the setup information provided by your Internet Service Provider. If you want to get started immediately, you should probably leave POP selected, because most e-mail servers use this protocol.
NOTE POP (Post Office Protocol) and IMAP (Internet Mail Access Protocol) primarily differ in terms of where your e-mail is actually stored and how much of it is automatically downloaded to your machine when you check your e-mail. POP servers download all of your e-mail to client computer systems, and usually then delete the mail from the server (unless specifically told not to). IMAP servers initially only download the e-mail headers to your computer system, then download the body of your e-mail (and any attachments) when you view the message. POP servers are more common than IMAP servers, especially with Internet Service Providers, because they require less disk space for long-term storage of e-mail messages. IMAP servers are more popular for business e-mail because mail messages are centrally stored and can therefore be backed up. IMAP servers also enable you to access your e-mail from any client computer system, regardless of the one on which you initially checked your e-mail from.
◆ User Account ID: The name of your actual e-mail account on the mail server. This is usually the same as your login or account name on the email server. This is the usually the same as the first part of your e-mail address, up to the ‘@’ symbol. For example, if your e-mail address is [email protected], your account name is “foo”. ◆ Password: The password for your e-mail account. ◆ Outgoing (SMTP) Mail Server: The name of the computer system through which outgoing e-mail is sent. This is typically the same as the name of the Incoming Mail Server, but may differ depending on how your e-mail provider configured its mail server. Some sites use different email servers for incoming and outgoing e-mail to reduce the load on any single computer system or for security reasons. Because they must receive e-mail directly from the Internet, most incoming mail servers must have public e-mail addresses that make them visible on the Internet, while outgoing mail servers may first attempt to deliver mail on a local or internal network before attempting to deliver it over the Internet. Once you have entered this information, click OK to save this information as your initial mail profile.
373
374
Part III
Networks and Internet
5. The OS X Mail application attempts to contact the specified mail servers to check for pending e-mail. If any of the information that you entered is incorrect, OS X Mail displays a warning dialog box such as the one in Figure 14.2, identifying the problem and suggesting which information may be incorrect. If you see a warning or error dialog box, verify that all of the information that you entered is correct. If you still cannot solve the problem, contact the customer support representative at your Internet service provider.
Figure 14.2 A warning dialog box indicating that some of your OS X Mail
configuration information is incorrect.
6. Next, OS X Mail displays the dialog box shown in Figure 14.3, asking if you want to import e-mail that you have already retrieved using another e-mail client. This is necessary only if you were using another application to read and manage your e-mail and now want to use OS X Mail as your primary e-mail client or if you want to use OS X Mail to access your saved and previously received e-mail. If so, click Yes and proceed to the next task in this section, “Importing Existing E-mail into OS X Mail.” If you are only experimenting with OS X Mail or you do not have any old e-mail that you want to import into OS X Mail, click No. Congratulations! You’ve configured OS X Mail!
Figure 14.3 The dialog box that lets you begin importing saved e-mail into
OS X Mail.
E-mail
Chapter 14
Importing Existing E-mail into OS X Mail If you have used e-mail before, you won’t want to lose access to your mail just because you’re moving to a better e-mail client. OS X Mail automatically offers to import saved e-mail from another application as part of its original configuration, but you also can do this at any time by using the File, Import Mailboxes menu command. Let’s see how to import existing e-mail when switching to OS X Mail.
Task: Importing Existing E-mail into OS X Mail 1. If you are configuring OS X Mail for the first time, the configuration process allows you to import existing e-mail from other applications. If you don’t already see the dialog box shown in Figure 14.4, display it by selecting the File, Import Mailboxes menu command.
Figure 14.4 Selecting the name of your old e-mail application.
2. Select the e-mail application that you previously used, and click the right-arrow button to continue. Depending on which old e-mail client you selected, a dialog such as the one shown in Figure 14.5 displays. (Figure 14.5 shows the dialog box that displays if you selected Netscape as the name of your previous e-mail application. In the case of Netscape, OS X Mail uses your Netscape profile file—Netscape’s Configuration File—to determine where your mail is stored and the names of the mailboxes you are using.)
375
376
Part III
Networks and Internet
Figure 14.5 Selecting the location of your old Netscape e-mail.
TIP OS X Mail asks for the name of your previous e-mail client because different e-mail applications store e-mail in different formats. OS X Mail uses this information to determine how to attempt to open and process your old e-mail. If the name of your previous e-mail application isn’t listed on this dialog, try selecting Netscape. Netscape uses MBX format, a popular format for saving and managing e-mail. If this doesn’t work, try Eudora (which uses a variant of the MBX format) next, followed by the other selections. Your system administrator may be able to help you if you can’t find an appropriate selection. If none of the import formats supported by OS X Mail can interpret the mailbox format used by your previous e-mail client, start your old e-mail client, disable its e-mail checking options, forward or resend any saved e-mail messages that you want to preserve to your e-mail account, and then read them using OS X Mail.
3. Figure 14.5 shows an information-only dialog box that suggests where your old e-mail may actually be stored, based on the e-mail application that you selected in the beginning of this task. This sort of information can be quite handy, because each e-mail application typically uses its own directory structure and mailbox hierarchy. After noting the name of the suggested directory, click the right-arrow to proceed. A standard OS X navigation dialog box displays, as shown in Figure 14.6.
E-mail
Chapter 14
Figure 14.6 Selecting the location of your old e-mail.
4. Navigate to the file or directory where configuration information or your actual e-mail is stored, and click Choose to select that file or directory. OS X Mail imports any e-mail that it can find based on the file or directory that you selected and stores it in your Inbox mail folder as unread mail. After initially configuring your e-mail account in OS X Mail and importing any existing e-mail from your previous e-mail application, you can start sending mail or configure OS X Mail for any other e-mail accounts. The next section explains how to configure additional e-mail accounts in OS X Mail and how to customize the settings of your initial e-mail configuration. If you want to just start sending email from your shiny new OS X Mail client, skip ahead to the “Composing a Message” section later in this chapter.
Customizing or Creating E-mail Accounts When you first execute the OS X Mail application, you must define the basic settings for that e-mail account. The OS X Mail Setup dialog boxes enable you to specify mandatory settings without confusing things by exposing every nuance of e-mail configuration. OS X Mail sets other account parameters to common values, but lets you change these settings later if the defaults don’t suit your requirements.
377
378
Part III
Networks and Internet
After defining your initial e-mail account in OS X Mail, you may wish to change these defaults or the settings you entered. If you have multiple e-mail accounts, you need to create a separate OS X Mail account for each one. Don’t worry—you can separately enable or disables these e-mail accounts after creating them, so that (for example) you won’t have to read your business e-mail while on vacation. The next task explains how to create a new e-mail account or fine-tune an existing one. It also highlights some of the circumstances in which it may be useful to modify e-mail account settings.
Task: Customizing E-mail Account Settings or Creating a New E-mail Account 1. Start OS X Mail and select the Mail, Preferences menu option. The Mail Preferences dialog box displays. If the Account panel is not shown (as shown in Figure 14.7) click the Account button in its toolbar to display the Account Information panel.
Figure 14.7 The Account panel in the OS X Mail Preferences dialog box.
2. Select the account that you want to modify, and click Edit. To create a new e-mail account, click Create Account. The Account Information panel displays, as shown in Figure 14.8. If you are modifying the settings for an existing e-mail account, the current settings for that e-mail account are shown.
E-mail
Chapter 14
Figure 14.8 The Account Information tab.
3. You can modify the content of any field on this panel by selecting the current contents of the field and typing the new information. The fields that you can modify in the Account Information panel are the following: ◆ Account Type: The type of remote e-mail service that the account will communicate with. This option is available only when you first create an e-mail account. Available options are: Mac.com Account (a special e-mail account provided by Apple Computer), POP Account (for communicating with remote mail systems that use the Post Office Protocol), IMAP Account (for communicating with remote mail systems that use the Internet Mail Access Protocol), and Unix Account (for communicating with remote mail systems running a classic Unix mail system). The type of account that you select determines the options that are available on the Account Options tab. The discussion of this tab later in this chapter identifies the type of e-mail account that each option applies to. ◆ Description: The label that is shown in the list of available e-mail accounts. The default content of the description field is generated by combining the account type and e-mail address. You may find it more intuitive to assign descriptive names such as “Home E-mail,” “Business E-mail,” and so on.
379
380
Part III
Networks and Internet ◆ E-mail Address: The address you want to use when sending mail. This is displayed in the From field of any e-mail that you send using this e-mail account, and replies to your mail are sent to this address. ◆ Full Name: The name under which your e-mail is sent. This name can be anything that suits your fancy, but is usually your real name. ◆ Host Name: The name of the mail server from which OS X Mail should retrieve your e-mail. ◆ User name: The name of the e-mail account whose mail you are retrieving from the specified mail server. ◆ Password: The password for your e-mail account. ◆ SMTP Host: The name of the computer system used to send outgoing e-mail. ◆ Use authentication when sending mail: Whether or not you need to specify a secure user name and password to the mail server when sending outgoing mail. If this item is selected, you must put valid entries for your e-mail account and password in the SMTP User and Password fields. The contents of these fields will be exchanged with your outgoing mail server in secure, encrypted form. (Standard POP account names and passwords are not encrypted when retrieving e-mail. They are sent as standard text, which is known as transmitting them “in the clear” because anyone who can access the network can theoretically read them by intercepting the packets sent to the mail server.)
TIP The “Use authentication when sending mail” setting is one of the more common ones that you may need to change. POP e-mail accounts typically do not require authentication to retrieve e-mail. Unfortunately, many mailers require secure authentication that verifies your identity when you send e-mail through the mail server. If you are able to retrieve your e-mail, but receive an error message when you attempt to send e-mail, your server probably requires authentication. This level of authentication has become necessary to prevent mail servers from being used to send spam e-mail. The need for this sort of thing is just another example of how the vast majority of trustworthy users are inconvenienced by the unscrupulous few who abuse services, such as e-mail, that would otherwise be free and open.
E-mail
Chapter 14
◆ SMTP User: The user name that you were assigned to use when sending e-mail. ◆ SMTP Password: The password associated with your outbound email account. This may be the same as your standard POP password, but that is not very secure. 4. Click the Account Options tab to specify additional settings. The dialog box shown in Figure 14.9 displays.
Figure 14.9 The Account Options tab.
5. The Account Options panel provides several detailed account configuration options. The options displayed on this panel are determined by the type of account that you are creating or modifying. For example, POP mailers download all messages to your local system by default, so options related to compressing mailboxes on the server are unavailable. The options that you can set on this panel, and the type of account that each is relevant to, are the following: ◆ Enable this account: (all account types) Whether or not this account is actively in use and available for sending or receiving mail. ◆ Include this account when checking for new mail: (all account types) Whether OS X Mail checks for new mail for this account when you
381
382
Part III
Networks and Internet
select the Mailbox, Get New Mail command (or press the Å+Option+N hot key combination). ◆ Delete messages on server after downloading: (POP accounts) Whether the copies of your mail on the server are deleted after you check mail from this machine.
TIP Leaving this option off (it is off by default) makes it easy to check your mail while you are out of the office without accidentally distributing your e-mail across multiple machines. POP mailers keep track of the last time that you checked your e-mail and the machine from which you checked it, and they download only mail that is new to the machine that you are checking your mail from, based on that machine’s IP address. For example, I leave this option off on my iBook, so I can check mail while I’m traveling without removing the messages from the server. Each time I check mail from my laptop, I see only messages that are new since I last checked mail from that machine. When I return to the office, I read mail on my primary machine and delete it from the server after doing so.
◆ Compact mailboxes when closing: (Mac.com and IMAP accounts) Instructs the remote server to automatically minimize the amount of space required to store your mailbox on the remote server, eliminating deleted messages, and so on. ◆ Message caching: (Mac.com and IMAP accounts) Determines how, where, and if OS X Mail keeps a record of recently accessed mail headers, messages, and attachments. Because IMAP mailers (such as Mac.com) download messages and attachments only when you actually view a message, keeping local copies of previously viewed messages saves download time if you decide to re-read a message. Options are Cache all messages and attachments locally, Cache message bodies locally, Cache messages when read, and Don’t cache locally. The down side of message caching is that saving the bodies and attachments of mail messages that you have viewed on your machine requires more disk space than simply saving the mail headers, which is the default behavior of IMAP clients.
E-mail
Chapter 14
◆ Show this account separately in mailboxes drawer: (POP accounts) Displays a separate set of mailboxes for this e-mail account in the mailboxes drawer at the right-hand side of the main OS X Mail window. ◆ Download messages from this account into folder: (POP accounts) Specifies that any incoming mail for this account will automatically be filed in a specific folder in the mailboxes drawer at the right-hand side of the main OS X Mail window. This option makes it easy to separate business and personal e-mail. ◆ Prompt me to skip messages over…: (POP accounts) Lets you skip messages that are larger than a specified size. This option is convenient when travelling or when checking e-mail over a slow or dialup connection, because you don’t have to download messages containing (for example) large attachments. ◆ Connect to server using port…: (all accounts) Specifies the Ethernet port on which your mail server is running. The standard Ethernet port used by most SMTP mail servers is port 25, while most POP mailers communicate via port 110. Many sites use a nonstandard port for POP connections for security reasons. This option enables you to adapt to such site-specific changes. ◆ Use SSL: (Mac.com, POP, and IMAP accounts) Instructs OS X Mail to use Secure Socket Layer (SSL) encryption when communicating with the remote mail server. ◆ Incoming Mail Directory: (Unix accounts) Specifies the name of the directory on the remote mail server where a user’s incoming mail is stored until it is read. ◆ Account Directory: (all accounts) The directory in which your e-mail is actually stored. Modifying the directory in which your mail is stored may simplify backups or other administrative procedures. ◆ Account Path Prefix: (Mac.com and IMAP accounts) Specifies the directory in which your e-mail is stored on the server. 6. Click OK to save your settings and return to the Mail Preferences dialog box. 7. Click the red Close button to close the Mail Preferences dialog box and return to OS X Mail.
383
384
Part III
Networks and Internet
Composing a Message All of the setup and configuration in the previous sections has prepared you for the big moment when you actually send your first message using OS X Mail. As you’ll see in the following task, creating (known as “composing”) and sending email in OS X Mail is easy. Like any good Macintosh application, OS X Mail provides an attractive, intuitive interface for creating and editing mail messages.
Task: Composing an E-mail Message in OS X Mail 1. Start OS X Mail. The main OS X Mail window and Mailboxes Drawer display, as shown in Figure 14.10. 2. Select the Compose icon from the OS X Mail toolbar. The New Message window displays, as shown in Figure 14.11. 3. Enter the e-mail address of the person to whom you want to send the email. If an entry for this person is already available in your Address Book, display the Address Book by selecting the Window, Address Book menu command (or by pressing the Option+Å+A hot key combination) and
Figure 14.10 The initial OS X Mail screen.
E-mail
Chapter 14
Figure 14.11 OS X Mail’s New Message window.
select the entry for that person from the Address Book. (Using and managing the Address Book is discussed under “Managing E-mail Addresses” later in this chapter.) You can enter multiple email addresses in this field by separating them by a comma. 4. Press Tab or use the mouse or touchpad to position the cursor in the CC: (Carbon Copy) field and type (or select from the Address Book) the email address of any other person to whom you want to send a copy of this e-mail message. 5. Press Tab or use the mouse or touchpad to position the cursor in the Subject field and enter the subject of your e-mail message. 6. Press Tab or use the mouse or touchpad to position the cursor in the body of your e-mail message (which is initially blank) and enter the text of your e-mail message.
NOTE If you created multiple e-mail accounts in OS X Mail and these accounts are enabled (in the Mail, Preferences, Accounts, Account Options tab), you see the drop-down Account menu shown above the message body in Figure 14.11. Use this menu to select the account to send this mail from.
385
386
Part III
Networks and Internet
7. Once you finish entering the text of your message, click the Send icon in the New Message window to send the mail. That’s all there is to sending a message in OS X Mail. Now that you’re an OS X Mail veteran, the next few sections examine sending more complex messages and managing your received e-mail and your addresses.
Attaching a File to a Message Aside from sending and receiving messages themselves, one of the most common uses of e-mail is exchanging files with other people. In a day-to-day business or academic environment, most file sharing takes place over a network using one of the file sharing protocols. These file sharing mechanisms are discussed in Chapter 12, “File Sharing.” But this is not possible or desirable sometimes. If you want to exchange confidential information with a few people, it may be easier to e-mail them a copy of the file rather than verifying which users have access to a shared directory. The down side is that each person has a copy of the file, which can make it complex to incorporate everyone’s comments. However, e-mailing a file is the best way to distribute things such as family photos or a personal recorded greeting. Mailing yourself copies of “work in progress” files is also an easy way to back up important data if you are using a laptop while traveling. Attaching a file to an e-mail message, regardless of its contents, requires only a few additional steps beyond the process of composing and sending e-mail in the first place. Let’s see how.
Task: Attaching a File to an E-mail Message 1. Compose an e-mail message as explained in the previous task. Before sending the e-mail message, click the Attach (paperclip) icon in the New Message window toolbar (or press the Shift+Å+A hot key combination). A standard navigation dialog box drops down onto the New Message window as shown in Figure 14.12. 2. Navigate to the file that you want to send as part of your e-mail message, select the filename, and click Open.
E-mail
Chapter 14
Figure 14.12 The Navigation dialog box when attaching a file to e-mail.
3. The Navigation dialog closes and an icon for the included file appears at the current cursor position in the mail message. 4. Click Send to send the e-mail message and attached file.
Managing Messages After you’ve received a few e-mail messages, your Inbox (the default mail folder where incoming mail is stored) begins to fill, making it hard to locate specific email messages. This is especially true if you have subscribed to any mailing lists or daily news or message services. OS X Mail makes it easy to store and organize your e-mail by letting you create additional mailboxes and folders to store different types of e-mail. Folders are like subdirectories within a Personal Mailbox and are used to organize multiple mailboxes. Mailboxes are where the actual mail messages are stored. Creating special mailboxes for storing your mail is a quick and easy way of organizing things. Assign useful names to these mailboxes when you create them (or rename them later) to make it easy to organize and retrieve specific sets of messages.
387
388
Part III
Networks and Internet
Now create a mailbox or two and get organized!
Task: Creating a New Mailbox 1. Start OS X Mail. The main OS X Mail window and Mailboxes Drawer display, as shown in Figure 14.10. 2. Select the Mailbox, New Mailbox menu command. The dialog box shown in Figure 14.13 displays.
Figure 14.13 The Create a New Mailbox dialog box.
3. Enter the name of the Mailbox that you want to create and click OK. If you want to create a new Folder and Mailbox at the same time, separate the two by a slash (“/’’). For example, to create a folder called Personal and a Mailbox inside that folder called Friends, you would enter “Personal/Friends” and click OK.
TIP When you create a new mailbox, that mailbox is always created within the mailbox or folder that you are currently viewing. This is often your Inbox, which is where your new mail is stored, but which isn’t where you probably want to create mail folders and mailboxes. To create folders and mailboxes within your top-level mailbox drawer, select the Personal Mailboxes drawer before following the steps described in this task.
The selected folder and/or mailbox that you specified is created and displays in the Mailboxes drawer, as shown in Figure 14.14.
E-mail
Chapter 14
Figure 14.14 The Mailboxes drawer showing some custom folders and
mailboxes.
That’s all there is to it! The only possible downside of organizing your mail into specialized folders and mailboxes is that it’s possible to organize your e-mail messages so well that it’s tricky to figure out where you’ve filed them. Or so I’ve heard.
Managing E-mail Addresses You need some easy way of keeping track of people’s e-mail addresses, names, and other personal information. Mac OS X provides a separate Address Book application that works with OS X Mail, but is not actually a part of the Mail program itself. This is a nice feature, because it lets you access your address book at any time to look up names, addresses, phone numbers, and so on, without having to start OS X Mail. Address Book entries are commonly known as “cards,” both because this mimics the idea of business or Rolodex cards, and also because this is the format that many people are familiar with from Microsoft Windows systems. The next few sections
389
390
Part III
Networks and Internet
explain how to create Address Book entries, edit existing entries, and how to import Address Book information from Microsoft Windows VCF (Virtual Card File) entries, such as those often found attached to mail sent from Windows users. If you are running OS X Mail, start the Address Book application at any time by pressing the Option+Å+A hot key combination. If you use the Address Book application frequently, it may appear in the Recent Items menu entry (Apple, Recent Items, Applications, Address Book). In case neither method is convenient, the following task explains how to add an icon for the Address Book to the OS X Dock.
Task: Adding an Icon for the Address Book to the Dock 1. Double-click the Applications icon in the toolbar of your current Finder window. If no Finder window is open on your desktop, click the background of your desktop to make the Finder your current application, and then press Å+N to open a new Finder window. If the Finder toolbar is not displayed in your current Finder window, press Å+B to display the Finder toolbar. After selecting the Applications icon, the OS X Applications folder displays in the Finder window. 2. Use the scroll bar at the right of the Applications window to scroll down until the Address Book icon is visible. 3. Click the Address Book icon and hold down the mouse button (or the button below the touchpad on your iBook or PowerBook). 4. Drag the Address Book icon to the Dock, positioning it where you like among the other icons in the Dock. As you move the Address Book icon along the Dock, space for its icon displays between each icon and the next. 5. Once you have positioned the Address Book icon where you want it in the Dock, release the mouse button. A copy of the Address Book icon from the Applications window displays in the Dock. Now you can start the Address Book application at any time by clicking on its icon in the Dock.
Creating a New Card As you exchange mail with more people (and especially if you use your OS X system for business purposes), you will accumulate a lot of e-mail addresses you’d like to have at your fingertips. The OS X Mail application automatically adds a basic address card for the recipient each time you respond to e-mail from someone. This
E-mail
Chapter 14
is extremely convenient, but in some situations you may like to quickly record information about someone. The following task explains how to create an address card for someone without waiting for them to send you e-mail.
Task: Creating a New Card in the Address Book 1. Start the Address Book. The main Address Book window displays, as shown in Figure 14.15.
Figure 14.15 The Main Address Book window.
2. Click New in the Address Book toolbar. An untitled address card displays, as shown in Figure 14.16.
Figure 14.16 A new address card before adding user information.
3. Enter the person’s first name and last name. By default, fields are also displayed for their e-mail address and work phone number. To add basic information other than these fields, select the drop-down menu button beside either of these fields and select the field that you would like to enter.
391
392
Part III
Networks and Internet
4. To enter additional information on the address card, click the drop-down menu button at the right center of the untitled address card. Additional information fields display, as shown in Figure 14.17.
Figure 14.17 An address card showing all of the fields that you can enter.
NOTE As with the E-mail Address and Work Phone Number fields on a new address card, you can customize the fields of information associated with an address card. Click the drop-down menu beside any of the entries in the right-hand column of the address card and select the label that describes the type of information you want to record.
5. Once you have entered all of the desired information, click Save to save the card in your Address Book.
Editing Existing Cards As previously mentioned, the OS X Mail application automatically adds a basic address card for the recipient each time you respond to someone’s e-mail. This basic card usually contains the recipient’s first name, last name, and e-mail address, which is the minimum amount of information typically needed to find someone in your Address Book. But why stop there? Address cards can contain
E-mail
Chapter 14
much more information—such as phone numbers, personal notes, and even addresses for physical mail—making them useful for a variety of purposes. The following task explains how to locate and add information to cards that already exist in your Address Book.
Task: Editing a Card in Your Address Book 1. Start the Address Book. The main Address Book window displays, as shown in Figure 14.15. 2. Scroll down until you see the address card you want to edit. Then either double-click that entry or select that address card and click Edit in the Address Book toolbar. The information for the selected card displays, as shown in Figure 4.17. 3. Modify any existing field or add any new information. To customize the labels for fields on the address card’s right-hand column, select the dropdown menu beside the current label and choose an appropriate label. 4. Click Save to update the address card in your address book and close the Edit dialog box.
Importing Cards from Other Programs As hard as it is to understand, not everyone uses a Macintosh. You may find it necessary to exchange address card information with people who use other applications. Rather than supporting only one specific address card format, the OS X Address Book lets you import address data from any file in which the various fields of the address entries are separated by comma, commonly known as a comma-delimited file. The OS X Address Book application makes it easy to import information from other e-mail applications, as explained in the following task.
Task: Importing Addresses into Your Address Book 1. In your existing mail application, export your existing address information in a comma-delimited file and move it to your Mac OS X system. 2. Start the Address Book. The main Address Book window displays, as shown in Figure 14.15.
393
394
Part III
Networks and Internet
3. Select the File, Import menu command (or press the Å+I hot key). A standard navigation dialog box displays. 4. Browse to the location of the address data file that you want to import, select it, and click Open. 5. The information from the selected file is imported and displays as a standard address book entry.
TIP The OS X Address Book does not directly support the VCF (Virtual Card File) format commonly used by some Microsoft Windows mail applications. Ironically, Microsoft’s Outlook Express application can help you import VCF files into the OS X Address Book—simply import the VCF files into Outlook Express and then export the addresses in the comma-delimited format supported by the OS X Address Book. Who says that Microsoft applications aren’t handy?
Summary This chapter has explained the basics of using the Mac OS X Mail application to send, receive, and organize e-mail from one or more e-mail accounts. OS X Mail is a powerful, high-quality application that makes it easy for you to make the most of e-mail communications. This chapter also discussed using the OS X Address Book, a standalone application that automatically integrates with OS X Mail, to manage names, e-mail addresses, and other information. Electronic mail is just one way of communicating over today’s networks. E-mail communications are one-to-one communications that require you to know with whom you’re communicating. An even simpler mechanism of exchanging information with someone else is to publish information over the Web. Not surprisingly, Mac OS X contains a Web server that makes it easy to publish Web pages and make them available to anyone who can reach your OS X system over the network. The next chapter explains setting up a personal Web server on your machine and using it to publish your own personal Web pages. Due largely to the Unix underpinnings of Mac OS X and the availability of excellent, free software such as the Apache Web server, Mac OS X has all of the power you need to set up a powerful, secure Web server—and all with the usability that you’ve come to expect from any Macintosh operating system.
Chapter 15 The Personal Web Server
396
Part III
Networks and Internet
hapter 12 explained how to configure and use file sharing in the traditional sense, by mounting shared volumes over a network by using the OS X Connect to Server command. This type of file sharing provides read/write access to the files and directories in shared volumes of folders, but can be overkill if you just want to give other people a way to view information on your machine over a network.
C
The World Wide Web is the definitive mechanism for sharing information with people over TCP/IP networks such as the Internet. As a well-connected, network-ready operating system, Mac OS X makes it easy for you to share files over the Web, with almost no work beyond setting a few system preferences and creating the files and folders that you want to let people access. This easy and powerful sharing of files over the Web is possible because the Apache Web server is included with Mac OS X. The Apache Web server and its configuration was discussed in Chapter 13, “Network Administration.” This chapter explains how to activate and configure Personal Web Sharing on your OS X system, discusses various aspects of using, managing, and expanding Apache on your OS X system, and also covers Apple’s iDisk, a free virtual storage area provided for every Mac OS X user at Apple’s Web site.
NOTE All of the screenshots of Web-based applications or Web pages in this chapter feature the OmniWeb Web browser. To me, OmniWeb is the most attractive, most elegant Web browser available for Mac OS X, providing a Rolls-Royce or Bentley browsing experience compared to the bloated subcompact that is Microsoft’s Internet Explorer. You can download it for free and use it indefinitely as nag-ware, or pay $29.00 for a license—a small price for a high-quality browsing experience.
Setting Up Personal Web Sharing This section explains how to activate Personal Web Sharing on your OS X system, and also discusses related services such as DNS that people use to locate your OS X system and view your shared Web pages.
The Personal Web Server
Chapter 15
Activating Personal Web Sharing Web sharing enables users to view HTML files located in your home directory’s Sites folder from any system equipped with a Web browser. The Apache Web server included with Mac OS X is the world’s most popular Web server. On most computer systems, starting and using Apache to share files over the Web requires a certain amount of configuration and a bit of administrative knob twisting. On Mac OS X, sharing files over the Web is as easy as clicking a button.
NOTE Though it is easy to activate the Apache Web server installed on your system, you can take advantage of the full power of the Apache Web server by manually modifying its configuration file, which is discussed in the upcoming section, “Upward Mobility with the Apache Web Server.” For complete information about Apache, see the Apache Web site or any of the hundreds of excellent books that have been written about configuring Apache, or simply see the Apache documentation that’s available at the Apache Web site, http://www.apache.org.
Activating Personal Web Sharing on your OS X system requires administrative privileges. Once Web sharing is activated on your system, put any files you want to share in a folder named Sites, located in your home directory. Anyone using a Web browser can then view or download those files. The following task explains how to activate Web sharing on your OS X system.
Task: Activating Web Sharing 1. Click the System Preferences icon from the Dock or your Application folder. The System Preferences application displays, as shown in Figure 15.1. 2. Click the Sharing icon, located in the Internet & Network section. The Sharing Preferences panel displays, as shown in Figure 15.2. 3. If Web sharing is currently inactive, the phrase Web Sharing Off displays in the Web Sharing portion of the File & Web panel. Click the Start button in the Web Sharing section to activate the Apache Web server on your system and enable remote users to access files stored in the Sites directory of your home directory.
397
398
Part III
Networks and Internet
Figure 15.1 The main System Preferences panel.
Figure 15.2 The Sharing Preferences panel.
The Personal Web Server
Chapter 15
4. As Web sharing and the Apache Web server initialize, the message “Web Sharing starting up…” appears. Once Web sharing is completely activated, the message Web Sharing On displays in the Web Sharing portion of the File & Web dialog box. That’s all there is to it. To verify that Web sharing is enabled on your system, use a Web browser on your system to access the URL http://ip-address/~shortname/. You can see your system’s IP address at the bottom of the System Preferences application’s Sharing Panel or in the Network panel. Your shortname is the short name assigned when you created your account. The tilde (~) character is a reference to your home directory. The Web server on your OS X system automatically maps these kinds of references to the Sites directory located in your home directory. Follow your short name with a forward slash (/) to force the Web server to return the file named “index.html” in your Sites folder.
TIP To find out the short name associated with the account of any user on your Mac OS X system, click the System Preferences application’s Users icon. You need administrative privileges to examine any account. You can then select any account and click Edit to display information about that user’s account, such as the short name.
NOTE Unlike the personal Web servers provided on earlier versions of the Mac OS, activating Web sharing on a Mac OS X system enables it for all users on your system. This is because Mac OS X is a true multiuser system.
Working with Domain Name Services Chapter 12 introduced file sharing, which enables users to access files on your OS X (and earlier) Macintosh systems. These types of file sharing use various systemspecific protocols for networked file sharing, which is fine if you have one of those systems. If you don’t, file sharing suddenly becomes a lot more complex. The World Wide Web was developed to allow system-independent access over a network to data located on any other type of system.
399
400
Part III
Networks and Internet
A good general rule is that system-specific or proprietary protocols have some advantages—as long as you’re using that protocol. In the case of file-sharing protocols such as AppleTalk or Microsoft’s SMB protocols, the primary advantages are that these protocols use their own naming and addressing scheme to look up other available hosts, and they usually provide a browser that supports that protocol. On Microsoft Windows systems, this browser is the Network Neighborhood; on Mac OS 9 and earlier Macintosh systems, this was the Chooser; and on Mac OS X systems, you browse for AppleTalk systems by clicking on the AppleTalk entry in the Go Menu’s Connect to Server menu item after activating AppleTalk in the Network System Preferences pane. Today’s Internet, like all other pure TCP/IP networks, doesn’t have a browser for available TCP/IP hosts. Hosts on a TCP/IP network find each other by name or by IP address. An IP address is an easy way to find another host on the Internet because IP addresses on the Internet must be unique.
NOTE There are two fundamentally different types of IP addresses on TCP/IP networks— routable and non-routable IP addresses. Routable IP addresses are public IP addresses for which network packets can be routed from one host, router, etc. to another, until they reach their destination or no one answers. Non-routable IP addresses are IP addresses that are guaranteed not to be passed through routers and other Ethernet packet forwarding hardware, and are therefore designed to be used on intranets of varying sizes. The IETF (Internet Engineering Task Force) created the notion of non-routable IP addresses to provide IP addresses that could be safely used inside organizations without having to register them. For example, my home network and your home network may both use non-routable IP addresses of the form 192.168.6.X. Because these packets never make it out of our networks onto the Internet, no collisions or misdelivery can occur. For more information about nonroutable IP addresses, see the IETF RFC (Request for Comment) on Non-Routable IP addresses at http://www.ietf.org/rfc/rfc1918.txt.
For remote users to access your system using a Web browser, they must know either the name or IP address of your OS X system. To be able to access your system by name, the system that is attempting access must be able to identify the IP address that corresponds to the name of your host. For it to find your system’s IP address, your system must either have a static IP address (which is always the same) or it must obtain an IP address at boot or network configuration time using
The Personal Web Server
Chapter 15
a protocol such as DHCP, which must be completely integrated with the Domain Name Service on your network. Which brings us to the Domain Name Service. Hosts on the Internet actually find each other and route traffic based on number IP addresses of the form XXX.XXX.XXX.XXX. Numeric IP addresses such as these are fine for computers to use but are tricky to remember. I have enough trouble remembering my home, home office, cell, and office phone numbers, let alone trying to remember the IP addresses of the hosts I contact. Maybe you can remember that www.netscape.com is 64.12.180.21, but if so, you’re a better person than I am. Host names provide a convenient memory aid for the computers and Web sites we need to contact. To determine the IP address that corresponds to a hostname, systems must either maintain a text file (known as a hosts file) that maps IP addresses to host names, or contact a networked service that knows how to translate one to the other. With an estimated 10 zillion hosts on the Internet today, maintaining all of these mappings in a single text file is pretty much out of the question—not only would the file be huge, but it would change often, and maintaining it would be an administrative nightmare. A networked service is therefore a far superior approach, and that is what is used on the Internet today. DNS (the Domain Name Service) is the standard way of mapping host names to IP addresses, which is known as resolving those host names. Machines that support DNS are generally known as name servers, and work in a cooperative fashion. If my DNS server doesn’t know the IP address that corresponds to a host name I’ve specified, it at least knows how to ask another name server for that information. If that server doesn’t know, it can ask another, and so on. Though DNS is the most popular way of resolving host names, other services provide the same function, depending on the administrative environment used by different types of computer systems. Much of the Internet and most Unix environments use DNS to resolve host names. Mac OS X uses a process known as the lookupd (lookup daemon) to resolve host names. The lookupd is configured in NetInfo or through a text file to specify the order in which your OS X system consults various services to resolve host names. This information is stored in the file /etc/lookupd/hosts. The types of services that Mac OS can consult are the following: ◆ CacheAgent: Mac OS X looks in its internal cache or recently resolved host names to find the IP address associated with the specified host name.
401
402
Part III
Networks and Internet ◆ FFAgent (Flat File Agent): Mac OS X looks in a text file to resolve host names to IP addresses. This file is the file /etc/hosts on your Mac OS X system. ◆ NIAgent (NetInfo Agent): Mac OS X looks in the NetInfo database to resolve host names to IP addresses. ◆ DNSAgent (DNS Agent): Mac OS X consults DNS to resolve host names to IP addresses. The IP addresses of the DNS servers that Mac OS X will consult is stored in the text file /etc/resolv.conf. ◆ YPAgent (Yellow Pages Agent): Mac OS X consults NIS, the Network Information System originally created by Sun Microsystems to resolve IP addresses to host names. The original name of NIS was “Yellow Pages,” hence the “YP” acronym. Sun had to change “Yellow Pages” to NIS for copyright reasons. ◆ NILAgent (NIL Agent): This is more of a placeholder than an actual name lookup service. If the lookupd can’t resolve the host names by the time it gets to this service, it returns an error message stating that the host name could not be resolved.
Discussing the internals of DNS is beyond the scope of this section and is the subject of many entire books. However, once you understand what DNS does, the keys to making it possible for other people to see any Web pages that you export are the following: ◆ You must have activated Web sharing on your machine. ◆ Your machine must have an IP address that can be found by any machine that wants to view your Web pages. ◆ If anyone wants to access your shared Web pages based on the name of your computer rather than its IP address, an entry for your computer must exist in whatever mechanism your computer uses to resolve host names.
Serving Web Pages Once you’ve activated Web sharing on your Mac OS X system, there’s little else you have to do to let people view your Web pages. The files should preferably be created in HTML, the HyperText Markup Language developed by Tim BernersLee (the inventor of the World Wide Web) to serve as the common language of the Web, something that every browser on every platform can understand, regard-
The Personal Web Server
Chapter 15
less of what software or operating system you’re running. Most Web browsers will also view text files as verbatim text, but that’s not very exciting. Avoid sharing files in proprietary formats (such as Microsoft Word’s DOC files), simply because these generally require a specific browser plug-in to be viewed with a Web browser. Different Web browsers respond differently when confronted by file type they don’t recognize. Some try to display it in a browser window anyway (which can be pretty darn ugly, or even meaningless), while others simply download the file to your local machine, where presumably you have some application that can open the file. This section provides basic information about the layout of a standard Sites folder, discusses how you can use folders to organize the information that you are sharing over the Web, and explains how you can easily take advantage of some of the capabilities of the Apache Web server to control who can access the files located in specific folders in your Sites folder.
Creating Shared Folders When many people create their first Web site, it typically consists of a single HTML page called “index.html.” By default, most Web servers deliver this page when someone requests access to any Web directory without specifying the file that they want to view. This is the default action of the Apache Web server provided with Mac OS X. The file that is delivered by default when a Web browser accesses a specific Web server (or Sites folder, in this case) is typically referred to as a home page. When you create an account on a Mac OS X system, whether as part of the process of installing Mac OS X or by subsequently using the System Preferences application’s Users pane, OS X automatically creates a Sites folder in that user’s home directory. It also creates a directory named Images inside that directory to hold shared graphics, and creates a default “index.html” file as a starting point. Having a default “index.html” page also helps you verify that Web sharing is working correctly when you first activate it on your system, because the contents of this file are displayed when anyone with a Web browser attempts to access your personal Web site. Figure 15.3 shows the default “index.html” page installed on Mac OS X systems, as shown in OmniWeb (available from http://www.omniweb.com), which is probably the most sophisticated and attractive Web browser available for Mac OS X.
403
404
Part III
Networks and Internet
Figure 15.3 The default home page in a user’s Sites folder.
Once you’ve verified that Web sharing is working correctly on your system, you’ll probably want to customize the default home page. After all, it doesn’t say anything about you personally, and it’s the same as every other default home page. Explaining the details of HTML is outside the scope of this book. Hundreds of excellent books on the subject are available, and an even greater number of HTML tutorials are available on the Web itself. These subjects are generic to any operating system and Web browser—that’s the point of the World Wide Web. A tremendous number of specialized applications, known as HTML editors, are available for every operating system, including Mac OS X, and most popular word processors nowadays will also let you save or export word processing files in HTML format to make it easy for you to share your documents over the Web. Relevant to Mac OS X, however, is exploring the capabilities of the Apache Web server, which comes preconfigured to make it easy for you to organize your files and share information without requiring that you create complicated Web pages or write applications to manage who has access to your files. As you create Web pages and store files in your Sites folder, it’ll soon contain lots of files. For people to be able to access those files, you must either create hyper-
The Personal Web Server
Chapter 15
links in your Web pages that point to those files, or tell people the name of the files that you want to share. This can be somewhat time-consuming, especially if you simply want someone to be able to grab a few files from your Web server and go. One easy solution is to create folders in your Sites folder to organize the files on your Web site. At the beginning of this section, I explained that the Apache Web server on your OS X system tries to deliver a file named “index.html” when someone requests access to a specified folder over the Web. If this file does not exist, the Web server still has to do something, but what the Web server returns to the browser that requested access depends on how your Web server is configured. On the Apache Web browser provided with Mac OS X, the default action of the Apache Web server is to return an index of that folder, which is a list of that directory’s contents. Figure 15.4 shows a directory listing in the Mac OS X OmniWeb Web browser. As you can see in Figure 15.4, the directory index lists all the files and folders in that directory. If you created a file named “index.html” in that directory, the contents of that file would be displayed instead of the index listing of the folder.
Figure 15.4 A directory listing in OmniWeb.
405
406
Part III
Networks and Internet
Creating folders to organize your information is just as useful on your Web site as it is anywhere else. Creating folders in your Sites folder provides a good compromise between being able to share files and not giving them away to anyone who happens to view your Web site. Because your Sites folder contains a file named “index.html,” anyone who simply visits your personal Web site sees that file instead of the directory contents—in other words, they won’t know what other files and folders your Sites folder contains. You can create HTML hyperlinks on your “index.html” page to provide access to any part of your Web site that you want to make public. But if you don’t include hyperlinks, no one can access any files or folders in your Sites folder unless they know their names. Figure 15.4 shows an index of the Friends folder in my Sites folder, but no one would know it was there unless I told them (or my Sites folder lacked an “index.html” file).
Creating Protected Folders Sharing data over the Web and restricting access by creating folders whose names people have to know in advance is a version of “security through obscurity,” which is an old joke about Unix security. Although Unix security is quite robust now, once people said it was secure only because no one could ever find the security information. It’s natural to want to create sections of your Web site that can only be viewed by certain people. With the “security through obscurity” model, anyone who can guess the names of your “unadvertised” folders can access them and the files that they contain. The Apache Web server provides a tremendous number of built-in security features, including creating passwords to quickly and easily restrict access to specified directories. To create password-protected folders in your personal Web site, you must: ◆ Configure the Apache Web server to recognize password-protected directories and allow password files to override the default security configured for the Apache Web server on Mac OS X systems. ◆ Create an authorization file in each directory that you want to protect. ◆ Create the password file(s) used by those authorization files. ◆ Restart the Apache Web server on your OS X system. Later in this section, we’ll walk you through the task of password-protecting a folder in your Sites folder. First, however, look at the two Apache configuration
The Personal Web Server
Chapter 15
files that you’ll be working on—an existing file that you’ll modify, and a file that you’ll create. Both of these are standard text files that you can edit or create with any text editor, such as the Mac OS X TextEdit application or the emacs and vi editors provided with Mac OS X. I’ll use the vi text editor in a Mac OS X terminal window when describing this task, because modifying the Apache configuration file requires some special privileges—more about that later. As installed on Mac OS X systems, the Apache Web server has some clever configuration options that simplify using different types of authentication for different user’s Sites folders. As mentioned earlier in this chapter, each time a new user account is created, a Sites folder is automatically created in that user’s home directory, complete with a directory to hold images and a default “index.html” file. At the same time, a special Apache configuration file for each user’s Sites folder is created in the directory /etc/httpd/users. The name of this file is the user’s short name, followed by the file extension “.conf ”. For example, when I created my initial Mac OS X account, I used the short name wvh (my initials), so the name of the Apache configuration file that was created for my Sites folder is “/etc/httpd/users/wvh.conf.” The contents of the default Apache configuration file for my Sites folder on a Mac OS X system are the following: Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all
The entries in this file have the following meanings: ◆ The first and last (sixth) lines identify the directory to which this file applies. You can have specific entries in an Apache configuration file for any or all of the directories in your Sites folder—this makes it easy to restrict access to certain directories while using the default Apache security settings in others. ◆ The second line specifies the options that are configured in this folder. The Indexes keyword guarantees that indexes will be displayed if no “index.html” file exists in my Sites folder or any of its subdirectories, and the MultiViews keyword enables the Web server to negotiate how my files and folders will be displayed, such as the character set used to display the page, based on where the server believes that the client is located.
407
408
Part III
Networks and Internet ◆ The third line specifies that none of the default security settings for the Apache Web server can be overridden in this directory. This is the configuration option we will modify to impose security on folders in my Sites folder. ◆ The fourth and fifth lines identify the default policies for access to my Sites folder—the fourth line sets the default access policy that access to the folder will be denied to everyone except those to whom access is explicitly allowed, and the fifth line then gives access to the folder by anyone from anywhere.
As mentioned in this list, we must modify the third line to password-protect certain folders. The Apache Web server on Mac OS X systems is configured to look for files with the name “.htaccess” in folders and enforce the security policy based on the contents of those files. The default access to any directory is enabled, so anyone can view anything. To enable password-protected folders using the .htaccess files, we need to enable these files to override the default server policy. The format of an .htaccess file is the following: AuthType Basic AuthName "By Invitation Only" AuthUserFile /Users/wvh/security/friends.passwd Require valid-user
The entries in this file are the following: ◆ AuthType Basic: Specifies basic username and password authentication. ◆ AuthName “string”: Specifies a name for this page that will be displayed when the username and password are requested. ◆ AuthUserFile filename: Specifies the full pathname of a file that contains a list of valid users and the associated passwords used to verify that they can access this folder. ◆ Require userlist: Specifies who can access the directory. This is either a list of users from the password file specified with the AuthUserFile command, or it can simply be valid-user, which means that any user from the specified password file can have access (assuming that he or she enters the correct password, of course). Now that we understand the meaning of the configuration files that we’ll be creating and editing, the following task shows how to password protect a Folder on your personal Web site.
The Personal Web Server
Chapter 15
NOTE The following task uses the Unix terminal to edit the files necessary to add password protection to a folder in your personal Web directory. Don’t worry if you’re not familiar with using a terminal—this task explains everything that you’ll have to do. Using the terminal actually simplifies certain tasks, especially those that require editing files that are owned by an administrative user on your Mac OS X system. Using the Terminal application is explained in detail in Chapter 19.
Task: Password-Protecting a Folder on Your Personal Web Site 1. Click the Terminal icon in the Utilities folder in your Application folder. The Terminal application displays, as shown in Figure 15.5.
Figure 15.5 The terminal window.
2. Execute the command “sudo vi /etc/httpd/users/username.conf,” where username is your login name (or the name of the user for whom you want to activate the ability to password protect Web folders). You are prompted for the administrator password on your system—enter the admin password and press Return. This command executes the vi text editor in the terminal window as the administrative user on your system, as shown in Figure 15.6.
409
410
Part III
Networks and Internet
Figure 15.6 The vi text editor displaying the user’s Web server configura-
tion file.
3. Use the arrow keys on your keyboard to position the cursor at the beginning of the word None after the AllowOverride keyword. Press the letter C, followed by the dollar sign, and type the word All. Press Escape. The file now looks like that shown in Figure 15.7. 4. Press the Z key twice to save your file and exit the vi text editor.
Figure 15.7 The user’s Web server configuration file after changing None
to All.
The Personal Web Server
Chapter 15
5. Type the command “sudo /usr/sbin/apachectl restart” to restart the Apache Web server on your system so that it picks up the new authentication information. You are prompted for the administrator password on your system—enter the admin password and press Return. The message “/usr/sbin/ spachectl restart: httpd restarted” displays in the terminal window. 6. In the terminal window, type the command “cd ~/Sites” to change your working directory to the Sites folder in your home directory.
TIP Later in this task, we’ll need to know the name of your home directory, which is the same as the short name of your login account. If you don’t know the name of your home directory, type the command pwd in the terminal window. This returns something like “/Users/shortname/Sites.” The text that you see instead of “shortname” is the short name of your home directory.
Use the “cd directory” command to change your working directory to the name of the folder that you want to password-protect. I’ll use a folder named “friends” as an example, so I would type “cd friends.” If the folder that you want to password protect doesn’t already exist, you can create one using the “mkdir directory” command, where directory is the name of the folder that you want to create. For example, to create the folder named “friends” if it did not already exist, you would type “mkdir friends” and press the Return key. 7. Type the command “vi .htaccess” and press Return to start the vi text editor and create a file named .htaccess in the current directory. Press the letter I to begin inserting text, and type the following lines into the file, replacing the name “wvh” with the name of your home directory: AuthType Basic AuthName "By Invitation Only" AuthUserFile /Users/wvh/friends.passwd Require valid-user
8. Press Escape to stop inserting text, and press Z twice to save the file and exit the vi text editor. Now anyone who attempts to examine the contents of this directory over the Web will see a dialog box that does not allow access until they type a valid username and password.
411
412
Part III
Networks and Internet
Use the htpasswd command to create the password file that you identified using the AuthUserFile keyword. In this example, this is the file /Users/wvh/friends.passwd, but this file can have any name that you want. Execute the following command to create this file and also create a password entry for the user named “joe”. Replace “wvh”, which is the name of my home directory, with the name of your home directory. You are prompted for a password. /usr/bin/htpasswd –c /Users/wvh/friends.passwd joe
9. Enter the password that you want to give to the user “joe” and press Return. You are then prompted to enter the same password again to ensure that you didn’t make any typos. 10. Start a Web browser, and attempt to access the URL http://hostname/~wvh/friends, replacing “wvh” with the name of your home directory. A dialog box displays that prompts you for a username and password, as shown in Figure 15.8.
Figure 15.8 A username and password prompt for access to a protected directory.
The Personal Web Server
Chapter 15
11. Enter the username “joe” and the password that you entered in the previous step, and you’ll be granted access to the friends directory. Congratulations, you’re the Webmaster of your own domain!
Upward Mobility with the Apache Web Server Apache is the most flexible and easily expanded Web server in the known universe. Hundreds of books describe configuring, fine-tuning, and enhancing Apache, and the source code for hundreds of Apache extensions, loadable modules, and related applications are readily available on the Web. Chapter 13 provided an overview of the names and location of the configuration and log files used by Apache, as well as the directory structure that the Apache server exports over the Web from Mac OS X systems. This section provides some general information about how to turbocharge Apache, and some of the best sites on the Web for obtaining information about Apache, Apache extensions, and Web-based applications that you can use on your Web site. Going to the Internet to find information about extending and configuring the Apache Web server is much like the old saying, “Physician, heal thyself!” except no irony is involved this time. The Web is clearly the best source for obtaining information about configuring, updating, and extending Apache, plus a tremendous number of entertaining war stories and “don’t try this at home” tales. The Web is also the fastest and most immediate way of locating and downloading upto-date Apache modules, CGI scripts, and even Web-based applications to help you administer Apache. (If that isn’t a good definition of recursion, I don’t know what is!) My favorite all-time Web application is the Webmin Web-based system administration interface (http://www.webmin.com). This generic Web-based application lets you do remote system administration from any machine on the Internet. Figure 15.9 shows the initial Webmin screen in the OmniWeb Web browser. Webmin is an open source application that can easily be installed and configured on Mac OS X systems (as well as some 40 other system types). When installing Webmin, you must specify the network port that it runs on (Webmin includes its
413
414
Part III
Networks and Internet
Figure 15.9 The Webmin Web-based administration application.
own miniature Web server, which runs authenticated on your OS X system to be able to modify protected files), and must also provide a username and password that enable you to access Webmin. One of the most interesting features of Webmin is that you can use it to administer the Apache Web server by selecting the Apache Webserver item from the Servers screen. Though Webmin installs smoothly on Mac OS X, you have to configure it for the Mac OS X version of Apache. This involves updating the name of the Apache executable file (/usr/sbin/httpd), paths to various Apache configuration files, and then walk through a few configuration screens that tailor Webmin to the specific Apache modules used on your system. After this initial configuration, an Apache configuration screen like the one shown in Figure 15.10 displays in your browser, giving you access to almost every aspect of Apache on your OS X system. Anyone who questions the value of open source software only needs to think about the Mac OS X Darwin kernel, Apache, and Webmin to assure him/herself that the open source movement has contributed some absolutely amazing software to the world of modern computing.
The Personal Web Server
Chapter 15
Figure 15.10 Configuring Apache in Webmin.
Another excellent open source package available for Apache is the mod_dav Apache module available at http://www.web-dav.org/mod_dav. WebDAV (Web Distributed Authoring and Versioning) is a mechanism for distributed file sharing and authoring over the Web. WebDAV is discussed in more detail in the next section, because WebDAV is the file-sharing mechanism used by Apple’s iDisk software. The mod_dav module is a set of Apache extensions that you can compile on your OS X system and integrate into Apache. It may seem confusing that OS X supports WebDAV but that you need to add WebDAV support to the Apache server running on OS X, but these are really two different things. Mac OS X’s support for WebDAV means that the operating system can mount and access WebDAV volumes—adding WebDAV support to Apache is necessary to export folders from your system using WebDAV’s extensions to HTTP. A quick Web search will give you hundreds of other examples of Apache extensions and compiled modules that you can add to your OS X system’s Apache installation to increase its power and flexibility. Some of the most popular software packages that you can integrate with Apache are the open source
415
416
Part III
Networks and Internet
MySQL database and the PHP (Personal HyperText Preprocessor) language that makes it easy to write Web-based applications. For an overview of integrating these with Mac OS X, see the article at http://www.devshed.com/Server_Side/ Administration/BuildingOnOSX/page1.html.
Using iDisk to Share Files and Web Pages Apple’s iMac and iBook computer systems have paved the way for an avalanche of related iSoftware, including iMovie 2 and iTunes, both of which were discussed earlier in this book. iDisk, yet another freebie from Apple, consists of 20MB of free disk storage on a Web server at Apple that you can access from a Mac Os X systems anywhere on the Web. You also can mount iDisk on your Mac OS X desktop using the WebDAV support built into Mac OS X. In addition to your iDisk, you can use Apple’s iTools page (http://itools.mac.com) to send iCard electronic greeting cards and create a home page that is stored in your iDisk.
NOTE If you attempt to log into iTools or mount your iDisk from a system other than a Mac OS X system, you’ll receive a message saying that you can only access your iDisk from a Macintosh computer system. I guess that this helps differentiate Apple’s iDisk from all of the dot.bomb companies in the heyday of the Internet explosion that offered free storage on their servers in return for your looking at their ads—at least this way, Apple knows that you or someone that you know has purchased a Macintosh at some point.
iDisk and WebDAV Overview WebDAV (Web Distributed Authoring and Versioning) is a set of extensions to HTTP that enables collaborative access to files and directories exported by a Web server. WebDAV makes it easy for people to work on files in a distributed environment without having to rely on a specific set of file-sharing protocols such as AppleTalk, SMB/.CIFS, or NFS. Because the WebDAV protocol is supported by Web servers rather than operating systems, WevDAV implements file sharing at the application or server level, rather than the operating system level. WebDAV can be viewed as a distributed Web authoring solution, the foundations of a Web
The Personal Web Server
Chapter 15
CMS (Content Management System), or a network filesystem that happens to run over HTTP. Mac OS X provides built-in support for accessing WebDAV volumes, but most of the WebDAV servers on the Web are Apache Web servers. As mentioned earlier in this chapter, Apple’s inclusion of Apache on every OS X system provides an excellent opportunity for you to configure, activate, and experiment with WebDAV volumes, because your Apache Web server can export them and your Mac OS X system can mount them. Your iDisk account is created as part of the process of installing Mac OS X. You can also create an iDisk subsequently by following the procedure described in the next section and filling out the forms available once you click Sign Up. Once you have registered for an iDisk, you can use other software provided by Apple, such as the HomePage software that you can run over the Web from Apple’s http://itools.mac.com page. Apple’s HomePage software walks you through the process of creating a Web site in your iDisk that you can then browse from anywhere. This home page uses Apple’s WebObjects Web development environment to make it easy to create an attractive Web site.
Accessing Your iDisk This section explains how to mount your iDisk like any other networked drive. Once you successfully log in, an Internet icon for your iDisk displays on your desktop. By default, your iDisk contains a directory structure that mirrors the layout (but not the content) of your home directory when it was first created. Your iDisk comes with the following files and directories: ◆ About your iDisk: A TextEdit file that provides an introduction to iDisk. ◆ Documents: A standard folder designed to hold documents you want to access over the Web. ◆ Movies: A standard folder to organize any digital movies you want to access over the Web. ◆ Music: A standard folder to organize any audio files you want to access over the Web. ◆ Pictures: A standard folder to organize any digital photographs you want to access over the Web.
417
418
Part III
Networks and Internet ◆ Public: A shared folder that people can access over the Web from any Mac OS X system, just like Guest file sharing between standard Mac OS X systems, as explained in Chapter 12. ◆ Sites: A standard folder to hold your public iDisk Web site. ◆ Software: A folder that contains three other folders: an Apple Software folder containing a great selection of free software from Apple, an Extras folder containing free MP3 files to jumpstart your online Music collection, and a Mac OS X Software folder that contains an impressive selection of freeware, shareware, and demo software for Mac OS X systems.
The following task explains how to log in to your iDisk from your Mac OS X system and mount it on your Mac OS X desktop. You must already have created your iDisk account during the Mac OS X installation process or by using a browser on your Mac OS X system to access the URL http://itools.mac.com, clicking iDisk in the page header, and clicking Sign Up. You can also set up your iDisk account from the System Preferences application’s Internet panel, using the iTools tab.
Task: Mounting Your iDisk Under OS X 1. In the Finder, select the Go menu’s iDisk command. The WebDAV authentication dialog box shown in Figure 15.11 appears.
Figure 15.11 The WebDAV authentication dialog box.
2. Enter your iDisk username and press Tab to move to the Password field. 3. Enter your iDisk password and click OK. The WebDAV Authentication dialog box closes, an icon for your iDisk appears on your desktop, and your main Finder window displays the top level of your system with your iDisk volume highlighted, as shown in Figure 15.12.
The Personal Web Server
Chapter 15
Figure 15.12 The Finder window showing your iDisk.
Summary Today’s Macintosh systems running Mac OS X are Internet-ready and Internetaware at a level far beyond any other computer system. This chapter explained how to activate Web sharing on your OS X system, bringing new power to the Web servers provided by earlier versions of Mac OS X. Many of the enhanced Web capabilities and support provided in Mac OS X are due to the inclusion of the Apache Web server on OS X systems. This chapter explained some of the capabilities of the Apache Web server, such as password-protected folders, that are easy to create and configure on your OS X system, and concluded by discussing Apple’s iDisk, free storage provided on an Apple Web server for every Mac OS X user that you can mount and access like any other networked storage mechanism. This chapter and Chapter 12 focused on file sharing and Web access to your system. The next chapter takes the discussion of networking on your Mac OS X system a bit further, by providing more information about the Internet and some of the other protocols and applications available that let you do much more than simply surf Web pages or share files.
419
This page intentionally left blank
Chapter 16 The Internet
422
Part III
Networks and Internet
-mail is the killer application for networking in general, but the Internet is the thing that got personal computers into so many homes. Regardless of who controls the finances in your household, the advantages of Internet access are an easy argument to make (and win).
E
The Internet is just plain fun because it provides access to just about anything. You can order tickets (or anything else), check your bank, credit card, or brokerage accounts, find out the weather anywhere from Maui to Leningrad, and a million other things. Surfing the web is a great way to do research—traditional reference materials such as encyclopedias, dictionaries, and thesauri are all just a few mouse clicks away (though some cost money). Internet Service Providers (ISPs) make it easy for anyone to connect to the Internet by providing integrated environments that provide a common interface to many Internet features, such as e-mail, Web browsing, instant messaging, and Internet chat rooms. While this approach has the advantage of providing a single interface for a set of related services, it also brings the overhead of a monolithic environment—each application within that environment essentially carries the baggage of every other one in terms of memory requirement, application size, and so on. Mac OS X makes it easy to connect to the Internet or any other supported network, regardless of the Web browser, e-mail client, file transfer utility, and any other network application that you want to use. This chapter provides an overview of the Internet and the communications protocols used to access today’s TCP/IP networks. It then describes how to use the Network Control panel, the System Preference pane used to configure your Macintosh for any type of supported network connection. The last few sections of this chapter explore all of the different Web browsers currently available for Mac OS X, and also discuss the spectrum of different types of services and related protocols that you can find on the Web. The Internet is much more than just a set of Web pages—it provides chat rooms where you can communicate with people all over the world using Internet Relay Chat (IRC); download sites where you can find cutting-edge Mac OS X applications, tips, and tricks; electronic bulletin boards where you can post messages and read literally million of messages on thousands of topics, and much more.
Underlying Architecture When you get right down to it, the Internet is a long set of connected cables, stretching around the world. The fundamental idea of communicating over a net-
The Internet
Chapter 16
work involves a number of different layers of support, starting at the hardware level and adding increasing levels of abstraction until you get to the level where you and I work. It would be almost impossible to write applications if each software vendor had to write its own software to transmit information over a network, packaging and unpacking it at either end and then doing whatever was required by each different application. To hide the differences between each different type of network card, computer system, and operating system, computers that communicate over a network do so by agreeing on common ways of organizing data, starting at the level where bits of information are packaged and transmitted over a network cable, all the way up to the level where an application simply opens a file and the operating system figures out if it is located on the local computer, a different user’s computer, or even on a dedicated fileserver somewhere out on the network. Each of these agreed-upon standards is known as a protocol. The sum of all of these different protocols and their associated layers of communication is known as the architecture of the network. Even if you’re only using your computer to send and receive e-mail, knowing a little bit about the underpinnings of the Internet is interesting. It’s also useful when you try to figure out why you can’t contact a specific computer over a network, or why you may occasionally receive e-mail from some unknown mail server, telling you that your e-mail can’t be delivered. The next few sections explain a bit about the underlying communication mechanisms used on most networks today, including the Internet.
What Is TCP/IP? In the beginning there was the network cable, and it was good. However, it was fairly useless without some way of sending data from one networked device to another, and guaranteeing that the information one device sends is the same as the next one receives. Physically, computer networking as we know it today was invented at Xerox Palo Alto Research Center (PARC) in the form of a networking mechanism known as Ethernet. Ethernet is a physical cabling mechanism, with associated network cards, ways of connecting to the cable and so on. Today, the most common networking protocol used on Ethernet networks is a protocol known as the Transmission Control Protocol/Internet Protocol (TCP/IP). As discussed in Chapter 12, there are a number of common networking protocols, each with their own set of associated hardware and networking protocols. Though
423
424
Part III
Networks and Internet
the acronym TCP/IP only contains two sets of letters, TCP/IP is actually a fourlayer protocol. As we move up the food chain from low-level, hardware-oriented network communication to user-level communication, each layer of the TCP/IP protocol gives us a bit more distance from the actual hardware by providing higher levels of abstraction from the electrical signals that are actually being transmitted over a network cable. The lowest layer of TCP/IP communications, the link layer, is the hardware communications layer defined within your network hardware and the device drivers used by your operating system to communicate through that hardware. This layer understands how to send and receive small units of information, known as frames, over Ethernet devices. The link layer understands only communications between one piece of hardware and another, and it uses the low-level Ethernet address built into your network hardware to facilitate this. These hardware Ethernet addresses are known as MAC (Media Access Control) addresses, and are unique to every Ethernet card or interface that exists. Hardware manufacturers who produce Ethernet cards are allocated blocks of Ethernet addresses, and they assign them one-by-one to each piece of hardware that they produce so each can be uniquely identifiable on an Ethernet network. Above the link layer, the network layer handles communication between different hardware devices over the network. As a slightly higher-level protocol, the network layer understands IP (Internet Protocol) addresses, which are the familiar XXX.XXX.XXX.XXX-format network addresses. The network layer includes support for protocols that enable it to map between hardware (MAC) addresses and IP addresses. ARP (Address Resolution Protocol) determines the IP address that corresponds to a hardware MAC address, and RARP (Reverse Address Resolution Protocol) determines the MAC address corresponding to an IP address. IP addresses are 32 bits long, composed of four bytes separated by periods. These addresses consist of network and host information. From left to right, the first byte contains the highest-level network information, known as Class-A network information. The second byte contains Class-B network information, the third byte contains Class-C network information, and the final byte contains host information. All together, standard IP addresses provide support for two million networks, each containing 254 unique hosts. It turns out that two million networks of 254 hosts isn’t even enough by today’s standards, so the use of a subnet mask, in combination with an IP address, pro-
The Internet
Chapter 16
vides a way of identifying a host on a specific subnet within existing Class A, B, and C networks. This has given us all a bit of breathing room—for the moment.
NOTE Two million networks of 254 unique hosts in combination with a subnet mask will be too low a number in the foreseeable future of today’s network-centric computing environments. The new IPv6 protocol is designed to remove this limitation by extending the way in which IP address information is encoded, providing 128 bits for address storage rather than the 32 provided by the current IP protocol (known as IP Version 4, or IPv4). IPv6 and IPv4 addresses are designed to be compatible, so that we don’t have to renumber every host with an existing IP address.
Above the network layer, the IP layer understands how to package and extract information into/from the Ethernet frames that are exchanged and routed by the link and network layers, combining that information into packets, which are the smallest units of information communicated over TCP/IP networks that most people actually care about. The IP layer also supports concepts related to data delivery over a network, such as routing, which simply means the devices data has to go through to reach a remote host. IP is a connection-less protocol, meaning that packets from one host that are destined for another are simply broadcast over the network. It is the target host’s responsibility to recognize and receive those packets. IP does not confirm that it has received packets, and also does not guarantee the sequence in which they are delivered. Timing issues, faulty network hardware, transient overloads, and a thousand other things can cause IP packets to be received in a different sequence from how they were sent. The IP layer uses a sequence number embedded in the header of each packet to put the packets back in the correct order. The Transmission Control Protocol (TCP) and the related Universal Datagram Protocol (UDP) complete the layer cake of networking protocols that make up TCP/IP. UDP is a connectionless protocol, like IP, and is therefore well suited to high-speed or broadcast network communications. TCP, on the other hand, is a connection-oriented protocol that uses IP packet sequence numbers to guarantee the correctness and completeness of TCP/IP communications. TCP/IP temporarily buffers incoming IP packets and reassembles them in the correct order. If a packet is missing, TCP can request that the packet be retransmitted. Most highlevel networking applications have their own protocols, such as HTTP, used in
425
426
Part III
Networks and Internet
World Wide Web communications. HTTP data is encapsulated in TCP/IP packets and which therefore depends on the delivery and correctness guarantees provided by the TCP protocol.
How AppleShare IP Works AppleTalk is a network communication protocol just like TCP/IP or UDP. LocalTalk, a bunch of cables with weird end connectors, is yet another cabling scheme just like Ethernet. The AppleTalk protocol runs on LocalTalk, Ethernet, and many other network interfaces. Until the iMac, other G3 Macs, and today’s G4 systems, all Macintosh systems came with a LocalTalk port, which has now been replaced by standard RJ-45 ports for connectivity to standard Ethernet networks. LocalTalk was great in its day because it provided a quick, plug-and-play solution for networking Macs that was forgiving of errors in network communications, but it is incredibly slow by today’s standards. Macintosh systems that have only LocalTalk connectors must communicate using AppleTalk, because that is the only protocol supported on a LocalTalk cable. To communicate with systems that understand only TCP/IP, Macintosh systems use software such as MacIP to encapsulate TCP/IP packets inside AppleTalk packets and then send them to an AppleTalk router, which can be as simple as a LocalTalk-to-10Base-T adapter that plugs into a LocalTalk or printer port on the Mac. Devices such as these unwrap the AppleTalk envelope and forward the packet as plain TCP/IP onto the Ethernet. Returning packets from the TCP/IP destination are repackaged into AppleTalk packets and sent back to the LocalTalk Mac. On Ethernet networks, AppleTalk can be speedy and efficient, although it is still somewhat slower than TCP/IP. The primary advantage of AppleTalk is that it “just works.” The AppleTalk protocol automatically handles dynamic AppleTalk address assignment and other internal communications. Macintosh systems connected to an Ethernet use the AppleTalk protocol to communicate with printers or when communicating with an Apple file sharing server. AppleTalk is only available if you’ve activated it in the System Preferences application’s Networking panel. AppleTalk is used basically used for all the functions that you can select in the Mac OS Chooser (under the Apple menu) in older versions of the Mac OS, or by selecting the AppleTalk portion of your network in the Finder’s Connect to Server dialog box.
The Internet
Chapter 16
Macintosh systems connected by Ethernet also speak TCP/IP directly, which is handy because it’s obviously the standard for connections to most Unix machines and to the Internet itself. Applications such as most other e-mail programs; browsers such as Microsoft’s Internet Explorer, Netscape, Opera, and many others; and more “Unix-oriented” applications, such as Telnet, SSH, and FTP all communicate using TCP/IP. Selecting the Local Network portion of your network in the Finder’s Connect to Server dialog box restricts you to connecting to machines via TCP/IP.
NOTE You may have encountered the AFP (Apple File Protocol) when reading about networked Macintosh communications. AFP was developed by Apple Computer as a faster, more modern file-sharing protocol for communicating with file servers. AFP has commands that let you do all the standard things involved with contacting and exchanging data with a file server, including obtaining and modifying information about the file server and the filesystems that it exports; and creating, reading, writing, and deleting files and folders, and so on. You can run AFP over AppleTalk or over TCP/IP, although AFP over TCP/IP is faster than AFP over AppleTalk. The AFP file server on Macintosh systems is AppleShare. AFP removes many of the limitations of AppleTalk file servers, such as restrictions on volume size and type. AFP also includes robust support for user authentication and an access control mechanism that lets you control access to servers, filesystems, and even directories.
What Is PPP? The previous section’s discussion of the TCP/IP protocol explained that TCP/IP is actually a four-layer protocol, with the lowest layer (the link layer) handling the actual low-level communications. The generic link layer for TCP/IP communications is designed to use networking hardware, and therefore uses drivers specific to that hardware. The Point-To-Point Protocol (PPP) was designed for TCP/IP communication over serial interfaces, such as modems. It is a more sophisticated, secure successor to other serial TCP/IP protocols such as SLIP (Serial Line Internet Protocol) and CSLIP (Compressed SLIP). Using a modem to connect to the Internet via PPP requires a different link layer, one that includes devices drivers for serial devices and for receiving and transmitting packets over those devices. PPP automatically
427
428
Part III
Networks and Internet
assigns an Ethernet address and supplies related information, such as router and Domain Name Server addresses, when a connection is established. Ethernet addresses are relinquished when a PPP connection is terminated. Many of today’s broadband ISPs use an enhanced version of PPP, called PPPoE (PPP over Ethernet) to deal with potentially huge numbers of customers compared to a relatively small pool of available IP addresses. PPPoE uses intermediate hardware to bridge a PPP connection with an actual network connection or access concentrator, providing finer control over the allocation, use, and termination of IP addresses in a highly dynamic environment. PPPoE supports the always-on feature of broadband service providers without requiring that hosts always have the same IP address. It does this by breaking Internet connectivity into sessions, each of which uses an IP address that doesn’t have to be the same across different sessions. It is quite possible for your actual IP address to change while using PPPoE, but the combination of your OS X system’s PPPoE support and the PPPoE software running at your ISP automatically handles the reassignment and routing and address translation updates. PPPoE is commonly used by DSL and ADSL broadband Internet Service Providers.
Configuring the Mac for the Internet The previous section provided background information about how network connection actually work, how different protocols and protocol layers combine to support high-level communications. Understanding the organization and interaction of various networking protocols is only interesting to some, but getting and staying connected to the Internet or any TCP/IP or AppleTalk network is important to every Mac user. This section explains how to use the Mac OS X Network pane in System Preferences to get your Mac on a network, regardless of the type of connection. It also explains how to use System Preferences’ Internet pane to set up and configure various aspects of your Internet connectivity, such as creating an iTools account, and defining and configuring your default e-mail, Web browser, and Internet News reader. Most Mac OS X applications consult your centralized Internet preferences to get this information from a single source—just one more example of Mac OS X doing the right thing for you!
The Internet
Chapter 16
Using the Network System Preferences Panel The Network pane of Mac OS X System Preferences is the central location for configuring networking and Internet connectivity on your OS X system. The Network pane also provides control panels such as the Location Manager, making it easy for you to create, configure, and store multiple sets of network configuration information. For iBook and PowerBook user, this makes it easy for you to use different network interfaces and configurations depending on whether you’re at home, in your office, or working from a hotel room or vacation spot.
TIP When traveling, you may simply want to try using the Network preferences panel’s Automatic setting, which attempts to detect the right setting based on probing the connection you’re setting up. If this doesn’t work, you should configure your settings manually, as explained in this section.
Task: Configuring Your Network Connection 1. Click the System Preferences icon from the Dock or your Application folder. The System Preferences application displays, as shown in Figure 16.1. 2. Click the Network icon, located in the Internet & Network section. The Network panel displays, as shown in Figure 16.2. 3. If the Network selections are grayed out and cannot be selected, click the lock in the lower left corner of the Network panel. This displays a dialog box that prompts you for the username and password of an administrative user on your machine. After entering this information, click OK to close the authentication dialog box. Now you can make changes on the Network panel. 4. Click the drop-down list beside the Show: label and select the network interface that you want to use. Figure 16.3 shows the Network panel after selecting the Built-in Ethernet entry from this list.
429
430
Part III
Networks and Internet
Figure 16.1 System Preferences.
Figure 16.2 System Preferences’ Network panel.
The Internet
Chapter 16
Figure 16.3 The Network panel after selecting the Built-in Ethernet entry.
5. Select the type of configuration you want to use for your TCP/IP connection from the drop-down list beside the Configure: label. Your options are: ◆ Manually: Enter a specific IP address, subnet mask, router (gateway) address, DNS server(s), and your Search Domain(s) manually. Use this choice on TCP/IP networks with static IP addresses. ◆ Manually using DHCP Router: Enter a specific IP address, but obtain all other information from a DHCP server on the network. ◆ Using DHCP: Obtain your IP address and all other networking information from a DHCP server. ◆ Using BootP: Obtain your IP address and all other networking information from a BootP server. 6. If you are connecting to the Internet through a broadband provider that uses PPPoE, click the PPPoE tab. The PPPoE panel displays, as shown in Figure 16.4. For more accurate record keeping, enter the name of that service provider and any name your ISP gives their service. Enter the name of your account and your password, and click the Save Password checkbox if you want your system to record your password. You should
431
432
Part III
Networks and Internet
Figure 16.4 The Network panel’s PPPoE panel.
only save your password if you want all users of your OS X system to access the Internet using your username and password. If you want to display the status of your PPPoE connection in the status bar at the top of your Mac OS X system, click the Show PPPoE status in menu bar option. 7. If you are using PPPoE and want to supply advanced PPPoE configuration options, click the PPPoE Options button. The dialog box shown in Figure 16.5 displays. Click the Connect automatically when starting TCP/IP options checkbox if you want your OS X system to automatically connect to the Internet and establish a PPPoE connection whenever you start an application that requires network access. You can use select the Prompt… and Disconnect… options and specify a time limit if you want your system to automatically prompt you every so often or disconnect you from the Internet entirely after a specified period of inactivity. Select the Disconnect when user logs out option if you are sharing your OS X system with other users but do not want them to inherit your Internet connection after you log out. If you are having problems maintaining or establishing a PPPoE connection, you can select the Send PPP
The Internet
Chapter 16
Figure 16.5 The Network panel’s PPPoE Options dialog box.
echo packets or use verbose logging options to glean information that may help your ISP diagnose the problem. Don’t select these options during normal, everyday use. 8. If you are configuring a TCP/IP connection that does not use PPPoE, and you want to activate the AppleTalk protocol over this TCP/IP connection, select the AppleTalk tab. The AppleTalk tab displays, as shown in Figure 16.6. (You cannot use AppleTalk over PPPoE because the session orientation of PPPoE is incompatible with AppleTalk encapsulation inside IP packets.) Click the Make AppleTalk Active checkbox to activate AppleTalk over the network interface you are configuring. Either select the default option of automatic configuration, which generates valid AppleTalk Node and Network IDs for your system, or click the drop-down list beside the Configure label and manually specify your Node and Network IDs. 9. If your network or ISP uses proxies, which are centralized addresses associated with network services such as FTP, the Web, secure Web connections, streaming audio and video, Gopher, or a SOCKS Firewall, click the Proxies tab. The panel shown in Figure 16.7 displays. Select the
433
434
Part III
Networks and Internet
Figure 16.6 The Network panel’s AppleTalk panel.
Figure 16.7 The Network panel’s Proxies panel.
The Internet
Chapter 16
checkboxes associated with proxied services on your network, and enter the host name or IP address and the port used by those proxies. 10. Once you have completed configuring your TCP/IP settings, click Apply Now to test them. If your connection is not successfully established, review your settings to correct them, or contact your ISP or System Administrator if you still cannot connect. 11. Once you have a working connection, select the System Preferences menu’s Quit System Prefs option to close System Preferences. The dialog box shown in Figure 16.8 displays.
Figure 16.8 The Network panel’s Save Configuration Changes dialog box.
12. To save your settings, click Save. To exit System Preferences without saving your new TCP/IP configuration, click Don’t Save. If you select Don’t Save, you will have to reconfigure your TCP/IP connection the next time you want to connect to the network. The previous task explained how to set up an initial TCP/IP configuration. If you use a portable OS X system, you can create multiple configurations for home and office use. That way, you can easily switch between configurations, rather than having to reconfigure your system’s primary TCP/IP settings each time. Even users of desktop Mac OS X systems may want to create multiple locations to encapsulate proxy settings associated with using a VPN. The following task explains how to define multiple locations using the location management features built into the OS X Network panel.
Task: Creating Multiple TCP/IP Locations 1. Click the System Preferences icon from the Dock or your Application folder. The System Preferences application displays, as shown in Figure 16.1. 2. Click the Network icon, located in the Internet & Network section. The Network panel displays, as shown in Figure 16.2.
435
436
Part III
Networks and Internet
3. Select the drop-down box beside the Location label and click New Location. The dialog box shown in Figure 16.9 appears, prompting you for a name for the new location. I typically use names that reflect either where you’ll use the configuration—Home, Office, and so on—or that reflect their type of network interface—100Base-T, AirPort, Modem, and so on. Click OK to close this dialog box and a generic Network configuration dialog box appears.
Figure 16.9 The Network panel prompting for the new location’s name.
3. Select the drop-down list beside the Show label and click Active Network Ports. The panel shown in Figure 16.10 displays. Disable any networking or modem interfaces you aren’t using in this configuration so it matches the location for which you are defining the separate TCP/IP configuration. Deselecting unused options simplifies maintenance and makes it easier to recognize the purpose of different location definitions. Deselect the checkboxes beside any of the network devices that are not relevant to the location you are defining. If you want to be able to use multiple interfaces at a single location, you can drag active entries up and down in the list to correctly prioritize them.
The Internet
Chapter 16
4. When only the network interfaces associated with the location you’re defining remain, select the network interface that you want to configure from the drop-down list beside the Show label, and configure it as described in the previous task. 5. Once you have completed configuring your TCP/IP settings, click Apply Now to test them. If your connection is not successfully established, review your settings to correct them, or contact your ISP or System Administrator. 6. Once you have a working connection, select the System Preferences menu’s Quit System Prefs option to close System Preferences. The dialog box shown in Figure 16.8 appears. 7. To save your settings, click Save. To exit System Preferences without saving your new TCP/IP configuration, click Don’t Save. If you select Don’t Save, you will have to reconfigure your TCP/IP connection the next time you want to connect to the network. You’ve now configured the settings that OS X uses to connect to a network. You know how to use the integrated management features of the OS X Network preferences panel to simplify using your OS X system in multiple locations or with different network configurations. TCP/IP applications on Mac OS X can further simplify your Internet use by consulting a centralized source of Internet information. The next section explains how to configure these centralized settings via System Preferences’ Internet panel.
Using the Internet Panel Long-time Mac users may remember the Internet Config application that was introduced as a standalone application in System 7 days and integrated into Mac OS 8. The Internet Config application made it easy to use multiple browsers, mail clients, and other Internet-aware applications by storing all of your Internet configuration information in a central location that all well-written applications consulted. Mac OS X provides this same functionality in System Preferences’ Internet panel—plus a few more bells and whistles, as you might expect. The Mac OS X System Preferences Internet panel provides four panels for configuring the following:
437
438
Part III
Networks and Internet ◆ iTools: Each Mac OS X owner is eligible for an iTools account on Apple’s Web servers. One component is your personal iDisk, which is 20MB of storage on one of Apple’s systems. This is a virtual disk that you can access from anywhere on the Internet. It also contains auxiliary software for Mac OS X. Setting up an iTools account is described later in this section. Accessing and using your iDisk was discussed in Chapter 15. ◆ E-mail: This panel enables you to select your favorite mail reader and configure general e-mail-related settings such as your e-mail address, incoming mail server, the host names of your incoming and outgoing mail servers, the type of e-mail account you’re using, and your login and password on your incoming mail server. Selecting your favorite mail reader determines which application will be started when you click on a MailTo hyperlink on a Web page. Figure 16.10 shows the Internet panel’s Email panel.
Figure 16.10 The Internet panel for configuring e-mail settings.
◆ Web: Use this panel to select your favorite Web browser and configure Web-related setting such as your home page, your favorite search engine, and the location for files downloaded from the Web. Selecting your
The Internet
Chapter 16
favorite Web browser determines which Web browser launches when you click on a hyperlink in any Internet-aware application. Figure 16.11 shows the Internet panel’s Web panel.
Figure 16.11 The Internet panel for configuring Web settings.
◆ News: This panel enables you to select your favorite Internet newsreader, the server from which news messages will be retrieved, and your account and password on that server, if applicable. Internet news, also known as Usenet News, is the Internet’s oldest bulletin board system. It contains thousands of special- and general-interest newsgroups, some with thousands of postings per day from all over the world. Figure 16.12 shows The Internet panel’s News panel. The setting required for e-mail, Web browsers, and Internet news are quite straightforward—any information that you don’t know can easily be obtained from your ISP. The following task explains how to set up an iTools account.
439
440
Part III
Networks and Internet
Figure 16.12 The Internet panel for configuring news settings.
Task: Signing Up For an iTools Account 1. Click the System Preferences icon from the Dock or your Application folder. The System Preferences application displays, as shown in Figure 16.1. 2. Click the Internet icon, located in the Internet & Network section. The Network panel displays, as shown in Figure 16.13. 3. If you did not create an iTools account while installing Mac OS X, click Sign Up. Your default Web browser starts, displaying the signup page shown in Figure 16.14. 4. Fill out all of the information on this page and click Continue. A confirmation page entitled “Save for your records” displays a summary of the account information that you entered. Click Continue. 5. The next page lets you notify friends that you now have an iTools account by sending them an electronic greeting card via e-mail. If you want to send this e-mail, enter one or more e-mail addresses and click Send iCard. If you simply want to proceed, click No Thanks. 6. A congratulations page displays, welcoming you to iTools. To see iTools’ features, click Start Using iTools. Otherwise, exit from your browser to return to the System Preferences Internet panel.
The Internet
Figure 16.13 The Internet panel for configuring and accessing your iTools
account.
Figure 16.14 The Web page for signing up for an iTools account.
Chapter 16
441
442
Part III
Networks and Internet
If you selected Start Using iTools, you go to a central location from which you can access the various features of your iTools account, such as the following: ◆ The capability to send iCards (electronic greeting cards). ◆ The capability to access your iTools e-mail account. You can send and receive e-mail at your iTools account as [email protected], where login is your iTools login. ◆ A free home page that you can access from http://homepage.mac.com/login. ◆ The capability to mount your iDisk on your OS X desktop, read and write files to it, and access those file from anywhere on the Internet. Not too shabby for something that’s free! If you decide to make serious use of your iDisk as a central location in which to store files, you can purchase additional storage space from Apple. Now that you’ve configured every aspect of networking and the Internet on your OS X system, look at the various browsers that are available for Mac OS X.
Browsers for Mac OS X Though Microsoft’s Internet Explorer owns most of the Web browser market, sometimes you get what you pay for, and Internet Explorer is free. I personally find it to be a monolithic, inelegant browser. I prefer to use browsers that were specially designed for the Mac OS X platform, which take better advantage of its features and have a better look and feel. You may disagree, in which case you’re in luck, because Internet Explorer comes with every Mac OS X system.
TIP Many Web designers create Web sites that check what type of browser they are being viewed with so that they can take advantage of those browsers’ capabilities. Unfortunately, they often recognize only AOL’s Netscape and Microsoft’s Internet Explorer. For this reason, upstart browsers such as iCab, OmniWeb, and Opera usually offer the option to identify themselves as other browsers. As long as they support all the same features as the browser they are pretending to be—and that’s usually the case—this gives you the best of both worlds. You get to use your browser of choice while not losing any customized browser capabilities.
The Internet
Chapter 16
This section summarizes the most popular Web browsers available for Mac OS, discussing the features and benefits of each. It also provides a screenshot of each and lists the address from which to get a copy.
iCab for Mac OS X iCab (http://www.icab.de/index.html) browser was specially developed for Macintosh computers by a German company. iCab is actively under development and its licenses are $29.00 per system. Figure 16.15 shows my home page in the iCab browser.
Figure 16.15 My home page in the iCab browser.
iCab is a customizable browser with relatively small memory requirements. One of iCab’s interesting features is commercially in Kiosk mode. In this mode, iCab occupies the entire screen of a Mac OS X system and can’t be interrupted (unless you’re really clever). This mode was designed for Internet kiosks in malls or other public locations.
443
444
Part III
Networks and Internet
Microsoft Internet Explorer Microsoft’s Internet Explorer (http://www.microsoft.com) is available for most computing platforms, including Mac OS X. Internet Explorer is free, and many Web pages are (unfortunately) customized to take advantage of its capabilities. Figure 16.16 shows my home page in the Internet Explorer browser.
Figure 16.16 My home page in the Internet Explorer browser.
A copy of Internet Explorer is bundled with each Mac OS X system, so it’s rarely necessary to download it. Your computer can automatically retrieve updates to Internet Explorer from Apple by using System Preferences’ Software Updates panel.
Mozilla Mozilla (http://www.mozilla.org) is the open source community’s version of the original Netscape browser. Mozilla is a community project based on an older release of the Netscape source code, but it has been responsible for many of the enhancements to Netscape 6. Figure 16.17 shows my home page in the Mozilla browser.
The Internet
Chapter 16
Figure 16.17 My home page in the Mozilla browser.
Mozilla is an extremely fast browser for OS X. If you’re a fan of the Netscape approach but don’t want the disk and memory overhead of the complete Netscape Communicator, Mozilla is an attractive alternative. It provides only a browser, and a fast one at that.
Netscape Communicator Netscape (http://www.netscape.com), the Web browser that popularized the Internet, is freely available for Mac OS X. As much as I like Netscape, it is not well integrated with OS X’s Internet preferences, and therefore requires separate configuration for things such as your home page. Figure 16.18 shows my home page in the Netscape browser. A big advantage of Netscape is that it’s a suite of applications that provide much more than just a browser for OS X users. Netscape Communicator consists of the Netscape Navigator Web browser, an e-mail application that also enables you to read Internet newsgroups, an instant messenger application, an HTML editor called Composer for building your own Web pages, and its own Address Book
445
446
Part III
Networks and Internet
Figure 16.18 My home page in Netscape Communicator.
application. The newsgroup features of its mail application and the instant messenger make Netscape a worthy download.
OmniWeb OmniWeb (http://www.omnigroup.com) was the first browser other than Internet Explorer to be available for Mac OS X, and is still my favorite OS X browser. The Omni Group, developers of OmniWeb, were once NeXT developers, so they’re familiar with the internals of Mac OS X. OmniWeb is available only for Mac OS X. Figure 16.19 shows my home page in the OmniWeb browser. OmniWeb costs $29.00 per system. It is a visually elegant, stable, high-performance browser that is intuitive and has some nice keyboard shortcuts, like the ability to increase and decrease text size. OmniWeb is integrated with OS X system features such as speaking text, includes extensive online help, and also includes a built-in HTML overview that is handy to refer to when creating Web pages.
The Internet
Chapter 16
Figure 16.19 My home page in the OmniWeb browser.
Opera Opera (http://www.opera.com) is a Norwegian Web browser for platforms such as Linux, Windows, Mac OS X, and various embedded or small footprint operating systems, such as Symbian, QNX, and Embedix, the version of Linux that runs on the Sharp Zaurus. Opera is a fast Web browser with small memory requirements. Figure 16.20 shows my home page in the Opera Web browser. Opera’s high performance and small memory requirements make it a pleasure to use. Opera is especially attractive to people who want to use a single browser on different types of computer systems and demand high performance.
Exploring Internet Services The Internet offers more information, connectivity, and fun services than just the World Wide Web. This section summarizes some of the most popular Internet services. Support for many of these services is built into Mac OS X, but it isn’t always clear how or where to access these services. Therefore, this section also provides suggestions for software you can use to access these services.
447
448
Part III
Networks and Internet
Figure 16.20 My home page in the Opera browser.
The World Wide Web Using the World Wide Web from your computer system is pretty much a given— it’s the primary reason why many people own home computers. From its humble beginnings at CERN, a physics research institute in Switzerland, the Web has taken the Internet by storm. It’s almost hard to conceive of not using the Web to make purchases, do research, or simply view the home pages of friends and family. The World Wide Web owes its popularity to two of its most basic features. First, all communication between Web servers and clients is done via a simple, textbased protocol known as HTTP (HyperText Transfer Protocol). HTTP is an evolving open standard that always maintains backward compatibility to ensure its fundamental premise of open information exchange between Web servers and clients. Second, all Web pages are written using HTML (HyperText Markup Language), which is a platform-independent, text-based way to identify the purpose of a Web page’s elements. Each browser displays Web pages slightly differently due to how its display functions are implemented. Because HTML is an open, platform-independent way of describing the content of Web pages, it has made it easy to develop platform-specific browsers that can take advantage of the graphics capabilities of different computer systems. Probably the best example of
The Internet
Chapter 16
the flexibility of HTML and its ease of interpretation is the existence of text-oriented browsers such as lynx and links for various platforms. These browsers display Web pages on a standard terminal or inside a terminal emulator such as the Mac OS X Terminal application. The fact that you can view a Web page in both plain text and using the fancy graphical capabilities of browsers such as OmniWeb, Netscape, and Internet Explorer just about says it all in terms of the usefulness of an open standard such as HTML – it totally separates content from the formatting capabilities of your browser..
Chat Rooms and IRC Internal Relay Chat (IRC) is an interactive communications mechanism. It has been around for years and is still popular. IRC consists of servers that host channels, which are simply discussions on a specific topic. To access IRC, you must have IRC client software that runs on your computer system and must also know the host name or IP address of an IRC server. Using your IRC client, you connect to the IRC server and then join whatever channels you want. Channels can either be open to all interested parties or can be closed, meaning that access is limited to specific individuals. Some of the best-known and most popular IRC servers are provided by sites such as DalNet (http://www.dal.net/), EFNet (http://www.efnet.net/), IRCNet (http://www.funet.fi/~irc/), NewNet (http://www.newnet.net/), and UnderNet (http://www.undernet.org/). These URLs are not for the servers themselves, but provide lists of hosts running IRC servers. A popular, centralized list of IRC servers is available at the URL http://www.irchelp.org/irchelp/networks/ servers/index.html, though it’s almost impossible to provide an authoritative list of the IRC servers—there are simply too many. One of the most popular IRC clients for Mac OS X is ircle, which runs under most versions of the Mac OS, including a Carbonized version that runs in Classic mode on OS X systems as well as a dedicated OS X version. The home page for ircle, http://www.ircle.com/, provides download links for all supported versions. Somewhat related to IRC are the many instant messenger services provided by AOL/Netscape, Yahoo!, Microsoft, and many others. These services let you exchange messages in real-time with other instant messenger users, so that you can carry on conversations with your friends over the Internet. One of the potential drawbacks of instant messenger clients is that many instant messenger services use different protocols to exchange messages. A copy of the AOL Instant Messenger (AIM) client is bundled with Netscape Communicator
449
450
Part III
Networks and Internet
and is automatically installed when you install Netscape on OS X, but this client is limited to exchanging information with other AOL clients. More promising are some of the newer clients that are available for Mac OS X, such as Proteus (http://www.indigofield.com/) and Fire (http://www.epicware.com/fire.html). Both of these free instant messenger clients understand the communications formats used by other clients such as AIM, ICQ, Yahoo!, IRC, MSN and Jabber IM. Jabber is an open XML (eXtensible Markup Language) format for exchanging instant messages. Using Jabber provides a common XML-based format that can be used by any instant messenger service—the flip side of instant messenger clients that understand multiple protocols. Hopefully, Jabber will continue to catch on, and the various proprietary formats used today will pass away.
Usenet You can create a single set of centralized configuration settings under Mac OS X, which are then used by any Usenet news client. Usenet, also sometimes referred to as Internet news or simply NetNews, consists of thousands bulletin boards, known as newsgroups, that are shared between hosts on the Internet. The name Usenet stands for Unix Users Network, though it is no longer limited to Unix users. Usenet actually predates the Internet—it was originally developed on early Unix systems that exchanged postings to its bulletin boards using UUCP (Unix to Unix Copy Program), an early automated file transfer mechanism. Usenet clients, the applications that you and I use to read Usenet news, are available for every modern operating system. Usenet bulletin boards (bboards) are organized hierarchically under a number of top-level subjects such as alt (alternative), comp (computer), rec (recreation), and so on. For example, one of my favorite Usenet bboards is alt.folklore.computers, where people exchange folklore, horror stories, and commentary on using computers. One of the most popular Usenet bboards is rec.humor.funny, which consists of a daily influx of jokes. Using NetNews is easy—once you know the name of a NetNews provider, you use a Usenet client (usually referred to as a news reader) to access the newsgroups available on that server. You subscribe to various newsgroups, and your news reader typically then downloads the headers for any unread messages in that newsgroup. If you want to read a Usenet post, your news reader then downloads the actual body of the message. This duality between headers and message bodies is very similar to the way that IMAP mail servers work, and it was designed that way for the same reason—to minimize unnecessary downloads.
The Internet
Chapter 16
Usenet bboards are provided by most ISPs—simply ask the name of your ISP’s NetNews server. A number Internet sites provide free (though potentially slow) access to Usenet bulletin boards if your ISP does not. Get a list of these open news servers from http://www.newzbot.com/. Two of the most popular applications for reading NetNews are Microsoft’s Outlook Express and Netscape Communicator, both of which support news servers in approximately the same way that they support mail servers. Other popular newsreaders for OS X are Thoth (http://www.thothsw.com/thoth/) and tin (http://www.tin.org). Thoth is a graphical newsreader, while tin works within a terminal emulator such as the Mac OS X Terminal application.
FTP FTP (File Transfer Protocol) is the oldest mechanism for transferring files between one system and another over the Internet. FTP is both the name of the protocol used for these files transfers and the name of the most common client for performing these file transfers on Unix systems (and therefore on Mac OS X systems, as well). A command-line FTP client named “ftp” is available on every modern Unix system that I’ve ever encountered. To use FTP to transfer files, you start your client and open a connection to the FTP server that contains the files you want to retrieve. Most FTP servers require that you log in using a valid user name and password, though some support a generic login named “anonymous.” For these you are supposed to use your e-mail address as the password, as a courtesy to the operators. Once logged in on the FTP server, you can use the standard Unix cd and ls commands to navigate through the directories. These are typically a dedicated set of directories for file transfer. You can then download files by using commands such as Get Filename. The command-line version of FTP included with Mac OS X can be run from within the Mac OS X Terminal application. Most Web browsers also support FTP file transfers—you access the FTP server by providing a URL that begins with ftp:// to identify FTP as the communications protocol. A number of FTP applications available for Mac OS X attempt to make the FTP experience work more like the standard OS X Finder. One of the best known and most popular of these is Rbrowser (http://www.rbrowser.com/RBrowser_main.html), a commercial application that lets you drag and drop files between a remote FTP server and your local volumes and folders. Rbrowser also supports SFTP (Secure FTP) transfers. SFTP was developed to address the main drawback of using FTP for
451
452
Part III
Networks and Internet
file transfers with sites that require a login and password, which is that your login and password are not encrypted when they are sent over the network, making it relatively easy for someone to intercept your login information.
Telnet and SSH Telnet and SSH (the Secure Shell) were introduced in Chapter 13. As a quick recap, telnet and SSH are two ways to log in on remote hosts over a network. Both require that you have an account on the system that you want to log in on. The primary difference between the two is that telnet connections are not encrypted, while all SSH communications are. This encryption has made SSH much more popular than Telnet. SSH also provides a number of advanced features, such as the ability to automatically forward graphical Unix X Window system client information. This makes it easy to run Unix X Window system applications over an SSH session. (An open source X Window system server known as Xfree86 (http://www.xfree86.org) is available for Mac OS X, as discussed in the Open Source section of Chapter 19.) Telnet is primarily supported for backward compatibility with systems that do not support the SSH protocol, such as many nonUnix systems. Because both Telnet and SSH provide terminal emulation over the network, you don’t need specific clients for either beyond the telnet and SSH applications that you can run inside a Mac OS X Terminal application.
Summary This section provided information about the design and organization of the Internet and many popular network-oriented applications. It also discussed how to configure networking on your Mac OS X system, and how to use OS X’s support for centralized Internet configuration to store information about your mail, Web, and Internet news configurations. Networking facilitates portability—you can access networked data from any location, and can therefore work from almost anywhere from which you can access your data. The next chapter explores using Mac OS X on Apple laptops, and discusses the facilities provided for exchanging data between Mac OS X systems and even more portable devices, such as Personal Digital Assistants (PDAs).
PART 17 Mobile Computing
IV Looking More Deeply at Mac OS X
18 Automating Your Mac with AppleScript 19 Working with Unix
This page intentionally left blank
Chapter 17 Mobile Computing
456
Part IV
Looking More Deeply at Mac OS X
ac OS X is easily the most well-connected operating system available today, due to its out-of-the-box support for today’s most popular networking protocols. Networking enables you to store data in central locations that all users can access and share, and to work on files that are located anywhere—not just at the site where your computer is physically located. Thanks to networking, I can work on files in Japan almost as easily as I can work on files that are stored on my OS X system’s local disk. Networking is the next best thing to being there.
M
Like it or not, today’s world is mobile. Laptops are everywhere—many businesses give their employees laptops rather than desktop computers so that people can access their data regardless of where they’re working from. In combination with wireless networking, using a laptop for work or pleasure is liberating. Combined with Personal Digital Assistants (PDAs), it’s getting easier to be connected to your data no matter where you are. Apple provides two excellent lines of laptops: iBooks and PowerBooks. These systems can run Mac OS X with ease, can easily exchange data with PDAs, and typically include built-in modems, Ethernet connections, and support for AirPort cards, Apple’s wireless networking cards and base stations. This chapter discusses mobile computing under OS X, and highlights ways in which OS X’s superior connectivity and power can make life easier for anyone who needs to be able to get real work done while using a laptop.
Using PowerBook and iBook Hardware Apple is one of the last vendors to sell both an operating system and the hardware necessary to run it. Aside from a few years in the late 1990s when Apple licensed its ROMs to clone manufacturers such as UMAX, PowerTools, and PowerComputing, the only place to buy hardware that would run the Mac OS has always been Apple Computer. The primary reason for this is profit, because Apple and Mac OS fans have to spend all of their hardware dollars with Apple; another reason is that selling hardware makes it easier to invest in developing faster, more powerful, and just plain sexier hardware. I’d like to think that another part of Apple’s motivation for monopolizing the hardware that can run the Mac OS is that this helps them keep both their hardware and software on the cutting edge. For years, there have been tantalizing rumors that Apple is investigating porting
Mobile Computing
Chapter 17
the Mac OS to the x86 platform—a possibility made more plausible today by the fact that Darwin has already been ported to the x86 platform. That leaves only porting the graphical components of Mac OS X to the Intel/AMD world. Many Mac users have their fingers crossed and have been saying prayers, but no luck yet. Apple’s PowerBook and iBook laptop lines are both undergoing almost continual enhancement and expansion. The PowerBook line is targeted toward professionals, and is therefore the more expensive of the two, featuring fast G4 processors, better screens, greater expandability, and a variety of other mix-and-match options. The iBook line is targeted toward students, educators, and general consumers, and features a smaller form factor (size), fast G3 processors, smaller memory capacity, and the same sort of mix-and-match combinations of hard drives, CD-ROM, DVD, and writable CD and DVD technologies. Table 17.1 provides a side-by-side comparison of several iBook and PowerBook models, showing the highest capabilities of each model. Table 17.1 Comparison of Common iBook and PowerBook Capabilities Model
Speed
Screen Size
Std/Max Memory
Disk
CDROM Type
IBook/SE
466 G3
12.1”
64/320MB
10 GB
DVD
iBook
466 G3
15.2”
128/640MB
20 GB
DVD
iBook2
600 G3
14”
128/640MB
20 GB
CDRW/DVD
PowerBook G3
500 G3
14.1”
64/1GBMB
18 GB
DVD
PowerBook
667 G4
15.2”
512/1GB
48 GB
DVD/CDRW
There are other differences between the PowerBook and iBook lines, such as whether there is a built-in microphone (older iBooks didn’t offer one), a PC card slot (older iBooks didn’t have one), the speed of the built-in Ethernet interfaces (the latest PowerBooks have 10/100/1GigaBit Ethernet, while iBooks are limited to 10/100), and the amount of video RAM (8 MB on iBooks, 16 MB on PowerBooks), but they share most other features. Current models from both lines have 2 USB ports and 1 FireWire port, a built-in modem, and so on. Both of these systems run Mac OS X quite well, though the increased memory capacity of the PowerBooks makes them preferable for heavy-duty commercial or business use.
457
458
Part IV
Looking More Deeply at Mac OS X
Battery Life and Power Management Successful portable computing depends on maximizing how long your battery lasts. Apple’s iBooks and PowerBooks advertise that their batteries last for five hours, but that’s fairly optimistic—three hours is more like it in my experience. This section provides some tips for maximizing how long you can use your Apple laptop before it displays the ominous warning “Your system is running on reserve power…” Maximize battery life by minimizing the amount of power the system uses. The first step is to correctly configure the Energy Saver settings in the System Preferences application, as explained in the following task.
Task: Setting Energy Saver Options 1. Click the System Preferences icon from the Dock or your Application folder. The System Preferences application displays. 2. Click the Energy Saver icon, located in the Hardware section. The Energy Saver panel’s Sleep tab displays, as shown in Figure 17.1.
Figure 17.1 The System Preferences application’s Energy Saver panel.
Mobile Computing
Chapter 17
3. Drag the Put system to sleep whenever it is inactive slider to the lowest amount of time that you can tolerate—the minimum is five minutes. This is the amount of time after which your system puts itself into sleep mode, which is a low-power mode that the system can restart quickly from. If you are actively working on a project, five minutes is probably an acceptable amount of time—if you haven’t used your system for five minutes, you’re probably busy doing something else. 4. If you want to configure a different time limit for putting the display to sleep (i.e., turning it off ), click the Separate timing for display sleep checkbox and use the associated slider to set the display sleep timing to something less than the system sleep time you set in the previous step. 5. If you want to configure a different time limit for spinning down the hard disk (that is, temporarily turning it off ), click the Separate timing for hard disk sleep checkbox and use the associated slider to set the hard disk sleep timing to something less than the time you set for the previous two items. 6. Click the Options tab to see other configurable Energy Saver items. Activate the Show battery status in menu bar option to see how much battery power remains. 7. Select the System Preferences menu’s Quit System Prefs command (or use the hot key combination Å+Q) to exit from the System Preferences application. The following tips can help extend your battery life: ◆ If you are using a PowerBook, remove any PCMCIA cards you are not using. PCMCIA cards consume some power even when not actively being used. ◆ Turn off your laptop when you aren’t using it. Activating the sleep settings, as described in the previous task, saves power and minimizes restart time, but turning it off saves even more power than sleep mode. ◆ If you are not using AppleTalk and it is active in your current network location, deactivate AppleTalk in the System Preferences application’s Network panel. ◆ If your iBook or PowerBook has an AirPort card and you aren’t using the network, switch to a location that does not use the AirPort card. Wireless networking consumes some power even when you are not actively using it.
459
460
Part IV
Looking More Deeply at Mac OS X ◆ If you are not using networking at all, an easy solution that encompasses the previous two suggestions is to create a networking location in the System Preferences application’s Network panel that does not include the modem or any of your system’s network devices—perhaps naming it “Networking Off.” Then simply select this location to disable networking. ◆ Use the System Preferences application’s Sound panel to mute the sound on your system. ◆ Use the System Preferences application’s Display panel to minimize the screen’s brightness and reduce displayed colors to the lowest number available. ◆ Minimize the number of times you save your work. Writing to the disk uses power, and also causes your system to wake up the hard drive if it has been automatically spun down.
Some of these suggestions may seem trivial, but when using your laptop on battery power, every little bit helps. The next section provides some tips for using your laptop on the road—not necessarily power-saving tips, but usability tips that cover some things that may not immediately spring to mind.
TIP While earlier versions of the Mac OS supported multiple Energy Saver settings for battery and wall power, OS X only offers one. If you’re using your laptop, make sure that you tweak the System Preferences application’s Energy Saver settings appropriately.
Tips for Travelers NOTE You must disable your AirPort card when using your iBook or PowerBook when traveling, because it is illegal to use wireless networking cards on an airplane. Also, you shouldn’t use your AirPort cards in France, as the frequency used by AirPort cards interferes with French military and police frequencies.
People who are not seasoned travelers may not realize that other countries use electricity that runs at different voltages and cycles than their native power.
Mobile Computing
Chapter 17
Similarly, electrical plugs are not universal—outlets in the US use two parallel prongs, one of which is slightly wider than the other, while outlets in the UK use two pin plugs, and other countries use outlets in which the positive and negative prongs are rotated 90 degrees from one another. International power adapters, available at most local electronics or drug stores, contain a transformer for converting between foreign and native power requirements, and come with adapters that let you plug in your laptop’s power adapter. PowerBooks and iBooks can automatically use different types of power as long as you have the right cord or plug. Purchase an extra battery and keep it charged. I generally charge one battery during the evening, and then switch batteries and charge the other while I’m sleeping. Rotate your laptop batteries if you have more than one, to ensure that they can be charged successfully and will retain that charge for a reasonable period of time. Make sure that your computer is actually off (and not just in sleep mode) when swapping batteries, or else you will lose data. It’s easy to overlook file backup when you’re on the road. Though iBooks and PowerBooks no longer come with floppy drives, a USB or FireWire floppy or Zip drive is a good investment. However, these are not protection against total catastrophes such as having your laptop and luggage stolen or living through a hotel fire. Why take chances? When I’m on the road, I usually e-mail myself copies of files I’m actively working on. If you configure your laptop mail application to leave copies of your mail on the mail server, you can use your mail server as a convenient, though somewhat cheesy backup mechanism. Mail only smaller files or at least compress them to avoid being confronted by an angry system administrator on your return. For more information about backing up and synchronizing data from your laptop to a desktop system or remote fileserver, see “Communicating with Other Computers,” later in this chapter.
Using Software on Laptops Improvements in laptop computers have had an interesting effect on software utilities that are targeted toward the mobile computing market. In days gone by, laptops were relatively underpowered and had limited memory capacity and small screens. As you can see in Table 17.1, even the early iBooks could have up to 340MB of memory and had relatively fast CPUs. Today’s iBooks and PowerBooks are not your father’s laptop!
461
462
Part IV
Looking More Deeply at Mac OS X
Software that is specifically targeted toward laptops and mobile computing tends to address a variety of issues: ◆ Improving memory handling. ◆ Maximizing the usability of a relatively small screen. ◆ Making it easier to locate, launch, and switch between applications. ◆ Improving connectivity to remote computer systems and networks. ◆ Simplifying backing up and synchronizing data with desktop systems or file servers. Software customized for the laptop market is simply not as necessary today— screens are larger, CPUs are faster, and memory capacity is higher. Some of the inherent capabilities of Mac OS X (such as protected memory and true virtual memory) and the Aqua GUI make it easy to get the same performance and stability out of a laptop that you can get out of a desktop system. The next few sections explore how the combination of Mac OS X and today’s sexier laptops “automagically” address many of these issues, and suggest utilities that you may find useful when using Mac OS X on the road. The last two topics, connecting to remote computer systems and backing up and synchronizing your data there, are discussed together in “Communicating with Other Computers” later in this chapter.
Memory Management on Laptops Mac OS X features protected memory, which means each application can allocate and manage its own system memory use without worrying about other applications sharing or accessing that same memory. Unix does this through efficient memory allocation and an integrated virtual memory system that avoids the problems associated with virtual memory on earlier versions of the Mac OS. On these earlier versions, virtual memory was often turned off due to generally poor performance. Virtual memory has been built into Unix since the early 1980s and, though still constrained by the speed at which the system can read and write to the disk, it’s quite efficient. Utilities such as Connectix’s RAM Doubler were extremely useful because they essentially replaced the inefficient Mac OS virtual memory management subsystem. RAM Doubler used techniques such as using file mapping to minimize memory requirements and free up RAM that wasn’t actually being used, improving how the Mac OS used the hard drive as a temporary swap space for applica-
Mobile Computing
Chapter 17
tions that weren’t actively running, and compressing data that was in memory but wasn’t actively being used. With Mac OS X, these techniques are either no longer necessary or are incompatible with the Unix virtual memory subsystem. Unix provides efficient memory management and an efficient virtual memory subsystem. In addition, today’s laptops can support much higher amounts of memory than older laptops—and memory itself is much cheaper.
Managing Screen Space on Laptops The quest for larger screens and better use of screen real estate is endless. This is especially true on laptops, which necessarily have smaller screens than desktop computer systems. Techniques such as the WindowShade control panel provided by earlier versions of Mac OS attempted to simplify working with multiple applications and associated windows. WindowShade made it possible to click on the title bar at the top of a window and “roll up” the application so that only the title bar was visible. Other graphical computing systems have always supported minimizing applications, which meant replacing the application window with an icon on the screen. Many people felt that Apple’s WindowShade was a half-hearted attempt to provide the same functionality. An inexpensive utility called WindowShade X (http://www.unsanity.com/haxies/wsx) provides this capability, but the OS X dock largely removes the need for this sort of thing. The window controls built into Aqua include a yellow minimization button—click it to instantly minimize an application window to the Dock. An interesting utility that helps address the need for more screen space is SpaceDock (http://space.sourceforge.net). This application for the OS X Dock provides a number of virtual screens that you can switch between by selecting them from the SpaceDock menu.
Launching and Managing Applications The Mac OS has always made it easy to change settings and locate and launch specific application by letting you create aliases or by using applications such as the Control Strip. Part of the need for aliases is because, unlike those for most other computer systems, most Mac OS applications for versions of the Mac OS before Mac OS X could be installed anywhere on your disk. It could be a chore to
463
464
Part IV
Looking More Deeply at Mac OS X
remember where you’d installed applications, as could navigating to that folder to execute them. But making many aliases led to significant screen clutter, which made it hard to find the alias. Apple attempted to address this by providing its Control Strip application, which provided convenient access to many applications and control panels from an application that was always running on the desktop. A variety of third-party applications, such as DragStrip, GoMac, The Tilery, and DragThing, were all small docking applications that floated on the desktop and provided convenient shortcuts to your applications. Some of these, such as DragThing, are also available for Mac OS X. A version of DragThing for OS X is available at http://www.dragthing.com. You still can create aliases to your applications on the Mac OS X desktop, but the need for special aliasing applications has largely been replaced by the OS X Dock. Dragging the icon for your favorite application to the OS X Dock creates a copy of the icon there, which automatically starts that application when clicked. You can use the Dock panel in the OS X System Preferences application to control which edge of your screen the Dock is located on (Mac OS X 10.1 and later), and you can configure the Dock so that it appears only when you position the cursor at that edge of the screen.
Working with PDAs Sometimes a laptop computer is still too large to easily work with. It’s often more trouble than it’s worth to boot your laptop to jot a note or check your schedule— which is why people still carry pocket planners and tiny notebooks. The same improvements that have eliminated many of the differences between laptops and desktop computer systems have given birth to a whole new tool— pocket-sized computers known as PDAs (Personal Digital Assistants). These are small, memory-based computers that fit in a purse or shirt packet and provide a set of applications such as a personal calendar, to-do list, notepad, and often a small sketching application. PDAs are designed to replace pocket planners and paper notepads by making it easy to enter, access, and modify data. Many PDAs support limited forms of handwriting or printed character recognition because they’re simply too small to provide a keyboard. Though desktop/PDA synchronization software has been available for a relatively long time for Microsoft Windows systems, until recently there has been a distinct
Mobile Computing
Chapter 17
absence of this sort of software for Macintosh systems. This made it a hassle to keep PDAs up to date. There wasn’t any easy way to export information from your desktop computer to your PDA, so you ended up entering the same information twice, once on your desktop or laptop computer system, and once on your PDA— a tedious proposition. There are two general solutions: one is to simply transfer files back and forth between your PDA and another computer system, and the other is to use software that uses the same format for files on both systems and lets you synchronize the contents of those files. Whether transferring files to your PDA is useful depends on the software available on your PDA. For example, if your PDA uses its own data and file formats, being able to transfer files in either direction isn’t useful because that data isn’t in a format that your PDA can use. But there is hope for the future. For example, Sharp’s new Zaurus 5000 PDA runs an embedded version of Linux as its operating system, uses Flash memory cards for long-term data storage, and comes with a USB-equipped cradle that serves as a network device on Linux systems, letting you transfer files using standard networking utilities. As USB connections become more prevalent on PDAs, USB drivers that enable you to access your PDA as a storage or network device will become more common. Until then, your best bet for backing up and synchronizing files between your PDA and a desktop or laptop computer is software that either lets you work with files in the same formats on both your PDA and a desktop or laptop computer, or which lets you export data from your Mac applications in a format that your PDA can use. Luckily, this is changing rapidly—users of Palm PDAs can synchronize the data between their Palm PDA and Macintosh computer system thanks to the Palm Desktop, which can be freely downloaded for Mac OS X at the URL http://www.apple.com/downloads/macosx/productivity_tools/ palmdesktop.html. The Palm Desktop is written for Mac OS X, and it makes it easy to create and work with the same files on both systems. Figure 17.2 shows the Palm Desktop software. The Palm Desktop requires either a USB-equipped Macintosh system and a Palm cradle that also supports USB, or a modem on both systems. The current version of the Palm Desktop does not support Infrared (IR) synchronization using the IR port found on the PowerBooks.
465
466
Part IV
Looking More Deeply at Mac OS X
Figure 17.2 The Palm Desktop for Mac OS X.
NOTE Owners of other PDAs can also use the Palm Desktop, thanks to software such as The Missing Sync, a utility from Mark/Space (http://www.markspace.com/missingsync.html) that enables Sony Clie owners to use the Palm Desktop to back up and synchronize files between their Macs and Clie PDA. However, be careful – the Palm desktop is only designed for and supported for use with Palm PDAs (at least by Palm).
The Palm Desktop software consists of four modules that match the four standard Palm PDA applications: the Address Book, the Date Book, the Memo Pad, and the To Do list. Access any of these modules by selecting the appropriate icon from the Palm Desktop toolbar, or by selecting the appropriate entry from the View menu (to view or edit your existing entries in any of these applications) or the Create menu (to create a new entry in any of these applications). You also can use the Palm Desktop to create notes that, when transferred to the Palm, appear as memos attached to the associated Address Book, Date Book, or To Do list entries.
Mobile Computing
Chapter 17
When you install the Palm Desktop on your OS X system, you are prompted for a user name, which is used to create a folder that holds the data you are synchronizing with your Palm. This lets the Palm Desktop work on a Mac OS system that is shared among multiple users, each of whom has his own user name and associated folder. The HotSync Manager intelligently synchronizes data between your Palm and the Palm Desktop by using conduits—the synchronization agent for each supported application, as well as a general Backup conduit for preserving data not associated with one of the standard Palm Desktop modules. Some third-party Palm applications also provide specialized conduits that you can use to synchronize the data used by those applications—however, make sure that these were designed for use with Mac OS X. Use the Palm Desktop to install applications on your Palm by selecting the HotSync menu’s Install Handheld Files option. This displays the dialog box shown in Figure 17.3, which lets you select applications for installation by browsing for the PRC (Palm Resource Code) files associated with the applications that you want to install. The following task explains how to synchronize data with your Palm using the Palm Desktop Software.
Figure 17.3 The Palm Desktop application’s Install Handheld Files dia-
log box.
467
468
Part IV
Looking More Deeply at Mac OS X
Task: Synchronizing Software with Your Palm 1. Click the Palm Desktop icon from the Dock or in the Palm folder in your Application folder. The Palm Desktop application displays, as shown in Figure 17.2. 2. If you are using a cradle, place your Palm in the cradle and attach it to your Mac’s USB port. If you are using a PalmConnector cable, connect it to the Palm and plug the other end into a USB port on your Mac. If you are using the modem and a null-modem cable, connect it to your Palm modem and connect the other end to your Mac’s modem port. Turn on the Palm. 3. Select the HotSync menu’s User command and verify that the correct user is selected. Because the name of the selected user determines the data files that will be synchronized with your Palm, you must select the correct user or you’ll get someone else’s data. If you have never synchronized data before and your user name is not visible, select the Edit Users command from the Users menu. This displays the dialog box shown in Figure 17.4, where you can create a new user. 4. Select the HotSync menu’s Setup command to display the HotSync Software Setup dialog box, as shown in Figure 17.5. 5. Verify that the Enabled radio button is selected and select it if it is not. To simplify this process in the future, click the checkbox beside the Enable HotSync software at the system startup label. 6. Click the Connection Settings tab to verify that the correct connections are enabled. The dialog box shown in Figure 17.6 displays.
Figure 17.4 The Palm Desktop application’s HotSync Users dialog box.
Mobile Computing
Chapter 17
Figure 17.5 The Palm Desktop application’s HotSync Software Setup
dialog box.
Figure 17.6 The Connection Settings dialog box in the HotSync Software
Setup dialog box.
7. Select the Internal Modem, PalmConnect (the Palm serial-to-USB connector for older Palms), or the USB port, and click the red close button to close the HotSync Software Setup dialog box. 8. Click the HotSync button on the cradle. If you are using a cable without a HotSync button, open the HotSync application from the Palm’s Applications Launcher, and click the HotSync icon. A message displays on the Palm and the Palm Desktop when synchronization is complete.
469
470
Part IV
Looking More Deeply at Mac OS X
That’s all there is to it! If you have problems using the Palm Desktop or synchronizing software using the HotSync software, see the extensive online help available for the Palm Desktop on OS X.
Communicating with Other Computers One of the themes in this book has been the well-connected nature of Mac OS X. All iBooks and PowerBooks contain both built-in modems and Ethernet connections, which make it easy to connect to other computer systems and networks. The OS X Finder provides built-in support for today’s most popular networking protocols, making it easy to connect to AFP fileservers, SMB shared directories, NFS fileservers, and WebDAV filesystems, and transfer files by dragging and dropping. Once, communicating with the mother ship while you were on the road involved dialing in to your company’s computer systems using a terminal emulator on your Mac, then using some built-in serial file transfer protocol, such as Kermit, Xmodem, Ymodem, or Zmodem, to transfer files. Today, networks are everywhere, and even serial communication by modem is done using PPP. You can put your laptop on your local network or establish a PPP connection to your ISP, company, or university and have instant connectivity. Aside from reading e-mail, the most important reason to connect your iBook or PowerBook to your network is to back up your working files. Backups protect against the accidental file deletions, but more importantly, they protect against catastrophes such as hardware failure or theft. Nothing is worse than losing your data. The remainder of this section summarizes some of the mechanisms and applications that you can use to back up critical data files from your iBook or PowerBook. The simplest way to back up files from your laptop to a remote system is to mount a volume exported by the remote system on your Desktop and then simply drag and drop the files. This approach is quite slow because it doesn’t optimize or compress the data. For extremely large files, this can be quite time-consuming. The alternatives are to either create a compressed archive of the files to back up and then transfer the archive, or to use a utility such as the Unix rsync utility, which lets you synchronize local and remote files and directories, transferring only the differences and supporting compression during the transfer. See the OS X rsync man pages for more information about using rsync.
Mobile Computing
Chapter 17
A variety of applications let you easily create compressed archives on your Mac. The most common is Aladdin Systems’ StuffIt (http://www.aladdinsys.com). All Macs come with a free copy of Aladdin Systems’ StuffIt Expander, which uncompresses archives created with StuffIt. You can purchase or download demonstration versions of StuffIt Deluxe or StuffIt Lite, both of which include the compression part of StuffIt (which you need to create StuffIt archives) from the Aladdin Web site. Unix fans will find a variety of free archival and compression applications included with the Unix part of Mac OS X. Utilities such as tar, cpio, and pax can be executed from within the OS X Terminal application. These let you create archive files that recursively contain the contents of your directories. Use these archival applications to create an archive file called today.archive from the contents of your Documents directory by using one of the following command lines: tar cf today.archive Documents find Documents –print | cpio –o > today.archive pax –w –f today.archive Documents
For more information about any of these popular Unix backup applications, use the Unix man command in the Mac OS X Terminal application, as explained in Chapter 19. The archive files produced by these applications are not compressed, but you can subsequently compress them using the gzip command. An example of using the gzip command with maximum compression on the file today.archive is the following: gzip –9 today.archive
This command produces the output file today.archive.gz, which you can then transfer to a remote computer by dragging and dropping it to a networked drive or by using the ftp, sftp, or scp (secure copy) applications from the Mac OS X Terminal application.
NOTE You should not use gzip to back up Macintosh applications because gzip does not understand the resource fork component of Mac OS files. It’s fine for text files, but not for applications.
471
472
Part IV
Looking More Deeply at Mac OS X
Creating a local archive and then transferring it to a remote system also provides a local snapshot of files and directories in case you accidentally delete them. However, it can be time-consuming. An easier approach is to use the Unix rsync command from the Mac OS X Terminal application to synchronize local and remote copies of a specified directory. The rsync command creates the remote directory if it does not exist, minimizes the amount of data transferred by sending only the differences between the local and remote files and directories, and can automatically compress data as it transfers it, automatically uncompressing it on the remote target system. The following command line shows an example of creating a remote copy of your local Documents directory on the remote host backup.vonhagen.org: rsync –az Documents backup.vonhagen.org:
You are prompted for your password on the remote system before the transfer actually begins. In this example, the directory Documents and all of its contents are synchronized with the contents of any existing Documents directory in the home directory of the current user on the remote host backup.vonhagen.org. To synchronize or create these files in a different directory on the remote host, specify the path name to that directory after the colon that follows the name of the remote host. By default, the rsync command assumes that your user name is the same on the local and remote host. To specify a different user name on the remote host, specify the remote host name as user@host. An alternative to network backups is to purchase a removable media drive (if your iBook or PowerBook does not have a CD-RW drive). Back up your data to removable media using one of the popular backup utilities available for Mac OS X, such as LaCie’s SilverKeeper (http://www.silverkeeper.com/), a free utility, and Dantz Development Corporation’s Retrospect backups software (http://www.dantz.com), a commercial but time-tested Macintosh backup application. Just remember that if your luggage is stolen, you may lose the backup disks along with the laptop. If you want to do physical backups while traveling, consider mailing them back to your home, so that you’ll still have them if your laptop is stolen.
Mobile Computing
Chapter 17
Summary This chapter explored the most important issues in using portable computers running Mac OS X. Many of the limitations of using a laptop on the road have been removed by hardware advances, the utilities and capabilities of Mac OS X, or a combination of both. However, some fundamental issues still remain, such as maximizing battery life and backing up files while traveling. This section also highlighted ways of using your Apple iBook or PowerBook in combination with even more portable computing devices, such as PDAs. In the next chapter, you’ll explore AppleScript, an easy way of writing applications using a scripting language that has been built into the Mac OS, but is even more powerful and appropriate under Mac OS X.
473
This page intentionally left blank
Chapter 18 Automating Your Mac with AppleScript
476
Part IV
Looking More Deeply at Mac OS X
nyone who has ever used a computer other than a Macintosh has probably used command files of some sort. On command-line oriented operating systems, command files are executable files that work and look like applications, but are a set of operating system commands executed in sequence by your operating system’s command interpreter. These command files are often referred to as scripts. Unix users have their shell scripts (discussed in Chapter 19) and DOS/Windows users have their batch files. And what do Macintosh users have? Something even better!
A
AppleScript is a scripting language for the Mac OS that understands how to control and interact with many of your Mac OS X applications, including fundamental parts such as the Finder. AppleScript has been available in the last few versions of the Mac OS, but has been turbocharged by the move to Mac OS X because all of the objects and methods in the Cocoa framework can now be accessed through AppleScript. Not only can you script graphical applications, but AppleScript on Mac OS X also enables you to incorporate Unix shell scripts and calls to Web services using XML into your AppleScripts. The most recent versions of AppleScript and Mac OS X have also added support for the Simple Object Access protocol (SOAP) and eXtensible Markup Language Remote Procedure Calls (XMLRPC), extending the reach of AppleScript to the Web and other Internet-based services. This chapter provides background information about AppleScript, explains how to use the AppleScript-related software included with Mac OS X, and how to write, test, debug, and use AppleScript to make your Mac work the way you want it to. AppleScript makes it easy to quickly create those simple applications that you always wished you had.
What Is AppleScript? AppleScript is a language that lets you tell existing applications what to do through a series of high-level commands. AppleScript works by providing access to the objects and methods inside your Mac OS X applications and the system itself. AppleScript relies on Apple events, introduced with System 7, which provide an open, object-oriented model for communication between different applications. Prior to System 7, double-clicking on an icon in the Finder explicitly called a routine that executed that application. With System 7, this same behavior was generalized into an object-oriented mechanism, where double-clicking on an
Automating Your Mac with AppleScript
Chapter 18
icon sent an “open” message to the application associated with that icon, and the application then performed the appropriate action. Enabling applications to exchange messages allows applications to notify each other that certain events have occurred, and to react appropriately. To formalize this approach to application interaction, Apple introduced its Open Scripting Architecture (OSA), which defined a standard Application Programming Interface (API) for creating scriptable applications and implementing scripting languages. The OSA also provided the Apple Event Manager, a system-level component that enables applications to respond to events issued by scripting languages. With System 7.5, Apple introduced AppleScript, its own scripting language, which has undergone continual improvement and integration since. The easiest way to clarify the differences between writing an application in programming and scripting languages is to show an example of each. Here’s a minimal example of the code necessary to create a folder with “Backup” in the C programming language: #include <sys/types.h> #include <sys/stat.h> int mkdir(const char *path, mode_t mode); int main(int argc, char **argv) { int rc; rc = mkdir("Backup", S_IWXRU|S_IRWXG|S_TROTH|S_IXOTH); return 0; }
Here’s the equivalent AppleScript code: tell application "Finder" activate make new folder with properties {name:"Backup"} end tell
These examples show the differences in readability and clarity between the two approaches to creating an application. Scripting languages for the Macintosh are nothing new, though scripting languages themselves are somewhat alien to the notion of a graphically oriented machine since it is usually difficult to select and manipulate graphical objects. In the mid-1980s, a scripting application called HyperCard made it easy for people
477
478
Part IV
Looking More Deeply at Mac OS X
to develop their own command files, known as stacks (of cards) that could do almost anything. HyperCard was amazingly popular, primarily because it was a high-level language that was easy to learn, write, and debug. This ease of use encouraged many people who weren’t hard-core programmers to experiment with HyperCard. For most people, writing a 4,000-line C program was out of the question. However, writing a 100-line HyperCard stack, more or less in English, was much more accessible. HyperCard faded away, largely because the everincreasing capabilities of AppleScript didn’t require a special interpreter such as HyperCard. Other scripting languages have come and gone on the Macintosh. UserLand’s Frontier scripting language (http://frontier.userland.com) is still quite popular. I prefer AppleScript for most tasks because it doesn’t require any third-party software, which makes it easy to share and trade useful AppleScripts with other Macintosh users. Apple’s continuing commitment to and support for AppleScript make it the easiest, most attractive, and most cost-efficient out-of-the-box solution for scripting on the Macintosh platform. With the introduction of Cocoa, the totally objectoriented framework for developing and supporting Macintosh applications, AppleScript has the potential to become even more powerful and pervasive. AppleScript support can be added to any Cocoa application because of its core object/method orientation. This commitment to AppleScript is revealed by the fact that the AppleScript Script Editor and Script Runner applications are now featured rather prominently in the Application folder’s AppleScript folder. Though all OS X applications use the Apple Event Manager, you can write AppleScripts only for scriptable applications. Two aspects determine if an application is scriptable—whether AppleScript itself can interact with the application, and whether the application can tell the script editor what it’s doing so it can automatically generate AppleScript code. As you’ll see later in this chapter, in OS X, you can write scripts that create files and folders in the OS X Finder, copy and delete files and folders, and so on, but the Finder isn’t currently recordable. You’ll have to write the AppleScript code that executes Finder commands by hand for now. As of Mac OS X 10.1.4, the version available when this book was written, you can write AppleScripts that interact with a huge number of built-in OS X applications, including
Automating Your Mac with AppleScript
Chapter 18
◆ Apple System Profiles ◆ ColorSync ◆ Finder ◆ Image Capture ◆ iMovie ◆ iTunes ◆ Mail ◆ Print Center ◆ QuickTime Player ◆ Sherlock ◆ Terminal ◆ TextEdit You can also write AppleScripts that interact with a huge number of third party OS X applications, including: ◆ Adobe Illustrator, InDesign, Photoshop ◆ Aladdin StuffIt, StuffIt Expander ◆ BBEdit ◆ FileMaker Pro ◆ Microsoft Entourage, Excel, PowerPoint, Word ◆ Netscape ◆ OmniGraffle, OmniWeb ◆ Quark XPress ◆ SnapZ Pro Only some of the applications support AppleScript under Mac OS X. More are being added every day. Apple’s commitment to AppleScript also shows in the tremendous amount of information about it on Apple’s Web site. A good starting point for AppleScript information is http://www.apple.com/applescript. For AppleScript information specific to Mac OS X, start at http://www.apple.com/applescript/macosx. This page presents information about using AppleScript with Mac OS X. It also provides a number of downloadable AppleScripts that are intrinsically useful and are great examples for writing your own AppleScripts.
479
480
Part IV
Looking More Deeply at Mac OS X
Scripting Fundamentals AppleScript support is built-in to the Mac OS, so it doesn’t require a special command interpreter to play back your AppleScript command files. It also doesn’t require a special program to create your scripts—you can write an AppleScript in any text editor as long as you subsequently set your script’s type to OSAS and its creator to ToyS. However, OS X includes a special program called Script Editor, which has some nice features. For example, the Script Editor understands the syntax of the AppleScript language, so it can automatically highlight AppleScript keywords, check the syntax of your AppleScripts before you save them, and automatically set the right file type and creator information. If you use another application to create AppleScripts in text format, you must use the Script Editor to compile them and save them in compiled script format so they can be used by applications that expect this format. You also have to use the Script Editor if you want to compile your AppleScripts into standalone applications. Though I’m a big AppleScript fan, AppleScript support still has room to grow on Mac OS X. If you’ve used AppleScript before, you’ll find that some capabilities aren’t available yet under OS X. The most irritating omission is that the Finder is not currently recordable, which means that the Script Editor can’t automatically write standard file/folder manipulation scripts for you by keeping track of your actions in the Finder under OS X. When running under Mac OS 9, for example, you can tell the Script Editor to watch your actions as you create files and folders in the Finder and move them around, and the Script Editor will automatically generate AppleScript code. The OS X Finder doesn’t support this capability yet. For now, to create an AppleScript that uses Finder commands, you must either create one in the Script Editor, or boot your system in Mac OS 9 and use its Script Editor there.
NOTE Most of the applications that currently support AppleScript are also recordable. You can use the Script Editor’s Record function with all of the commands listed in the introduction to this chapter with the exception of the OS X Finder.
The next few sections explain how to do the basic tasks required to write and compile an AppleScript. They also provide an example of designing everybody’s
Automating Your Mac with AppleScript
Chapter 18
favorite first AppleScript, a simple application for creating backup copies of selected files and directories.
Using the Script Editor On Mac OS X systems, the Script Editor is located in your Application folder’s AppleScript sub-folder. The following task explains how to start the Script Editor and create a new script.
Task: Creating a New AppleScript 1. Open the Applications folder by clicking the Applications icon in the Toolbar of a Finder window or by navigating to the \Applications folder on your system’s boot drive. 2. Double-click the AppleScript folder to open it, and double-click the icon for the Script Editor application. A window labeled untitled displays, as shown in Figure 18.1.
Figure 18.1 The Script Editor window for a new AppleScript.
3. Click the Description field and enter a short description of your new AppleScript. 4. Click the bottom field of the window to begin entering your AppleScript commands. Writing an AppleScript is much easier than writing in any traditional programming language. One of the primary goals of any computer application is to save time by encapsulating a number of related tasks and letting you do them by running the program rather than by repeating them. The next section explains how to
481
482
Part IV
Looking More Deeply at Mac OS X
use the Script Editor to automatically create a program by monitoring and recording your actions. You can use this record as the basis for your AppleScript application, or compile it to serve as the program itself. Compiling AppleScript applications, which means rewriting them in a fashion that your computer can quickly and easily execute, is explained later in this chapter.
Generating a Script The Script Editor takes usability to new heights through its ability to record your actions and use them as the basis of an AppleScript. The first step when designing an application in a traditional programming language is to walk through the sequence of actions that you want the program to perform for you. Using the Script Editor’s Record mode, you automate that step by simply turning on the Script Editor and then performing the actions that you want your script to do, while the Script Editor automatically generates the AppleScript code for those actions. Programming doesn’t get any easier than that. The following task shows how to activate the Script Editor’s recording feature, and how to generate the code for a classic AppleScript application, a personalized backup program.
NOTE As mentioned earlier, the biggest drawback of AppleScript under OS X is that the Finder itself is not currently recordable. For this reason, the example in this section is done in Classic mode, where the Record function is still supported. I have my fingers crossed that Apple will make the Finder recordable in an upcoming release of OS X. Until then, you have to manually create the Finder-oriented Mac OS X AppleScripts.
Task: Recording an AppleScript This example is done using the Mac OS 9 Script Editor because this functionality is not available in the Mac OS X Script Editor. 1. Start the Script Editor. To find the Mac OS 9 Script Editor, open the Applications folder on your Mac OS 9 volume, open the Apple Extras folder, open the AppleScript folder, and double-click the Script Editor icon. The Mac OS 9 Script Editor appears, as shown in Figure 18.2.
Automating Your Mac with AppleScript
Chapter 18
Figure 18.2 The Mac OS 9 Script Editor window for a new AppleScript.
2. Enter My Backup Script as the description of your AppleScript, and click the Record button. 3. Perform the actions that you want the Script Editor to remember for you. To produce the code shown in Figure 18.3, click the background of the desktop to activate the Finder, press Å+Shift+N to create a new folder on the desktop, and type Backup to rename the untitled folder Backup. 4. To stop recording, hold Å and press Tab until the Script Editor is the active application again, and click the Stop button. The Script Editor now contains the code shown in Figure 18.3.
Figure 18.3 Sample recorded AppleScript code in the Script Editor.
483
484
Part IV
Looking More Deeply at Mac OS X
Saving and Compiling Your Script Writing the world’s greatest AppleScript isn’t much good unless you save it in a format the Script Editor supports, so you can execute or edit it. You can save your AppleScript in several ways: In most programming languages, the process of turning your code into an application is called compiling that application. AppleScript requires no separate step. You compile when you save your script and select an output format in the Script Editor. The following task explains how to save and compile your AppleScript. Because the previous section showed how to record an AppleScript in the Script Editor under Mac OS 9, this section shows the Script Editor dialog boxes for saving scripts in both OS 9 and OS X.
TIP Before saving an AppleScript, especially one that you’ve hand written, click the Script Editor’s Check Syntax button to use the automatic syntax checker. This doesn’t guarantee that your AppleScript will do what you want it to do, but it does verify that it contains valid AppleScript commands. If your script is syntactically correct, the Script Editor highlights keywords in your script and exits without complaining. If your script contains any incorrect or unsupported commands, the Script Editor displays a pop-up message describing the error, and highlights the section containing the problem.
Task: Saving an AppleScript in the Script Editor 1. When you’re ready to save your AppleScript, select the File menu’s Save Command. If you’re using the Script Editor under Mac OS 9, the dialog box shown in Figure 18.4 appears. If you’re using the Script Editor under Mac OS X, the dialog box shown in Figure 18.5 appears.
TIP If the Save dialog box in the OS X Script Editor doesn’t show the navigation fields for selecting the volume and directory you want, click the down-arrow for the drop-down menu beside the field labeled Where. This displays the standard navigation fields and related buttons shown in Figure 18.5.
Automating Your Mac with AppleScript
Chapter 18
Figure 18.4 Saving a script in the Mac OS 9 Script Editor.
Figure 18.5 Saving a script in the Mac OS X Script Editor.
2. Navigate to the folder where you want to save the AppleScript, and enter the name to save it as. 3. Select the format for your script by selecting it from the Format field’s drop-down menu. Your choices are: ◆ Text: Saves the AppleScript as a text file that is still associated with the Script Editor. Use this option to save your in-progress scripts, or to save your AppleScripts in a format that you can edit on other computer systems.
485
486
Part IV
Looking More Deeply at Mac OS X ◆ Compiled Script: Saves the AppleScript in a compiled format. Your OS X system recognizes it as an AppleScript, but opens it in the Script Editor rather than executing it. This is the default choice because many applications that execute AppleScripts expect this format. ◆ Application: Saves your AppleScript as a compiled application that you can run. You typically save an application under a different name than the AppleScript source file’s name, so you can move the application to a different location but still edit the source code in your working directory.
NOTE If you save your AppleScript as an application, two additional options display at the bottom of the Save dialog box: selecting the Stay Open checkbox keeps the AppleScript running in the background of your OS X system, and selecting the Never Show Startup Screen option prevents your AppleScript from displaying an AppleScript splash screen that displays its description whenever you run it.
4. Click the Save button to save your AppleScript in the selected format. The previous three sections provided basic information about using the Script Editor to create, generate, save, and compile scripts. The next section walks you through creating a simple AppleScript to do a simple backup utility.
Writing a Sample AppleScript You generally don’t learn a language until you want to use it. The following task walks you through creating a simple backup script, taking advantage of the capabilities of AppleScript to incrementally add features and flexibility until you have a drag-and-drop backup application that takes only 15 lines of AppleScript code. The last C Language program that I wrote with a similar amount of code was Hello, World! The sample AppleScript in this section shows the power of a scripting language, and also demonstrates most of its constructs, such as objects, properties, variables, conditionals, list handling, and event handlers. The backup script will initially cre-
Automating Your Mac with AppleScript
Chapter 18
ate a backup folder on the desktop and then copy a specific folder into that folder. As you go along, you’ll add a few bells and whistles, such as giving the backup folder a different name based on the month and day on which it was created, and will then generalize the script by adding drag-and-drop capabilities, so that it backs up any files and folders that you drag and drop onto its icon.
Task: Writing a Backup Application in AppleScript 1. Start the Script Editor as explained earlier in this chapter and enter My Backup Script as the description of your AppleScript in the Description field. 2. Click the cursor in the AppleScript window in the lower half of the Script Editor dialog box, and enter the AppleScript commands shown in Figure 18.6. This figure shows a block of code called a tell block, which is a sequence of instructions to a single application (in this case the Finder). These instructions make the Finder the active application on your system and then create a folder named Backup on the desktop. The Make New Folder command in Figure 18.6 demonstrates the use of properties, which are just different attributes of an object that you can address separately. In this case, the AppleScript command sets the name property of the folder you create to Backup. This is the equivalent of creating a new folder in the Finder and then changing its name from untitled folder to Backup, but all in one step. 3. Click the Script Editor’s Run button. A folder named Backup is created on the desktop, as requested. That was pretty satisfying, so try it again— oops! An AppleScript error displays, as shown in Figure 18.7, because the folder already exists. The first bug! 4. Add some AppleScript code to test whether the folder exists and create it only if it doesn’t. Figure 18.8 shows the code for the backup script with the line that creates the Backup folder enclosed in an if statement that tests whether a folder named Backup exists on the desktop and creates the folder only if it does not already exist. 5. Click the Run button to execute the script again—voilà! No more error message. As a test, delete the existing backup folder on the desktop by
487
488
Part IV
Looking More Deeply at Mac OS X
Figure 18.6 Creating a Folder on the desktop in AppleScript.
Figure 18.7 An AppleScript error message in the Script Editor.
Figure 18.8 Conditionally creating a folder in AppleScript.
Automating Your Mac with AppleScript
Chapter 18
dragging it to the Dock’s trash can, and then run the script again—the Backup folder is recreated. 6. Add some AppleScript commands to copy an existing folder into the new Backup folder. Figure 18.9 shows the duplicate folder AppleScript command. The command in this example tells AppleScript which disk and folder contains the folder to duplicate, and then specifies the location to which you’re copying it. (Specify the name of a folder that exists on your machine, rather than typing exactly what’s shown in Figure 18.9.) To make this more readable, end each line except the last with the AppleScript line continuation character, which you generate by holding Option while pressing Return. This special character tells AppleScript that the AppleScript command interpreter should continue reading the command from the next line.
Figure 18.9 Duplicating a folder into another folder in AppleScript.
7. Click the Run button to test the script. The Finder displays a standard progress dialog box as it copies the folder to the Backup folder on the desktop. When the command finishes, it displays a small dialog box labeled the result, which simply summarizes the actions performed by the finder, as shown in Figure 18.10.
489
490
Part IV
Looking More Deeply at Mac OS X
Figure 18.10 The results of duplicating a folder into another folder
in AppleScript.
8. That was so cool, so try it again. Oops, you have another bug, as shown in Figure 18.11. The previous problem resulted from trying to create something that already existed. This problem resulted from trying to copy something in a location where the same thing already exists. (Note that the error message isn’t exactly friendly!)
Figure 18.11 A folder duplication error in AppleScript, because a copy
already exists.
9. Add the commands with replacing to the end of the duplicate folder command, as shown in Figure 18.12.
Figure 18.12 Creating code in AppleScript to allow overwriting during a
folder copy.
Automating Your Mac with AppleScript
Chapter 18
10. Click the Run button to run the updated script—no more error! The script is now essentially functional, so add a feature or two. Remember, you can never have too many backup copies. But always copying the folder into a folder named Backup means that you’ll never have more than one. It’s more useful to make a backup copy for each day, so add some AppleScript code to figure out the date and then create a Backup folder whose name is based on the month and date. Figure 18.13 shows the AppleScript with those modifications—the first line reads the date and the next two set the variables d and m to the day and month properties of the date object. The fourth line then creates a variable called folder_name and creates its value by concatenating the word Backup followed by a space, the month, another space, and the day. Then substitute explicit references to the backup folder with the name of the variable. Click Run to run the script, and a backup folder whose name is based on the month and day displays on your desktop.
Figure 18.13 Creating a folder using variables extracted from the date
in AppleScript.
11. Time for the final bell and whistle. So far, the script has created a backup copy of a specific folder, identified by name. This is useful, but you don’t want to write a separate script for each folder to be backed up. Instead, take advantage of the Mac’s drag-and-drop capabilities by writing your
491
492
Part IV
Looking More Deeply at Mac OS X
script so that it creates backups of anything that you drop onto the icon. This requires two fundamental changes to the script. 12. Add an event handler that tells the script that it will be triggered by some event (such as having files or folders dragged onto it). Because you don’t know in advance how many things will be dropped onto the script icon, add a loop to the script so that it backs up each dragged-and-dropped item. Figure 18.14 shows the modified script.
Figure 18.14 Adding an event handler and an internal loop in AppleScript.
The code in Figure 18.14 is largely the same as that in Figure 18.13, except that all of it has been enclosed inside an open loop. This standard AppleScript event handler identifies a block of code to be executed in response to the open Apple event, which is the standard Apple event sent to an application when items are dragged and dropped onto its icon. In this case, whatever items are dragged onto the script are being stored in a variable named input_list. I used this name because it is descriptive, but it could have any name. Inside the AppleScript, the duplicate command has been enclosed within a repeat block, which tells AppleScript to repeat its contents a certain number of times, in this case for each item that is found in the input_list variable. I’ve represented this as a variable named eachitem so that the
Automating Your Mac with AppleScript
Chapter 18
code is more readable, but once again, the variable could have any name. I’ve also simplified the duplicate command, removing the requirement that you’re copying a folder, and referencing the eachitem variable rather than the name of a specific folder. 13. Click Run. Nothing happens. Why not? Because the open event can be received only by an application, and the code is just some code inside the Script Editor. To create an application from the sample code, you have to save it as an application. Select the File menu’s Save command, which displays the dialog box shown in Figure 18.15.
Figure 18.15 Saving an AppleScript as an application.
14. Select Application from the Format drop-down menu, and enter a new name for your application. Click the Never Show Startup Screen checkbox at the bottom of the Save dialog box (this option appears only after you select Application as your output format), and click Save. An icon labeled with the name you selected displays in the folder where you saved the application. I named mine Backup Droplet, but you can use any name you want. 15. Select a file or folder icon anywhere on your system and drag it onto the icon for your AppleScript backup application. You’ll see the standard Finder dialog boxes display as your application faithfully copies the
493
494
Part IV
Looking More Deeply at Mac OS X
selection into the Backup Month Day folder on your desktop. Now Å+click a few files and folders and drag them onto your application— that works, too. Now, drag the Backup Month Day folder to the trash and drag and drop a few icons onto your application. The Backup Month Day folder is automatically recreated and your copies are created there. Not too shabby for 15 lines of AppleScript and 15 minutes worth of work—your very own backup application! The preceding task showed how easy it is to create a powerful program using a few simple, readable AppleScript commands. This example also showed the difference between AppleScripts that are executed by an application such as the Script Editor, and AppleScripts that are executed as full-blown applications under Mac OS X.
Debugging AppleScript Applications Detecting problems in your AppleScript applications is fairly simple—you’ll usually see Execution Error dialog boxes such as those shown in Figures 18.7 and 18.11. If you’re lucky, the error dialog box displays a message that indicates the reason behind the error, such as in Figure 18.7. If you’re not so lucky, you get an error dialog box such as the one in Figure 18.11, which is useful only if you happen to know what error -15267 indicates. Since that error code isn’t a positive integer, it indicates that Apple still needs to do a bit of work on their error message catalog and AppleScript error handler, rather than actually providing any useful information about the error in my application. However, all is not lost. The Script Editor can display a window showing a log of the events that your application generated or responded to. This feature is extremely convenient when debugging your AppleScripts. To display the Event Log window, select the Open Event Log command from the Script Editor’s Controls menu, or press the Å+E hot key combination. The Event Log window displays, as shown in Figure 18.16.
Figure 18.16 The Script Editor’s Event Log window.
Automating Your Mac with AppleScript
Chapter 18
When this window opens, the Show Events checkbox is automatically selected. This means that the Event Log window automatically displays the events associated with the AppleScript application whenever you execute that application from within the Script Editor. By default, the Event Log displays only the events issued by your application or to which it responds. For additional debugging information, click the Show Event Results checkbox. This provides additional debugging information: the return codes and exit status of each of the commands. Unlike many log file viewers, the Event Window automatically clears any previous contents each time you execute an AppleScript from within the Script Editor. Therefore, it always shows the results of the last AppleScript that you ran in the Script Editor. This prevents confusing the results of multiple test runs of your AppleScripts.
AppleScript Language Basics The example in the previous section only hints at AppleScript’s capabilities, but explaining every AppleScript command, object, and property would require a good-sized book all its own. This section summarizes AppleScript’s most common types of objects, commands, and related expressions: ◆ Data Types: Data types are specific objects, each with their own properties. Common examples of data types are integers and real numbers on which you can perform mathematical operations; Boolean variables that can have logical values such as true and false; dates that have properties, such as month, day, year, and so on; string variables that can contain sequences of characters including spaces; lists that can contain sets of other data types; and many more. ◆ Variables: Variables are instances of some specific data type that you create to separate the ideas in your program from any specific value that they’re operating on. In AppleScript, variables are explicitly created using the set command, but also can be created when they are referenced by an application. In the example program, you explicitly used the set command to create variables to hold the month and day of a date, while the repeat loop created a variable called eachitem, which stood for each item in the list of items that you dropped on the application’s icon. ◆ Comments: If you’ve ever worked on a program written by someone else, you know that comments are your friend. AppleScript offers two ways to
495
496
Part IV
Looking More Deeply at Mac OS X
embed comments in your code. Enter single line comments by preceding them with two dashes, which tells AppleScript to ignore everything between the two dashes and the end of the current line. You can enter single or multiline comments by enclosing the comment within the (*” and “*) symbols. ◆ Operators: Operators are mathematical or logical operations indicated by special symbols that can be performed on specific data types. AppleScript provides mathematical operators for real and integer variables, represented by symbols such as +,” “-,” “*,” “/, and so on. AppleScript also provides operators that work on sequences of characters, such as the & operator that concatenates two strings. It also provides logical operators such as the not operator for testing if something is not true, such as the value of a Boolean variable. Other logical operators are the and and or operators, which let the script react differently whether some, all, or any statements are true or false. AppleScript also provides the contains operator, which lets you determine whether one item is found in a list or whether a string contains a specific substring. ◆ Flow-control statements: Flow-control statements enable you to execute only certain parts of your AppleScript programs based on the state of variables in your application or on your system. AppleScript commands such as if test whether something exists or is true, and react appropriately. Statements such as repeat until and repeat while let you perform some sequence of actions until a specified condition is met or while a specified condition is true. ◆ Handlers: Handlers let you react to a specific class of Apple events, such as open, quit, run, and so on. The sample AppleScript application used the open handler to react to being told to open the files and folders dropped onto its icon. ◆ GUI functions: AppleScript provides the display function to let you quickly and easily create various dialog boxes. These dialog boxes can contain specific messages, can contain customized buttons that you can bind to other actions in your AppleScripts, and can display standard Finder dialog box features such as pick lists. AppleScript contains a number of pre-defined operators, flow-control statements, and other ways of identifying blocks of code that should be executed when certain
Automating Your Mac with AppleScript
Chapter 18
events occur. However, like any language used to write programs, AppleScript also provides ways for you to define your own functions and commands for use in your AppleScripts. Programming languages generally call these functions, procedures, or subroutines—they called subroutines in AppleScript. The next section explains how to write your own AppleScript subroutines, how to call these subroutines, and how to re-use them in different AppleScripts.
Extending the Language Subroutines let you write your own AppleScript commands and use them in AppleScript applications. Subroutines simplify your applications by letting you write your own functions to handle specific events that occur multiple times in your program. By creating a subroutine, you write the commands once, and then just call the subroutine when needed. Subroutines are much like being able to write your own event handlers for special events that occur repeatedly in your program. Initiate calls to user-defined subroutines by specifying the name of the subroutine and the variables that you want to pass to it, enclosed within parentheses and separated by commas as appropriate. Subroutine definitions are usually located after the main loop of your program and consist of the on keyword followed by a declaration that identifies the name of the subroutine and whatever variables it uses, followed by a set of associated statements that are executed whenever the subroutine is called. Subroutine definitions are terminated with an end statement to differentiate them from any subroutines that follow. Subroutines provide a flexible, reusable way of dealing with recurring conditions. For example, suppose that you needed to add four numbers at multiple places in an AppleScript program. Rather than write the code each time, you could simply write a subroutine to do it, such as the following: on big_add(num1, num2, num3, num4) val = num1 + num2 + num3 + num4 return (val) end big_add
Each time you needed to add four numbers, you could just call the big_add subroutine, passing the numbers as parameters, as in the following example, where
497
498
Part IV
Looking More Deeply at Mac OS X
the numbers that you want to add are stored in variables named some_num, another, this_val, and something: sum = big_add(some_num, another, this_val, something)
You can also use more complex statements in your subroutines, and pass flexible numbers of parameters to them by having them loop over the elements in a list that you pass as a parameter. For example, a general version of your big_add function might look like the following: on big_add(num_list) set val to 0 repeat with eachitem in num_list val = val + eachitem end repeat return (val) end big_add
Each time you needed to add a list of numbers, regardless of the number of items in the list, you just call the big_add subroutine and pass it a list of numbers as a parameter that you create using the concatenation operation, as in the following example: my_list = some_num & another & this_val & something sum = big_add(my_list);
You can extend AppleScript by creating your own commands as subroutines. The primary difference between creating subroutines in AppleScript and in lowerlevel programming languages is that you have a better chance of being able to read and understand an AppleScript subroutine. Another way of extending AppleScript’s capabilities is by creating (or purchasing) scripting additions—bits of code that function much like plug-ins in a Web browser or other application. Each of these scripting additions includes a dictionary that defines the set of specialized subroutines and other functions that it provides. Scripting additions for general use on your Mac OS X system are located in the \System\Library\ScriptingAdditions folder. If you want to create your own Scripting Additions or install ones that only you can access, create a ScriptingAdditions folder in the /Library subdirectory of your home directory and store them there.
Automating Your Mac with AppleScript
Chapter 18
Advanced Tools and Scripting Resources A tremendous amount of information about AppleScript is available on Apple’s Web site. A good starting point for general information about AppleScript is the URL http://www.apple.com/applescript. For AppleScript information specific to Mac OS X, start at the URL http://www.apple.com/applescript/macosx. This page also provides downloadable AppleScripts that are both intrinsically useful and also great references for writing your own AppleScripts. One of the most interesting and useful AppleScript-related applications is ScriptMenu, a small plug-in for the Aqua menu system. Download it for free from Apple and drag it into your menu bar to install it. ScriptMenu is available from Apple’s Web site at the URL http://www.apple.com/applescript/macosx/ script_menu/. Click on the ScriptMenu icon to display a drop-down menu of prepackaged AppleScripts. Add your own AppleScripts to its menu by putting them in the Library/Scripts directory that ScriptMenu creates when you install it. Apple’s Script Editor is a nice application for creating simple AppleScripts, but the Aqua GUI used by Mac OS X sets the bar a bit higher in terms of what people expect AppleScript applications to look like. The Script Editor is well suited to creating simple AppleScripts that are largely command-oriented. For more advanced GUI creation within AppleScripts, take a look Apple’s new AppleScript Studio application. AppleScript Studio is a free download for Apple Developer Connection (ADC) members. Because membership is free, downloading AppleScript Studio is a no-brainer if you’re interested in developing sophisticated AppleScripts under Mac OS X. AppleScript Studio is not a single application, but the sum of the components in Apple’s free Integrated Development Environment (IDE) that can be used to develop sophisticated Internet-aware AppleScript applications, with equally sophisticated GUI components. These components are AppleScript itself, Apple’s Project Builder, Apple’s Interface Builder, and the Cocoa and AppleScriptKit frameworks. Frameworks are sets of shared object libraries that provide support for sets of related objects and communication between them. Much as basic Cocoa development depends on the Foundation and Application Kit frameworks, the AppleScriptKit framework adds the classes, objects, and functionality required to support object-oriented AppleScript development, including increased scriptability of Aqua GUI objects and the ability to call Objective-C methods from
499
500
Part IV
Looking More Deeply at Mac OS X
AppleScript applications. (Objective-C is the native language in which Aqua/Cocoa applications are developed.) To some extent, AppleScript Studio treats AppleScript as a classical programming language by requiring application development components such as Project Builder and Interface Builder. While this is true, the tremendous number of bells and whistles that AppleScript Studio can add to AppleScript applications does not prevent anyone from using the Script Editor to quickly hack together a custom AppleScript or two. AppleScript Studio simply takes the capabilities of AppleScript applications to a whole new level. The basic process of creating an AppleScript application with AppleScript Studio is the following: 1. Create a new project in Project Builder, using one of the AppleScript Studio templates as a starting point. 2. Use the Interface Builder to create the user interface for your application and to associate the different elements in the user interface with associated event handlers in your AppleScript code. 3. Use Project Builder (or even the Script Editor) to create your AppleScript code. 4. Use Project Builder to build and compile your application. To install AppleScript Studio on your OS X system, you must first become an ADC member, and must then download or purchase one of the Apple Developer Tools CDs (or download a CD image). AppleScript studio is only available in Apple Developer Tools CDs or images beginning with Apple’s December 2001 Developer Tools. To join ADC, see http://connect.apple.com and select the Join ADC Now option. For more information about AppleScript Studio in general, see http://www.apple.com/applescript/macosx/ascript_studio/. The Apple Developer Tools CDs and images contain a tremendous amount of well-written documentation, including tutorials and a large number of sample AppleScript Studio applications that make it easy to get started. If you are using AppleScript Studio, check the ADC and Mac OS X sites at Apple for updates or upgrades for AppleScript itself. Though Mac OS X is a quantum leap forward in the capabilities and power of your Mac, it isn’t perfect—yet!
Automating Your Mac with AppleScript
Chapter 18
Summary This chapter introduced and explained AppleScript, the high-level command language provided by Apple to let you write your own, customized Macintosh applications without requiring a degree in Computer Science or the patience of Job. AppleScript is a powerful language that can interact with hundreds of Macintosh applications. It even can interact with applications written in other scripting languages, such as Perl or Unix shell scripts. AppleScript is one of the many Mac OS tools made more powerful by the object orientation of Mac OS X. In addition to all the capabilities described earlier, Mac OS X opens up a whole new world of power due to Unix. The next chapter, “Working with Unix,” goes into more detail about using Unix itself, the Unix command line, installing and running Unix utilities, and making the most of the entire range of OS X’s capabilities.
501
This page intentionally left blank
Chapter 19 Working with Unix
504
Part IV
Looking More Deeply at Mac OS X
revious chapters of this book have introduced Unix, the operating system that provides the behind-the-scenes muscle of Mac OS X. Unix is an established operating system used since the late 1970s. Rather than being a single operating system, Unix is an umbrella term for a rich set of operating system features, an approach to computing, and a set of core utilities. (Open Group, the owners of the registered trademark Unix, might disagree, but that doesn’t change reality.)
P
This chapter helps cut through the confusion that surrounds the term Unix by discussing the core concepts that make up Unix, explaining how to access and use the Unix utilities included with your Mac OS X system, and providing an overview of compiling and using the many free and open source applications available for Unix systems. Moving to a new operating system, as Apple has done with Mac OS X, is frequently a one-way transaction. As you’ll see in this chapter, Apple’s expertise in user interface design and human/computer interaction brings as much to Unix as Unix brings to the Macintosh. It also fulfils the dream of long-term Unix geeks (such as myself ), who can buy a powerful, multi-user Unix system that also features an eminently usable user interface and thousands of readily available and supported applications.
Unix and Macs: A Match Made in Heaven? Unix was designed to maximize the ability of multiple users to use a single machine at the same time. The Macintosh system was originally designed to enable a single user to run multiple programs. The basic principles of managing multiple users and multiple processes are the same—needed are a flexible number of processes that run at the same time and that can provide and manage protections associated with whatever resources they need. At the operating system levels, those processes need to allocate, share, and deallocate system memory, access the processor, access peripherals including disk storage and so on. At the user level, those processes need to able to determine whether the user can access specified files, directory, and peripherals, execute specific programs, create, edit, and delete file data, and so on. Chapter 6, “What’s under The Hood?” introduced the Darwin kernel that makes up the core of Mac OS X and provided an overview of how Mac OS X is organized. In this section, I’ll use Unix as a generic term to mean the combination of the Darwin kernel and all of the Unix and BSD utilities that together form the Mac OS X Unix environment. The focus of Chapter 6 was to help you understand
Working with Unix
Chapter 19
the hierarchy of operating system layers, system services, and interfaces that are combined in Mac OS X. As discussed there, Unix provides the fundamental support for multi-processing and multi-tasking, protected memory, and inherent security used by the Mac Aqua interface and its Quartz graphic subsystem. This section provides additional insights into how Unix works (and how you can work with Unix) to maximize your productivity on a Mac OS X system.
The Philosophy of Unix: Small, Specialized Utilities Unix is an operating system with a well-known philosophy. Anyone who has ever done substantial work on Unix understands how things are supposed to work. This has helped guarantee its conceptual consistency despite the large number of people, universities, and corporations that have sold, distributed, enhanced, or implemented their own versions of Unix. Some of the basic characteristics of Unix that differentiate it from most other operating systems are the following: ◆ Most of Unix is written in a high-level language (C), which makes it relatively easy to understand (assuming that you can read C code) and to port to new hardware. Writing Unix in a high-level language helps isolate the operating system from the hardware, and simplifies its modification and enhancement. ◆ Unix files are viewed as streams of bytes, with no special organization or interpretation imposed on them by the operating system. Many older operating systems intrinsically support different types of files, such as ISAM (Indexed Sequential Access Method) and VSAM (Virtual Sequential Access Method, also sometime known as the Very Strange Access Method) files. Unix easily supports files with these (and any other) types of internal structure. The important distinction is that the operating system itself does not automatically identify the internal organization of different types of files—this is left up to applications. ◆ The Unix filesystem consists of files and directories that can contain files and other directories. Unix uses a simple, tree-structured hierarchical filesystem that begins at the directory /, known as the root of the filesystem. When storage is added to a Unix system, new partitions or disk drives are made available (mounted) on standard directories in the existing filesystem. For example, in a standard Unix filesystem, the directory /usr may initially be a simple subdirectory of the / filesystem or can be a
505
506
Part IV
Looking More Deeply at Mac OS X
mount point for a separate disk or partition. See Chapter 4 for more detailed information about the Unix filesystem. ◆ Direct access to local hardware devices is done through nodes that are special-purpose files in the standard filesystem. These are traditionally located in the /dev directory (or a subdirectory of that directory). For example, a traditional entry for the console on a Unix system would be /dev/console. With the proper permissions, users and applications can open, read from, and write to devices using the same function calls that are used to open, read from, and write to any other file in the Unix filesystem.
NOTE The Unix concept of “everything on the system is a file” only goes so far when applied to hardware devices on a Unix system. Devices on which data is organized in a higher-level fashion, such as disks and other devices that contain filesystems, must be written to using function calls that understand and use those formats. Thinking of everything in a Unix filesystem as a file is best applied to general principles of locating and opening devices and reading from them.
The core concept behind Unix application development is to create small, specialized programs that do one thing, do it well, and interoperate with other programs. These programs then can be combined to perform complex functions. This is done using a simple but elegant concept known as a pipe, which enables one program to use the output of another as its input. Pipes are represented on any Unix command line by the pipe character (|). The beauty of pipes is that they isolate functionality in small, separate utilities, rather than requiring that each program re-implement similar features. Unix textprocessing utilities are a great example of this approach to application development. For example, most versions of Unix include utilities, such as troff, a document formatter, eqn, which produces equations in formatted output, pic, which produces pictures in formatted output, and lpr, which sends formatted output to a printer. Rather than building all of this functionality into troff itself, you can format and print a document that contains both equations and pictures by using a command line such as the following: eqn document-name | pic | troff | lpr
Working with Unix
Chapter 19
Creating small, specialized applications that work together simplifies not only the programs themselves, but also their maintenance and enhancement. In the previous example, adding new functionality to eqn or pic only requires updating those applications, rather than making changes to troff itself.
Interacting with Unix When you think of using a Unix system, you may think of using a command-line interface. Though most modern Unix systems have a graphical user interface and support sophisticated graphical applications, most of the work of starting programs, examining files, and so on is still done from a command line. Users type the name of the command that they want to execute and any special arguments to that command (such as the name of a file that you want the command to operate on). This is the classic method of interacting with a computer system because it is so easy to implement—the system reads text commands from an input device such as a terminal and performs some action in response to a special keystroke. This special keystroke is usually the Return key on a standard personal computer or workstation keyboard or the Send key on a mainframe IBM terminal. While this approach is easy for operating systems and system developers to implement, it has a number of drawbacks. Most obviously, you have to know the name of the command. You also may have to know where the command is located on the system. This means you must have some idea of how the system is organized and know how to examine or list the contents of different files and directories. The amount of knowledge required to use a command-line system highlights many of the reasons why the Macintosh and its graphical user interface (GUI) were developed in the first place. Unfortunately, while a totally graphical user interface simplifies many tasks, it occasionally makes others more difficult. Some tasks are easier to accomplish from the comand-line. A good example of this is the Unix concept of using pipes to combine the power of multiple programs by using the output of one as the input to another. This is difficult to represent graphically, because the obvious solution of dragging one command on top of another is already used to represent opening a file with a specific application. The inability to chain applications in graphically oriented computer systems leads to monolithic programs that do everything themselves. Not only does this make programs bigger because each must provide the same types of features, it introduces many more places where bugs or programming errors can be accidentally introduced.
507
508
Part IV
Looking More Deeply at Mac OS X
Accessing the Command-Line Interface This section explains how to access the Unix command line interface on Mac OS X systems using the Terminal application. (It is called Terminal because it emulates an old-fashioned terminal.)
Task: Starting the Mac OS X Terminal 1. Open the Applications folder, and scroll down until you see the Utilities folder. Double-click the Utilities folder to open it and display its contents. 2. Double-click the Terminal icon. The Terminal application displays, as shown in Figure 19.1
Figure 19.1 The Terminal window.
TIP If you use the Mac OS X Terminal frequently, drag the Terminal icon to the Dock so you can start the Terminal application more easily.
That’s all there is to it! Seeing an application such as this one running on your Mac, you may feel that you’ve been launched backward in time. You may have no idea what to type, or why to type anything in the first place. Not to worry—as you’ll see in the next section, Mac OS X includes a tremendous assortment of
Working with Unix
Chapter 19
powerful utilities that make the Unix environment an attractive choice for performing many different types of tasks. In many cases, using the Terminal can be much faster than using equivalent graphical Mac OS X applications.
Using Unix Utilities When you first start the Mac OS X Terminal application, you’re confronted with a sequence of characters known as a prompt. This prompt, generated by the Unix tcsh command interpreter running in the Terminal window, indicates that it is waiting for you to type some command. The next few sections progressively lead you through some of the most basic and popular Unix applications, showing how to accomplish a variety of common tasks using the Unix command line interface.
Using the tcsh Shell Any computer system needs some way to let users execute commands. On graphical systems such as the Mac OS, this usually involves pointing and clicking or dragging and dropping icons. The Mac OS Finder interprets these actions and performs the appropriate action. Single-clicking an item selects it, double-clicking on an icon runs the program that is associated with that icon, and so on. On command-line-oriented systems such as Unix, executing commands and related actions are performed by programs called command interpreters. When you log in on a standard Unix system (or open a Terminal window on a Mac OS X system), the system automatically starts a command interpreter. The specific command interpreter started depends on which one was selected when your account was created. The Unix term for this type of command interpreter is a shell. The default shell for all user accounts on Mac OS X systems is /bin/tcsh (usually known simply as tcsh, which stands for the TENEX-style C-shell). TENEX is an old command-line operating system that offered sophisticated command editing and recall mechanisms that have been reimplemented in tcsh. A number of different shells are available for Unix systems. The original Unix shell is /bin/sh, also known as the Bourne Shell after its author, Stephen Bourne. This shell wasn’t sophisticated enough for the UCB Unix crowd, so they created their own shell, /bin/csh, commonly known as the C-shell because some aspects of its syntax are similar to that of the C programming language. The C-Shell was extended with TENEX-like features to create /bin/tcsh. All of these shells, plus
509
510
Part IV
Looking More Deeply at Mac OS X
another one called /bin/zsh, are available for Mac OS X. Not provided on Mac OS X are two other popular shells: /bin/bash (which stands for the Bourne Again Shell and is the most popular shell on Linux systems) and /bin/ksh (the Korn Shell, named after its author, Phil Korn). You can easily get the source code for bash and compile it for Mac OS X if you want. The Korn shell, a product of Bell Labs, generally costs money, though some free clones of the Korn shell are available in source form for the truly dedicated. Which shell one uses is something of a religious argument among Unix aficionados, and therefore won’t be discussed here. Tcsh is a fine shell, and has more features than most people will ever need. Shells provide of clever mechanisms to make it easy for you to execute multiple commands, re-execute commands that you’ve run before, and so on. Some of the features of tcsh are the following: ◆ You can easily redirect the output of a command and any error messages it may display into different files using I/O redirection. Tcsh uses the standard greater-than character (>) to signify redirection of the output of a command into a file, and lets you combine output and error messages into a single output file using the >& combination. You can use a file as the input to a command by using the input redirection less-than character (<). ◆ Like all Unix shells, tcsh uses environment variables internally. Environment variables can be set within the shell itself to do things such as tell the shell where to look for commands. Unix stores commands in a number of different directories. When you type a command at the tcsh prompt, tcsh checks a colon-separated list of directories stored in an environment variable known as path, searching each in sequence to see if that directory contains the command you want to execute. Unix fans therefore often refer to the PATH environment variable as “your search path.” Other environment variables store things such as what to use for your command-line prompt (prompt), the name of the current working directory (cwd), and so on. ◆ Tcsh maintains a history of the commands you’ve recently typed. You can re-execute commands by using the arrow key, then pressing the return key when you see the command that you want to re-execute. You can also use the history command to display a numbered list of all of the commands that you have executed previously. Re-execute any of these commands by typing an exclamation mark followed by the number of that
Working with Unix
Chapter 19
command. This command history is stored in a file called .tcsh_history when you log out, and is reloaded each time you log in. ◆ When you recall commands from your command history using the arrow keys and other mechanisms, you can also edit those commands before reexecuting them. This is especially handy when you type a long command and then discover that you’re made a typographical error. Simply redisplay the command, correct the typo, and execute the correct command. ◆ Tcsh supports all of the standard Unix wildcard characters, which you can use on any tsch command line. These include the asterisk (“*”’), which matches any number of characters in a filename, and the question mark (“?”’), which matches any single character. For example, if you had three files, named foo1, foo2, and foobar, you could refer to both foo1 and foo2 by using the expression foo?, because the question mark would match both the 1 and the 2. If you wanted to refer to all three files, you could use the expression foo*. ◆ You can write your own commands by creating text files that contain sequences of Unix and shell commands using the syntax particular to tcsh. These command files, typically known as shell scripts, can subsequently be used just like any standard Unix command. Shell scripts provide an easy way for you to perform fairly complex tasks without learning a specific programming language. ◆ Tcsh provides fairly sophisticated job control, which makes it easy to start commands, suspend their execution, resume their execution as a background process, and even shoot down out-of-control commands that are running as background processes. Execute commands as background processes by appending an ampersand (&) to the end of your command line. This is not as useful under Mac OS X as it is when using graphical systems, such as the X Window system, that automatically start graphical Unix processes in their own windows. However, it is often useful to start long-running processes. The jobs command shows a list of all the commands running as subprocesses of the current shell. Make one of these the active command using the fg (foreground) command, and terminate background commands by referring to their job number, prefacing it with a percent sign (%). Tcsh’s features make it as easy to execute Unix commands. For the beginning Unix user, it’s more important to learn the Unix commands necessary to do basic tasks
511
512
Part IV
Looking More Deeply at Mac OS X
such as listing files, moving around in your directories, and editing files, than to worry about all the shell’s bells and whistles. The next few sections explain some of the most common Unix commands and related concepts such as command-line option and command-line arguments.
Listing Files and Directories The Finder serves as a graphical command interpreter on Mac OS systems, interpreting mouse clicks and actions and running associated programs. The Mac OS Finder’s other critical task is to display the organization of the files and folders that make up your Mac OS X system. This includes related tasks such as creating, opening, and deleting files and folders, creating multiple windows so that you can easily move files and folders by dragging and dropping them, and so on. All these capabilities make it an extremely powerful (and large) application. In keeping with the Unix philosophy of small specialized applications that focus on one set of related tasks, Unix provides a variety of small applications dedicated to performing a special subset of the functionality required to manipulate files and directories (the Unix term for folders) within a Unix shell. The most fundamental of these is the Unix ls utility, which in typical cryptic Unix fashion stands for list. This utility lets you list Unix files and directories and display information about them. When you execute the ls command in a Mac OS X Terminal window, the names of all the files and folders in the current directory (my login directory, in this case) display in alphabetical order, as shown in Figure 19.2.
Figure 19.2 The output of the ls command in a Terminal window.
Working with Unix
Chapter 19
For those of us who are used to graphical clues about what’s in your folders, that’s a pretty minimal display of information. However, you can customize Unix commands by adding command-line options and/or command-line arguments to the command. You’ll look at command-line arguments in a second—first, look at how command-line options help get more information out of the ls command. Command-line options are special characters that you add after the command name, separating them from the command and other options by a space and preceded with a hyphen (-) to indicate that these are options. The standard ls command doesn’t differentiate between files and folders—they just appear as names. Use the -F (show File type) option to identify directories and different types of files. Figure 19.3 shows the output of the ls -F command in the same directory as shown in Figure 19.2.
Figure 19.3 The output of the ls –F command in a Terminal window.
As you can see in Figure 19.3, the output of the ls –F command adds some extra decoration to a directory listing to differentiate between directories and different types of files. This decoration is not part of the actual name of the file or directory; it’s just a visual clue to the nature of each item in a directory listing. The ls –F command provides the following visual clues: ◆ Regular files that simply contain data don’t get any special decoration. In this case, the absence of a visual clue is itself a clue. An example of this is the file resume.txt in Figure 19.3.
513
514
Part IV
Looking More Deeply at Mac OS X ◆ Executable files, such as programs or command files, are indicated by an asterisk. An example of this is the command file find_docs in Figure 19.3. ◆ Symbolic links, which are the Unix equivalent of aliases and point to another file or directory rather than actually being a file or directory, are indicated by the “at” symbol (@). An example of this is the symbolic link web in Figure 19.3. ◆ Directories, the Unix equivalent of Mac OS folders, are indicated using a slash (/). Most of the items in Figure 19.3 are directories, such as Ayers, Kevin and the standard directories created in any Mac OS X home directory, such as Documents, Movies, Public, and Sites.
The ls command probably has more options than any other Unix command, but I’ll just cover one more. The -l (long) option provides information about item type, but also shows other information, such as file size, file protections, the time that the file or directory was last modified. Just as the Finder lets you see different views of your OS X files and folder by selecting the standard, detail, or column views, the ls –l command displays the equivalent of the Mac OS X detail view. Figure 19.4 shows the output of the ls –l command in the same directory as in the previous two examples. That’s a lot more information! Because the ls –l command shows detailed information about your files and directories, it is organized vertically. Each line in the output provides information about a different directory entry. From left to right,
Figure 19.4 The output of the ls –l command in a Terminal window.
Working with Unix
Chapter 19
the information about the file or directory shown in each row of the output from the ls –l command is the following: ◆ File type and protection information—this slightly confusing series of letters and dashes is best thought of as one character that gives file type information, and three sets of three characters that describe the permissions on the file. If the first letter is a d, the entry is a directory—if not, it is a file. The three sets of three characters that follow define whether a file can be read (r), written to (w), or executed (x) by the three basic sets of Unix users—the owner of the file, members of the Unix group associated with that file or directory, and everyone else.
NOTE Although type and protection information in Unix looks complex, it is really the same as the privileges information you see when selecting a file in the Mac OS X Finder and running the Show Info command. It just doesn’t look as nice.
NOTE Unix protections have slightly different meanings for files and directories, because it doesn’t make sense to execute a directory. For Unix directories, the r character determines whether a user can list the contents of that directory. The x character determines whether a user can execute files by specifying the directory name. For example, if the r character is absent, but the x character is present, a user could still execute a program located in that directory if they knew its name, even if they couldn’t list the contents of the directory itself. This is a common way of providing some security on directories containing applications that should not usually be executed by standard (nonadministrative) Unix users, but to which they may occasionally need access.
◆ The number of links to the file or directory in the filesystem where it is located. Unix filesystems save space by enabling you to create multiple links to files and directory at a lower level than an Alias or symbolic link provides. ◆ The name of the file’s owner, which is that user’s short name. ◆ The name of the group associated with that file. Groups are an administrative convenience on Unix systems, and consist of multiple users that share some requirements. Groups enable multiple users to access specific
515
516
Part IV
Looking More Deeply at Mac OS X
files, directories, or devices without having to give each individual permission to access those resources. ◆ The size of the file or directory, which is the number of bytes that the file or directory uses on your system’s hard drive. For directories, this is the size of the actual directory, not the cumulative size of all of the items that it contains. ◆ The date and time when the file or directory was last modified. The modification time for directories is not updated when you create or delete files in them, only when the directory itself is modified. ◆ The name of the file or directory. As you can see in the web entry in Figure 19.4, symbolic links also display information about the file or directory that they actually point to, as well as their name. It would be a pain to always get general information (such as listing the entire contents of a directory) if all you wanted was information about a specific entry. Most Unix commands accept command-line arguments. Command-line arguments tell the command how or what to work on. For example, with the ls command, you can supply the name of a specific file or directory and get information about only that file or directory. If you specify the name of a file, you get information about that file only. If you specify the name of a directory, you get information about that directory and its contents only. Figure 19.5 shows the results of the ls –l command when I supplied the name of the Music directory as a commandline argument.
Figure 19.5 The output of the ls –l Music command in a Terminal window.
Working with Unix
Chapter 19
The Unix ls command is one of the most common Unix commands, simply because you’ll always want to know the names of the files and directories. However, being able to list the names of files and directories isn’t all that exciting if you can’t create and move around in different directories. The next section explains some of the most common commands used to work with directories on Unix systems.
Creating and Using Directories You all understand the benefits that directories (folders) provide in terms of organizing your information. Unix provides separate commands for creating, deleting, and moving around in directories. This section provides a quick introduction to the most common commands used to work with Unix directories. Use the Unix mkdir command to create one or more directories. You must supply the directory name as an argument to the mkdir command. For example, to create a directory named Work, you would execute the following command: mkdir Work
This creates a directory named Work in the current directory. You can find out the name of the current directory by executing the pwd (process/present/print working directory) command. You can also create directories anywhere on your OS X system (anywhere that you have permission to write to) by explicitly specifying the full pathname of the directory that you want to create. For example, regardless of your current directory, you could create a directory named Test in your home directory by executing the command mkdir /Users/wvh/Test, substituting the name of your login account for mine (wvh) in the command. You can also use the tcsh shortcut ~ (tilde) to refer to your home directory. Using this shortcut, the command mkdir ~/Test would create the same directory as in the previous command. To change to another directory, making it your current working directory, use the Unix cd (change directory) command. For example, to change to the Work directory created in the previous example, you would simply type the command cd Work. At some point you may want to delete a directory. Remove empty directories by using the rmdir (remove directory) command. If you want to remove directories that contain files and remove those files at the same time, use the rm (remove) command with its –r (recursive) command-line option. For example, to remove an empty directory named Test, located in your home directory, you could execute
517
518
Part IV
Looking More Deeply at Mac OS X
the command rmdir ~/Test. If this directory contained files that you wanted to remove at the same time, you would uses the command rm –r ~/Test.
NOTE Be very careful when removing files and directories, because you cannot easily undelete files on Unix systems. An additional thing to be careful of is accidentally typing extra spaces in Unix commands that include shortcuts such as the tilde (~) or wildcard characters such as the asterisk (*). For example, typing the command rm –r ~ /Test, where there is a space between the tilde and the directory name /Test would be potentially disastrous, because this command would recursively remove the contents of your home directory and then attempt to recursively remove the directory /Test. Make sure that you regularly make backup copies of your Mac OS X files, storing them on removable media or on another drive on the network to protect against these sorts of disasters.
Editing Text Under Unix One thing you can’t have enough of on a text-based computer system is applications that display and edit text files, known as text editors. Many of the configuration files used by the Unix underpinnings of Mac OS X are specially formatted text files. Even in today’s graphical environments, many existing text-based configuration files are still actively used because many existing applications depend on them, and also because text files don’t require any special piece of software other than a simple text editor. Text editors are much like word processing applications or spreadsheets in that they each have fans who prefer their favorite text editor’s approach. If you’re already familiar with Unix, you may be aware of the long-running religious war on bulletin boards, newsgroups, and now the Internet as to whether vi or emacs is the ultimate text editor. Mac OS X includes five different text editors, each of which have their own fan clubs, features, and shortcomings. These are the following: ◆ Ed: The oldest and most primitive editor available for Unix, ed is a lineoriented editor that is the functional equivalent of the edlin editor found on DOS systems. Ed provides a small number of commands, and the question mark is its only error message. In other words, if you type a command that ed does not recognize, it simply discards the command
Working with Unix
Chapter 19
and displays a question mark. Ed is truly the lowest common denominator of Unix editors, and is worth learning if you plan to become a serious Unix geek who wants to know a single editor that can be found on all Unix systems, regardless of their vintage or ancestry. ◆ Emacs: The largest editor in the world, emacs (Editor Macros) is a screen-oriented editor that began life as a series of macro commands in an ancient text editor known as TECO (Tape Editor and Corrector, later updated to Text Editor and Corrector). Emacs is the most powerful and configurable text editor available, but also is one of the most memory intensive. Emacs is always in insert mode, and uses Control and key combinations (holding down Control while pressing another key, or pressing Escape key followed by another key) to move around in your editor window. Figure 19.6 shows a text file being edited in emacs running in a Mac OS X Terminal window.
Figure 19.6 Editing a file in emacs in a Terminal window.
◆ Ex: A line-oriented editor that is essentially the same as the vi editor without the latter’s screen-editing capabilities. Ex is a handy editor to learn if you may find yourself working on Unix system printing consoles or if you want an editor with more power than ed, but which you can run on any terminal or console. ◆ Pico: A popular editor with fairly light memory requirements, pico (Pine Interactive Corrector) was originally developed as a text editor for the PINE electronic mail system but has since become more widely used
519
520
Part IV
Looking More Deeply at Mac OS X
because it is easy to learn (it always displays some of its basic commands at the bottom of each editor window) and because it is also easy to port to other systems. Like emacs, pico is always in insert mode and uses Control key sequences to activate specific commands. Figure 19.7 shows a text file being edited in pico running in a Mac OS X Terminal window.
Figure 19.7 Editing a file in pico in a Terminal window.
◆ Vi: A classic, screen-oriented text editor, vi (Visual editor) is available on almost every Unix system and is well worth learning for that reason. Vi is a modal editor, which means that it is either in insert mode (where typing characters inserts them into the file that you are editing) or in command mode (where the characters that you type are interpreted as vi commands). To enter insert mode, you type commands such as i (insert) or a (append). Press Escape to exit from insert mode and return to command mode. Modal editors takes some getting used to, because it’s hard to tell which mode you’re in without actually typing a key and seeing what happens or pressing Escape a few times to guarantee that you’re in command mode. Vi is an extremely powerful editor and is well worth your time to learn if you think that you’ll be using different types of Unix systems—nowadays, almost every Unix system includes a copy of vi. Figure 19.8 shows a text file being edited in vi running in a Mac OS X Terminal window. Trying to explain all of the commands available in any of these editors is outside the scope of this book—there are many entire books devoted to learning to use
Working with Unix
Chapter 19
Figure 19.8 Editing a file in vi in a Terminal window.
editors such as emacs and vi. Unless you’re an actual Unix fan or simply want to learn a Unix editor that you can use on different types of Unix systems, you may find it easier to use a standard Mac OS X editor like TextEdit (the Mac OS X replacement for the venerable SimpleText text editor) or the classic BBEdit editor (a commercial but extremely powerful editor from Bare Bones Software, http://www.barebones.com/products/bbedit.html. A free version with limited capabilities is also available).
Getting Information about Unix Commands One of the best features of Unix systems is that they have always included online reference information for most, if not all, of the commands available on the system. These online reference pages are known as man (manual) pages, and are accessed by executing the man command. For example, to see the online manual page for the ls command, discussed earlier in this chapter, you would execute the command man ls. Figure 19.9 shows the manual page for the ls command displayed in a Mac OS X terminal window. One you display a man page, press Return to scroll forward one line at a time, or press the Space bar to scroll forward a page at a time. Besides displaying the man pages for specific commands, the man command’s –k option displays a summary list of all the man pages that match a specific keyword.
521
522
Part IV
Looking More Deeply at Mac OS X
Figure 19.9 Viewing online manual information in a Terminal window.
This is handy, for example, if you want to see the man page for a text editor, but aren’t sure which ones are available on your system. Type the command man –k editor to see a listing and short description of all relevant man pages, and then use the man command to view a specific online manual entry. Figure 19.10 shows the output of the man –k editor command in a Mac OS X Terminal window.
Figure 19.10 The results of a man keyword search in a Terminal window.
Working with Unix
Chapter 19
Installing Other Unix Software The previous sections of this chapter explained how to use some of the most popular Unix commands. If you are already a Unix user, you may find that one of your favorite Unix commands is not included with Mac OS X. If this is an application for which the source code is freely available, you’re in luck—Mac OS X includes gcc, the GNU C Compiler, which is the standard Unix compiler nowadays, and associated applications, such as the make program, that make it easy for you to compile and install Unix applications on your Mac OS X system. After all, thousands of people have been hacking on Unix since the late 1970s, so there’s a lot of free software available! This section explores some of the issues in compiling free software for your Mac OS X system, and also explores some of the relevant issues in the release of the source code for parts of Mac OS X, such as the Darwin kernel, to the open source community.
Compatibility Issues with Other Unix Software Long before Linux, FreeBSD, and the open source movement, Unix itself was touted as a universal computer system because all its applications were written in the C programming language and also because almost every Unix system included a C compiler. This was supposed to guarantee that Unix code was easily portable from one system to another, which regrettably has turned out to be false. This isn’t to say that most Unix applications can’t be made to compile on almost any Unix system—this simply requires a bit of work in some cases. Unix and C were a big step forward in creating portable applications. It is far easier to compile any Unix application on any other Unix system than it is to, for example, attempt to compile a Windows application on a Unix system. The primary problems that you may encounter when compiling freely available Unix, BSD, or Linux applications on Mac OS X are the following: ◆ The source code may depend on function calls that are provided in libraries that are not distributed as part of the application’s source code. Usually you can simply obtain the source code for the library, compile and install it on your system, and then compile the application. This isn’t always feasible—some libraries themselves depend on other libraries, and you may find that the dependency chain for the application that you’re trying to compile is so long that it isn’t worth your time.
523
524
Part IV
Looking More Deeply at Mac OS X ◆ Some flavors of Unix, such as the BSD and SYSV versions (this includes Linux), organize include files (.h files) differently. Include files contain variable, data structure, and macro definitions that are designed to be included in C programs. You may find that you need to modify the paths to or names of included files if you are trying to compile a Linux application on a BSD-based system such as Mac OS X. ◆ Older Unix applications that have their roots in BSD and SYSV environments may depend on different subsystems that are native to different types of Unix. The classic example of this sort of problem is the difference in how BSD and SYSV applications obtain information about the characteristics of the terminals in which they are running. Older BSD applications defined terminal capabilities in a specially organized text file known as /.etc/termcap, and therefore depended on function calls that knew how to extract specific types of information from that file. Older SYSV applications used a terminal information database known as terminfo, which was organized completely differently and used a totally orthogonal set of functions for extracting and interpreting the information contained in terminfo files. This isn’t as much of an issue nowadays as it once was, but may still be a problem if you are trying to compile older applications under Mac OS X. ◆ Graphical applications for Unix systems are totally dependent on the graphics subsystems used on Unix machines, which are totally different than those used on Mac OS X. Most graphical Unix applications use the functions and features of various parts of the X Window system, which is not provided by default with Mac OS X. Fortunately (as described in the next section), a free version of the X Window system, known as Xfree86, has been ported to Mac OS X and includes the majority of the X Window system libraries. If you are attempting to compile a graphical Unix application on Mac OS X, install the X Window system and all relevant libraries before even starting.
This list is not intended to discourage you from compiling free or open source applications for Mac OS X, but does highlight some problems you may encounter. Thanks to the open source movement, described in the next section, a tremendous amount of free software will easily compile and run on Mac OS X. In many cases, you may not even have to compile this software yourself—hundreds of Web sites let you download precompiled packages of free and open source software that you can quickly and easily install just like any other Mac OS X applications.
Working with Unix
Chapter 19
Mac OS X and Open Source Software Open source software is one of today’s buzzwords in computer circles, but actually boils down to a fairly simple concept—the source code for an application or some part of an operating system is freely available. The term open source was coined by Eric Raymond and others to differentiate between software that is simply free, and software that has some explicit licensing requirements. All open source software is released under some specific terms that usually specify how or if you can actually sell compiled or derivative versions of that software, and what your responsibilities are in terms of making your changes to open source software available to the public.
NOTE Because this section deals with licenses and therefore may attract lawyers like blood in the water would attract sharks, let me state that this chapter reflects my understanding of the licenses discussed herein, and that this chapter should not be interpreted as legal advice or be used as a business model. I am also not responsible if you are struck by a meteor when reading this book or if you are so caught up in the text that you happen to wander into traffic.
The most widely known open source license is the GNU General Public License (GPL), which specifies that you cannot sell software that is released under the GPL and that you must provide the source code for any enhancements that you make to GPL source code. This may appear confusing given that companies such as Red Hat make a good deal of their revenue by selling pre-packed Linux distributions. But what you are paying for is a distribution charge that covers the cost of the media, the cost of customized documentation, the cost of packaging the kernel and Linux utilities into an easily installed and manageable configuration, and so on. All of the source code for everything included in a Red Hat Linux distribution is always available, either on the CDs themselves, or by free download from Red Hat. The GPL is only the best-known open source license—there are as many different open source licensing agreements as there are corporate legal departments, and perhaps even more. Companies that release software that they have developed internally as open source software, such as IBM’s release of the source code for the OpenAFS distributed filesystem and the JFS journaling filesystem, often create their own licensing terms designed to protect their initial investment and to limit
525
526
Part IV
Looking More Deeply at Mac OS X
liability. Apple’s open source software efforts are released under the Apple Open Source License, available at http://www.opensource.apple.com/apsl/. Most BSD-based software is released under the Berkeley Copyright or BSD License, which lets you create and sell derivative works from software released under this license without having to provide the source code for your enhancements, as long as you include the correct copyright information with your product. For more information on the Berkeley Copyright, see http://www.opensource.org/ licenses/bsd-license.html. The Mac OS X Darwin kernel has been released as open source and is freely available from Apple’s Darwin Web site (http://www.darwin.org), as are Apple’s other open source projects such as their streaming QuickTime server and the security architecture used with Darwin. Most of the BSD-based Unix utilities that make up the command-line user environment on Mac OS X systems were already freely available in source form, and continue to be free. Steve Jobs is probably the computer industry’s most famous cult leader and spin doctor, and thus his announcement of Darwin as open source shouldn’t have come as much of a surprise to anyone. There isn’t much rocket science involved in releasing something as open source that’s largely already freely available (Mach 3.0, BSD Unix, NetBSD, and FreeBSD), but it provides some significant advantages to Mac OS X users—first, all of the source code for Darwin is suddenly open to public scrutiny. This helps popularize Darwin, helps guarantee that people will be able to track down bugs and fix them, and makes it easier for companies to develop applications that need to be integrated with Darwin at the operating system level. After all, having the source code for an application (or an operating system, in this case) lets you understand exactly what’s going on in there. Darwin’s open source and Unix and BSD roots are truly significant for fans of other open source projects, many of which (such as Apache, GNU emacs, Perl, Samba, XFree86, and so on) were easily ported to Mac OS X. Apple ships Apache, GNU emacs and Perl with Mac OS X (among many others). Out of the box, Mac OS X provides an FTP server, SSH support, sendmail, and Apache. For any long-time Unix user, this is the hi-tech equivalent of Christmas. The importance of Mac OS X as both Unix and open source can’t be underestimated. For the first time, Macintosh users can compile and use thousands of free, open source applications with little or no modification. In previous versions of the Mac OS, even non-graphical open source applications required some modification to run in the Mac environment, because the Mac OS interface was entirely
Working with Unix
Chapter 19
graphical. Because Mac OS X provides a Unix command line, existing open source applications don’t have to be converted to run in the Macintosh environment—they can run as is from any terminal window with sufficient privileges. Aside from open source software that ships with Mac OS X, such as emacs, a great example of an open source application that has been ported to Mac OS X is Samba (http://xamba.sourceforge.net/index.shtml). Samba exports Unix filesystems and printer resources over a network to Windows and other systems that understand Server Message Block (SMB) or CIFS resources. Apple’s compliance with and support for POSIX standards made it easy to compile and install Samba for Mac OS X. Samba’s use of Web-based administration through SWAT further simplified porting Samba, because there were no platform-specific graphical utilities to worry about. Installing Samba on your system makes it possible for your Mac OS X system to export volumes via SMB, so that they can be mounted on any remote Windows system just like any standard Windows shared volume. Many of the more exciting open source applications available today for Linux and BSD are graphical applications that require the X Window system. Luckily, the X Window system is freely available for Mac OS X, thanks to the XonX Project’s port of XFree86 to the Aqua/Quartz environment (http://sourceforge.net/projects/xonx/). The X Window system presented an interesting problem for Mac OS X integration, because the X server typically wants to take control of your Mac’s graphical display, as does the Mac OS GUI, Aqua, and its graphics engine, Quartz. The free version of the X Window system can operate in one of two modes—in rootless mode, where X Window system applications look just like any other Aqua application in the Finder, or in more traditional X Window system mode by using a separate virtual screen. In rootless mode, X Window system applications look just like any Finder window, though they are actually under the control of an X Window server that interoperates with the Finder. In traditional mode, you can toggle between the X Window system and Aqua desktops by selecting an icon in the Aqua environment, and by pressing Option+Å+A when in the X Window system environment. Commercial versions of the X Window system also are available, but I don’t see much point in buying one unless you need customer support. The XonX port of the X Windows system includes the default window manager, twm, and no other (just like XFree86 does out of the box). Window managers with more bells and whistles than twm (such as almost every other window manager except uwm) are actively being ported to the X Window system environment on
527
528
Part IV
Looking More Deeply at Mac OS X
Mac OS X. One of the most interesting is the port of the Orborus window manager to Mac OS X, which is freely available from http://julia.et.ic.ac.uk/adrian/ software/oroborosx in both source and installable package form. Open source applications that depend on the graphical capabilities of specific X Window system desktops such as GNOME and KDE will require substantially more work to get them running on Mac OS X, because they depend on so many other libraries and pieces of code. Because the source code is available, it’s really just a matter of time and interest on the part of Mac OS X users.
Summary This chapter provided an introduction to using Unix on Mac OS X systems, including an introduction to some of the history and philosophy behind Unix, Mac OS X, and Unix applications. The adoption of Unix as the underpinnings of Mac OS X gives Mac OS X a powerful, modern foundation that helps resolve problems such as the lack of true multitasking and the lack of true protected memory that plagued all previous versions of the Mac OS. The combination of Unix and the graphical sophistication and application base that have always exemplified the Mac OS make Mac OS X a good contender for the one true operating system of the future. No operating system or book is perfect or totally self-contained. Improvements and enhancements are always being made, and additional sources of information can contribute to your understanding of any computer-related topic, especially a cutting edge project such as Mac OS X. The appendices to this book provide some guidance about how to identify and resolve problems that you may encounter, and also suggest some Web sites where you can get additional, up-to-date information about Mac OS X.
PART
V
Appendixes A This Is a Mac—What Could Go Wrong? B Where to Go for More Information
This page intentionally left blank
Appendix A This Is a Mac—What Could Go Wrong?
532
Part V
Appendixes
veryone likes to think that his or her favorite operating system is a flawless diamond, whereas other operating systems are lumps of coal. Because Mac OS is “the other” commercial operating system for personal computers, Mac lovers often have an inferiority complex of sorts. This often manifests itself in extreme advocacy for their favorite platform to the point where they’ll tend to gloss over problems, often even ignoring them in order to bang the drum for the Mac OS. A handy rule that I often apply when confronted by a zealot for any computer program or application is von Hagen’s first rule of computing, which says “Insert name here is a computer program. It has bugs.” This is true of word processors, system utilities, operating systems, and every other piece of software. The fact that there may be problems with a piece of software or even an operating system doesn’t mean that you can’t or shouldn’t use it—you often just have to be a bit more clever.
E
Bugs are simply flaws in the logic or implementation of a computer program. I have never seen a perfect computer system—there are always ways to break things or to make a program fail by asking it to perform some extreme task or accept input that the original author never thought of. This is even more true today than in the past because today’s applications depend on layers of infrastructure that most users are not aware of. Running a program under an operating system such as Mac OS X makes you the potential beneficiary of problems in the Unix kernel, the swapper, memory management routines, the Foundation and Application Kit frameworks, Cocoa, Objective-C, Aqua, the Finder, and a host of other pieces of operating system and GUI software. These are just possible software problems— you could also be the victim of a stuck bit in one of the memory chips inside your computer, a flaky component on your Mac’s motherboard, a failing disk drive, and countless other pieces of hardware. Problems occur. The key to dealing with them is to either identify and resolve the source of the problem or to find an alternate way of accomplishing the same task. This appendix discusses the types of problems that you may encounter when running Mac OS X or Mac OS X applications and provides some guidelines for trying to resolve them.
Counting the Ways Using a computer is much like operating any other piece of complex machinery— the more complex the machinery, the greater the number of potential problems
This Is a Mac—What Could Go Wrong?
Appendix A
that you may encounter. When using any type of computer, possible problems can occur in the hardware, hardware configuration, operating system, and applications. This section summarizes the types of problems you may encounter when using Mac OS X. This section is not intended to make you nervous. On the contrary—figuring out exactly where the problem lies is the first step to diagnosing and resolving it. Some problems are fairly easy to diagnose and resolve—“Flames are shooting out of the side of my monitor,” for example, generally indicates a hardware problem with a fairly straightforward solution. Other problems are not so obvious, and being able to diagnose them not only helps you get running again, but can also be pretty darn good for your ego.
Pilot Error Sadly enough, many computer problems fall into a class of problems known as pilot error. This is a nice, humorous way of saying that they’ve been caused by a misunderstanding on the part of the person using the computer system. In the technical and product support industries, euphemisms include PEBKAC (Problem Exists Between Keyboard And Chair, meaning that the source of the problem is the user, not the software or hardware), and the less-flattering UBD (User Brain Damage, meaning that the problem was caused by such extreme stupidity on the part of the user that physical brain damage is suspected). The bottom line is that most problems are caused by someone not understanding how to use the software or operating system or having unintentionally misconfigured their system. The first thing to do when experiencing any sort of problem is to determine if you’re using the software correctly. If you were running a program and it crashed, chances are that this is not your fault, but if you’re executing a command, trying to print a document, trying to format some text in a word processor, or something else along those lines, the problem could be something that you can easily resolve. Anger makes this more difficult. Walk away from your computer and take a break. Check the manual or consult online help to make sure that you’re doing the right thing. If you’re sure that you’re using the software correctly and that your system and any other hardware you’re using is turned on and is configured correctly, congratulations—it’s probably not your fault. It’s time to try to figure out where the problem really is.
533
534
Part V
Appendixes
Bugs! As mentioned in the introduction to this chapter, my general rule for determining whether a piece of software or an operating system may have bugs is: “Is it a piece of software? Then yes, it has bugs.” However, the fact that a piece of software or an operating system has problems doesn’t mean that you shouldn’t use it—you just have to be a bit more clever. Bugs can manifest themselves in a number of different ways. Some of the most common manifestations of bugs are situations such as the following: ◆ The program you’re running simply exits instantly without an error message. ◆ The program you’re running quits and Mac OS X displays its generic error dialog box, saying “The application application-name has unexpectedly quit.” ◆ The application is still visible on the screen but does not respond to keyboard or mouse input. If the program was in the middle of an operation such as writing to disk, you may see the spinning OS X busy wheel forever. This is generally described as the application having hung, because it is apparently suspended, waiting for some event that will probably never happen. ◆ You see a bunch of cryptic text characters in the upper left hand corner of the screen that overwrite the Aqua interface and prompt you to enter the debugger. This means that Mac OS X itself has crashed. Dealing with bugs is an art form unto itself, but there are some general workarounds. If you need to perform a certain task in your application and the problem recurs each time you perform that task, you’ve almost certainly encountered a bug. If your application crashes when you press Å+Option+Backspace, try not pressing that combination of keys. If there is an alternate way of executing the same command, try using it.
Configuration Errors Configuration errors are the most common source of computer problems, and are a specialized form of Pilot Error—in this case, you (or someone else) has misconfigured some part of your computer system. Common places for making configuration errors are when setting up printers or configuring your system’s network interfaces. Entering the wrong host name, port number, or phone number for
This Is a Mac—What Could Go Wrong?
Appendix A
PPP connections and so on are all configuration errors that are easy to make but hard to track down. When you encounter a problem with your computer’s interaction with a specific device (such as a printer or the network) or a specific application (mail and Usenet clients being the most common source of problems), but everything else on your system works correctly, suspect a configuration problem. To resolve these sorts of problems, you first identify the device or application that you’re having problems with, and then literally step through each aspect of its configuration, checking each value. It’s time-consuming but it’s unavoidable. The only way to resolve a configuration error is to correctly reconfigure the device or software that’s having a problem.
Viruses and Worms Viruses are malicious applications that can delete files, wipe your hard drive, propagate themselves by infecting other programs, and generally wreak havoc on your computer system. Worms are programs that only replicate themselves, typically consuming system resources along the way. Viruses are typically triggered by executing an infected program, which launches the virus, which begins doing whatever damage it is programmed to do. Worms are typically launched by a user on one computer system, and then begin to propagate themselves throughout your machine or over the network to other machines. Viruses cause damage. Worms waste time and resources. “Macs don’t get viruses” is a common claim, and it’s largely true—at least in comparison to Windows-based PC systems where viruses are rampant and often fatal. Older Mac OS systems were largely virus-free because older Macs booted using routines stored in Read Only Memory (ROM) chips on the motherboard. It’s impossible to overwrite or rewrite ROMs unless they’re erasable in the first place, and then only if you use a piece of hardware to erase, modify, or rewrite them. Windows-based PCs, on the other hand, load boot code from boot blocks stored on the computer’s hard disk. Because users need to be able to write to this area when repartitioning or formatting hard disks, sneaky programs can do so too. Even though Mac OS X uses boot information stored in a combination of ROM and Parameter Random Access Memory (PRAM), which can be updated by applications or by someone at the console, Mac OS X is extremely virus-resistant because it takes advantage of the power of Unix to protect parts of the system from damage. On most Windows systems, users have to be able to write to system directories to install software. On Mac OS X and other Unix systems, only
535
536
Part V
Appendixes
administrators can write to system directories, delete or modify system files, and so on. If you are using your OS X system as a standard user and have not enabled the root account, it is extremely difficult to trigger a virus that does anything more than damage your personal files—you literally don’t have the ability to write to the rest of the system. In general, there are extremely few cases of viruses on Unix systems. The most common virus-like problem on a Unix system is a type of program known as a Trojan Horse, which is a program that pretends to be a well-known program, but is actually something else altogether. Like the Trojan horse in Homer’s Iliad, Trojan horses appear to be something you want, but contain something you don’t want. Once you execute a Trojan horse, it can do anything to your system that you have permission to do. A common trick in high school or college is to create a shell script or program with the name of a familiar Unix utility, such as ls or ps, and leave it where someone may accidentally execute it. This is why experienced Unix system administrators rarely add many directories (especially the current directory) to the PATH environment variable for the root user. The root user has access to every file, directory, and resource on a Unix system—accidentally executing a Trojan horse as the root user can cause serious problems on a Unix system. Though Macs don’t get viruses, Mac applications can. One of the most prevalent types of viruses found on Windows systems are viruses that specifically target applications from Microsoft. In Microsoft’s defense, all of their applications, such as Word, Excel, Outlook, Outlook Express, and so on, are designed to make life easy for users by being able to execute special functions or even commands within other Microsoft applications. This is generally intended to allow them to execute commands, but guess what—these hooks also can execute viruses. Viruses are often found in Microsoft Word macros or in e-mail attachments. Never open an e-mail attachment from someone you don’t know, and use a virus scanner (such as those discussed later in this chapter) to analyze the contents of incoming e-mail, Word documents, and other Microsoft-related files before ever opening them.
CAUTION If you are running Virtual PC or any other Macintosh PC emulator, your virtual PC is as vulnerable to PC viruses as you would be if you were actually running a PC. Be careful!
This Is a Mac—What Could Go Wrong?
Appendix A
Hardware Failure Hardware failure is a common source of problems, but can also be insidious. Problems where your monitor stops working or catches fire, your hard drive stops working, or the power supply in your computer fails are easy to identify and similarly easy (though perhaps expensive) to rectify. Unfortunately, most hardware doesn’t fail outright, but instead simply exhibits an increasing number of problems over time. You’d be tempted to overlook being unable to save a file in some random application as a bug, but if it begins to happen with increasing frequency, your hard disk or removable media drive may be failing. Similarly, all modern computer users have become accustomed to program crashes (sadly enough), but if many different programs begin to crash at random times, you may have a problem with one of your computer’s memory modules. Heat is the enemy of electronics—that’s why almost every computer has a fan. Even with constant cooling, some hardware exhibits problems only after it’s been on for a while—after certain components have heated up. If you see problems only after your machine has been on for a while and you suspect this as a pattern, turn the machine off and let it cool off. Then turn the machine on and immediately back your critical data up to some other device, such as a tape drive, removable media such as ZIP, JAZZ, CDRW or a writable DVD drive. Backups are the ultimate protection against hardware failure, because you can replace the bad hardware and restore your data.
TIP Always keep backups somewhere besides where you have your computer—this is known as keeping off-site backups. As trivial as this sounds, the computer industry is knee-deep in horror stories where backups were stored in the same location as the computer system they were made from, and a fire or other disaster destroyed both the original hardware and all the backups. A safe deposit box is a good and relatively inexpensive solution for storing backups of critical data. Backing up machines across the Internet is a popular way of doing backups today and guarantees that they are offsite. The down side of backing up machines across the Internet is in the rare case when you need to totally rebuild a machine from backups, but your backups are physically located in another state or somewhere else that you don’t have easy access to. This can substantially slow down the restoration process, and make you somewhat unpopular in a commercial setting.
537
538
Part V
Appendixes
Diagnostic Tools Though Mac OS X is fairly new, a fair number of utilities are available to help you analyze your system and identify and correct problems. Perhaps this isn’t all that surprising—operating systems may need diagnostic and repair tools more when they’re young than after they’ve been around for a while, because you’re more likely to uncover or encounter problems early on in the development and commercial use of any new operating system or application. This section summarizes some of the most popular diagnostic applications available for identifying and resolving hardware problems, identifying and removing viruses, and diagnosing and repairing disk problems.
Using the Apple System Profiler The Apple System Profiler application provided with Mac OS X is designed to provide you with information about the hardware and operating system in your system. This information is primarily intended to provide information that you can use when contacting customer support to report and resolve hardware and operating system problems, but can also be very useful when you’re trying to make sure that your system can correctly recognize all attached devices, internal hardware, memory, and so on. The following task explains how to use the Apple System Profiler to obtain a variety of information about your OS X system.
Task: Getting Information About Your System 1. Open the Applications folder by clicking the Applications icon in the Toolbar of a Finder window or by navigating to the \Applications folder on your system’s boot drive. 2. Double-click the Utilities folder to open it, and double-click the icon for the Apple System Profiler application. The main Apple System Profiler’s System Profile tab displays, as shown in Figure A.1. This tab displays general information about your OS X system, such as the version of Mac OS X that you’re running, the name of the device your system booted from, and the amount of memory in your system. Figure A.1 shows general information about the configuration of my iBook SE.
This Is a Mac—What Could Go Wrong?
Appendix A
Figure A.1 The Apple System Profiler.
3. Click on any right-arrow to display more detailed information about the related subject, or click on any down-arrow to collapse the detailed information about that subject that is displayed. For example, clicking on the right-arrow beside the Network overview label displays detailed information about the network devices in my iBook, as shown in Figure A.2. 4. Click the Devices and Volumes tab to view information about the devices that are attached to your system and the volumes that they contain, where appropriate. The Devices and Volumes dialog box displays as shown in Figure A.3. The information on this dialog box is organized based on the bus to which various devices are attached. As you can see in this figure, I have external devices attached to both the USB and FireWire ports on my laptop. 5. Click the Frameworks tab to display a list of the Mac OS X frameworks that are installed on your system. The first time you click this tab, the Apple System Profiler searches your system for all installed frameworks and displays a summary dialog box when the search completes, as shown in Figure A.4. Frameworks are sets of shared libraries that provide basic objects, methods, and related functionality for the various parts of Mac OS X and the applications that you’ve installed on your system. The Apple System Profiler’s Frameworks tab also indicates the version of each installed framework and whether that framework is provided by Apple.
539
540
Part V
Appendixes
Figure A.2 The Apple System Profiler showing detailed network information.
Figure A.3 The Apple System Profiler showing bus, device, and volume information.
This Is a Mac—What Could Go Wrong?
Appendix A
Figure A.4 The Apple System Profiler showing framework information.
TIP If you are only interested in frameworks, extensions, and applications on a single volume, restrict the devices that the Profiler searches for by selecting the Command menu’s Search Options command and deselecting any listed volumes to stop the Profiler from searching those volumes.
6. Click the Extensions tab to display a list of the kernel extensions installed on your system. As with the Frameworks tab, the first time you click the Extensions tab, the Apple System Profiler searches your system for kernel extensions, and displays a summary dialog box when the search completes, as shown in Figure A.5. Kernel extensions are loadable modules that Mac OS X uses to communicate with specific devices—not all of the kernel extensions listed are necessarily loaded on your system, but they are all available. This summary dialog box also provides the version of each kernel extension and whether the kernel extension was provided by
541
542
Part V
Appendixes
Apple or by a third party. This information can be extremely useful if you are having problems communicating with a specified device and need to determine if you have the latest drivers for that hardware.
NOTE Mac OS X kernel extensions are very different than the system extensions used in previous versions of the Mac OS. Do not delete or move Mac OS X kernel extensions unless you’re absolutely positive that you know what you’re doing.
Figure A.5 The Apple System Profiler showing kernel extension information.
7. Click the Applications tab to display a list of the applications that are installed on your system. As with the Frameworks and Extensions tabs, the first time you click the Applications tab, the Apple System Profiler searches your system for applications, and displays a summary dialog box when the search completes, as shown in Figure A.6. This summary also provides the version of each application and whether the application was provided by Apple or by a third party. This information can be extremely useful if you are having problems with an application and need to determine if you have the latest version.
This Is a Mac—What Could Go Wrong?
Appendix A
Figure A.6 The Apple System Profiler showing application information.
8. To save the output from the Apple System Profiler in a file for future reference or to forward it to customer or technical support, select the File menu’s New Report command. This command displays the dialog box shown in Figure A.7, which enables you to select which information to include in your report. 9. Click OK to display a report as shown in Figure A.8. Once this report has been generated, save it using the File menu’s Save or Save As commands, print it using the File menu’s Print command, and so on. You can close the report without saving or printing it by selecting the red close
Figure A.7 Specifying the information to include in an Apple System
Profiler report.
543
544
Part V
Appendixes
Figure A.8 A completed Apple System Profiler report.
button, in which case a dialog box displays that gives you one more chance to save the report before discarding it. 10. To exit the Apple System Profiler, select Quit Apple System Profiler from the Application menu or press the Å+Q hot key combination. As you can see from this example, the Apple System Profiler can provide version and status information for most of the hardware and software installed on your Mac OS X system. The Profiler is immediately valuable when contacting customer or technical support, but also can help you in your initial diagnostics, such as determining whether your system can find external devices that you have connected, what types of devices your system believes them to be, and so on.
Anti-Virus Software for Mac OS X Though Mac OS X itself is largely immune to system-level viruses due to its use of Unix as an underlying protection level, it is quite possible that you may receive Word or Visual Basic viruses in attachments to e-mail, in files that other users
This Is a Mac—What Could Go Wrong?
Appendix A
have given you, and so on. This section summarizes the anti-virus software available for Mac OS X at the time this book was written and gives you information about how to find and purchase it on the Internet. Any oversights or omissions from this list are unintentional! ◆ McAfee Virex 7: McAfee is one of the best-known names in the AntiVirus business, and they are very responsive to the latest viruses. Their software is excellent and extremely capable. For more information, see http://www.mcafeeb2b.com/products/virex/default.asp. ◆ Norton AntiVirus for Mac OS X: Peter Norton’s anti-virus software and related software have always been top notch. Now owned by Symantec, Norton AntiVirus for Mac OS X is no exception, offering protection against e-mail, document, and other OS X viruses. Norton AntiVirus also includes an Internet update service that makes it easy for you to keep the software up to date, protecting you against even the latest and greatest viruses. For more information, see http://www.symantec.com/nav/nav_mac/. ◆ Sophos Anti-Virus for Macintosh: Sophos is an established anti-virus software company located in the UK. Sophos Anti-Virus features an attractive e-mail notification service that automatically sends you e-mail when a new virus has been detected on your platform. Evaluation versions are available. For more information, see http://www.sophos.com/. ◆ VirusBarrier: Intego’s VirusBarrier provides a good deal of protection against viruses, features sophisticated logging and analysis tools, and also provide an Internet Update capability to keep your software up to date and your OS X system protected. For more information, see http://www.virusbarrier.com/virusbarrier/home.html. A number of free or shareware anti-virus packages that were formerly available for the Macintosh do not appear to be available for Mac OS X. You should not try to use anti-viruses packages designed for earlier releases of the Mac OS with Mac OS X.
Disk Repair/Recovery Utilities for Mac OS X As operating systems become more complex and more powerful, the number of processes being executed by the system at any given time increases. This is especially true of multiuser and server operating systems, where multiple users may be
545
546
Part V
Appendixes
accessing the system at a single time, and where server processes are running even when no user is specifically using the system. One of the potential side-effects of multiple users and large numbers of simultaneous processes working at the same time is disk corruption. When many processes have files open and are writing to writing them simultaneously, system crashes or a software failures may leave the computer’s file system in an inconsistent state. This means multiple files may claim ownership of the same disk blocks, file that were created are not linked into the filesystem because a directory update was not completed, or disk blocks that were actually allocated to files are not linked into those files because updates to the file were not successfully written to disk when the failure occurred. Mac OS X includes two software packages that correct many simple disk corruption problems. These are the Unix fsck (File System Check) and Mac OS X Disk Utility applications. Your OS X system automatically runs the fsck program as part of its boot process, and attempts to repair any problems with Unix filesystems each time you boot. If the fsck program detects a problem that it can correct, it reboots your system after resolving the problem to guarantee that your system is running from a logically correct disk, Unix-wise. Apple’s Disk Utility software works at the disk volume level, essentially below the level of the Unix filesystem. Disk Utility enables you to repair a wide range of low-level disk corruption problems, but provides an interesting bootstrapping problem. If you can’t boot your system, you can’t get to the point where you can run the built-in software provided by Apple to check and repair your disk. While this may seem like an irritation, it’s actually a safety measure of sorts—booting your system from a corrupt disk could easily introduce further corruption when you tried to repair the disk if your system’s idea of how the disk was organized is wrong.
TIP If you suspect disk corruption and don’t have easy access to a Mac OS X install CD, reboot your system in Unix’s text mode to use the fsck utility. Restart your system and hold down the Å+S key. This boots Mac OS X in single-user mode without activating the graphical components of Mac OS X. You can then enter the command /sbin/fsck y and press return to run the Unix filesystem consistency checker. If the fsck program makes any changes to your disk, you see a message along the lines of “Filesystem was modified.” If this is the case, execute the /sbin/fsck -y command again to verify that your system is now consistent, and then type the reboot command and press Return to reboot your system in standard Mac OS X mode.
This Is a Mac—What Could Go Wrong?
Appendix A
If your system crashes repeatedly, displays errors about being unable to write to the disk, or will not boot at all and you therefore suspect disk corruption, boot from your Mac OS 10.1 or better CD and select Disk Utility from the Installer’s Apple menu in the upper left-hand corner of the screen After a little while, the Disk Utility startup screen displays. Select the hard drive that contains your Boot Disk from the list in the left-hand panel, and select your Boot Drive (probably named Boot Drive). Click the First Aid tab to display the dialog box shown in Figure A.9.
Figure A.9 The Apple Disk Utility’s First Aid panel.
Click the Verify button to analyze the disk and identify any problems that it contains, or click the Repair button to simply proceed with analyzing and repairing the disk. If the Disk Utility encounters severe corruption, you may need to use a third-party utility to attempt to repair your disk, such as one of the following: ◆ Alsoft DiskWarrior: Alsoft’s DiskWarrior does extensive checking before disk writes to ensure the validity of the directory to which you are writing, and also check the validity of the data you are writing to disk. DiskWarrior is highly recommended, and is well worth a look. For more information about DiskWarrior, see the URL http://www.alsoft.com/ DiskWarrior/index.html.
547
548
Part V
Appendixes ◆ MicroMat’s Drive 10 and TechTool Pro: MicroMat is a well-known and respected vendor of software for the Macintosh. Their TechTool Pro software has been around for a long time and has a good track record of disk repair and recovery going back through a few versions of the Mac OS. Drive 10 is a stripped down version of their software for Mac OS X that focuses on checking and repairing disk corruption. For more information about MicroMat’s products, see the URL http://www.micromat.com/. ◆ Norton Utilities and Norton SystemWorks for Macintosh: Peter Norton’s software has always been top-notch. Two different packages of Norton disk repair and recovery tools are available for Mac OS X. The Norton Utilities package includes classic utilities such as Disk Doctor, FileSaver, Speed Disk, and UnErase. Norton SystemWorks for Macintosh is a somewhat more ambitious (and slightly more expensive package) that includes all of the Norton tools for disk repair and recovery plus Norton’s Anti-Virus software, and also includes bundled third-party utilities such as Alsoft’s DiskWarrior and Dantz’s Retrospect Express backup software. Apple has a good summary of the Symantec offerings for Mac OS X at the URL http://www.apple.com/macosx/ applications/symantec/symantec2.html, or you can get this information from Symantec’s product site at http://www.symantec.com/product/. ◆ ProSoft Data Rescue: Data Rescue is a disk repair and recovery package that has gotten rave reviews from users, especially for Mac OS. The Data rescue Software formerly available from WildBits at Data Rescue was purchased by ProSoft in early 2002 from its original author. For more information about Data Rescue, see the URL http://www.prosofteng.com/index.php?datarescue.
Troubleshooting Recognizing that your system has problems is usually fairly easy—software or hardware stops working, applications crash, or you may not even be able to boot your OS X system at all. This section discusses some of the most common problems you may experience when using Mac OS X, and provides suggestions for resolving them.
This Is a Mac—What Could Go Wrong?
Appendix A
Troubleshooting Internet Connections Given that using the Internet is one of the primary goals of most computer users, having problems connecting to the Internet can be extremely frustrating. Apple has always had an excellent reputation for simplifying any kind of networking, including connecting to the Internet itself. The way in which you are trying to connect to the Internet determines the types of things to look for when you can’t establish a connection. The next two sections discuss problems connecting to the Internet using a modem (and thus through a PPP connection) and through a network connection such as a cable modem, DSL (Digital Subscriber Line) or ADSL (Asynchronous Digital Subscriber Line) modem, or direct network connection.
Analyzing PPP problems When you experience problems establishing a dialup connect to the Internet, the first thing to check is your hardware. Though “Is it plugged in?” is an irritating to question to hear when you’ve been on hold with customer support for an hour or two, it’s less troubling in printed form. Make sure that the telephone cable from your system’s modem to your OS X system is correctly connected at both ends, and that the phone jack you’re connecting to actually works—try plugging a phone into it and placing a call. Also, make sure that you’ve actually connected your phone line to the modem port in your computer, not the Ethernet port. The two jacks look very similar, and the Ethernet jack (RJ-45) is typically larger than the modem jack (RJ-11). It’s pretty easy to accidentally insert your phone jack into an Ethernet port. If you can connect to your ISP with your Mac but you can’t stay connected for long, the quality of your phone connection is probably the source of the problem. Poor connections that work fine for placing voice calls can pose problems for Internet connections because your OS X system and your ISP typically check the contents of the packets you send in both directions—if they don’t match (which can easily be the case on a poor-quality phone line), one end or the other may drop the connection. If you suspect that a specific phone jack is the problem, you can try dialing in using another phone jack in your home or office.
549
550
Part V
Appendixes
TIP Before spending much time debugging PPP problems, make sure that you’re running the latest version of Mac OS by running the System preferences application’s Software Update panel. Many problems with PPP have been fixed in the last few releases and upgrades to Mac OS X.
Another potential cause of dropped connections are services such as call waiting and call forwarding, which typically send special signals down the line when someone calls you but you’re already using the phone. Disable these services by entering a special code as part of the dialing sequence—i.e., the phone number that connects to your ISP. If your phone jacks and lines seem to be fine, or if you simply can’t connect to your ISP at all, make sure that you have the right phone number by using a regular phone to place a call to the number you were given. If you hear a warbling, hissing noise at the other end, then you probably have the right number (or you’re at least connecting to somebody’s modem somewhere). Next, make sure that you’ve actually enabled the modem on your system. Do this by running the System Preferences application and selecting the Network panel. Make sure that your system’s modem is active in the location that you are currently using by selecting the drop-down list beside the Show label and selecting the Active Network ports entry. This displays the dialog box shown in Figure A.10. Make sure that the Internal Modem entry is checked (if your system has an internal modem) or that any entry for an external modem is checked if you are using a USB modem or other external modem. If not, activate it, click Apply Now to save any changes that you’ve made to the current location, and try connecting again.
NOTE If the selection for your modem settings are grayed out and can’t be changed, click the lock icon in the lower left corner of the Network panel. This displays an authentication dialog box where you can supply the name and password of a user with administrative privileges who can change your system’s network settings.
This Is a Mac—What Could Go Wrong?
Appendix A
Figure A.10 Verifying that your modem is active in the System Preferences
Network panel.
If you have other network devices active on this panel but you are primarily connecting using your modem, drag the Internal Modem (or other modem) entry to the top of the list to make this the first network interface that your OS X system uses.
NOTE After making any changes to your system’s modem settings, click Apply Now and then try connecting again. Any changes that you make are not actually made and saved until you click Apply Now.
If your modem was already selected, select the modem entry from the drop-down list beside the Show label and click the Modem tab, as shown in Figure A.11. Make sure that Dialing settings for your modem match those used by your phone line. You can’t use tone dialing if your phone line only supports pulse (click-style) dialing. You should also make sure that the Enable Error Correction… checkbox
551
552
Part V
Appendixes
Figure A.11 Checking modem settings in the Network panel.
is selected, because this setting helps your modem deal with problems such as interference from other electronic devices or occasional static on your telephone line. Once this setting is enabled, your modem and ISP will automatically resend any packets that appear to have been corrupted somewhere along the line. Next, select the TCP/IP tab, as shown in Figure A.12. The Configure field should show the entry Using PPP if your ISP automatically provides you with an IP address and other networking information once you establish a connection. If it displays the entry Manually, select Using PPP. Next, click the PPP tab to double-check the settings you’ve entered for the PPP connection to your ISP. The PPP panel displays, as shown in Figure A.13. It never hurts to double-check all of the phone numbers you’ve entered on this panel by calling them from a standard telephone and making sure that you hear the warbling, hissing sound of a modem at the other end. Also verify that you’ve entered the name of your ISP account correctly. If you’ve checked the Save password checkbox, erase and re-enter the password for your ISP account, just in case. One common problem you may encounter with a PPP connection to the Internet is that you can establish it by manually connecting to the Internet, but that it does
This Is a Mac—What Could Go Wrong?
Figure A.12 Verifying that PPP is selected in the Network panel.
Figure A.13 Verifying PPP settings in the Network panel.
Appendix A
553
554
Part V
Appendixes
not start automatically when you execute an Internet-oriented application. Whether or not a PPP connection starts automatically when you execute a network application is determined by your advanced PPP options, which you can display by clicking the PPP Options button at the bottom of the PPP tab. This displays the drop-down options panel shown in Figure A.14. If you’re expecting this behavior and it’s not happening, make sure that the Connect automatically…. checkbox at the top of this panel is selected.
Figure A.14 Verifying advanced PPP settings on the Network panel’s PPP tab.
Most of the other options on this panel control when your system will automatically terminate your PPP sessions, which probably isn’t your biggest concern if you can’t get or stay connected in the first place. The advanced options at the bottom can be important, however—if you follow the instructions in this section and you still cannot successfully connect to your ISP, call their technical support line and ask whether they use TCP header compression, which is a way of reducing the amount of data that has to be sent over the modem with each PPP packet. Their answer should match the setting of the Use TCP header compression checkbox on this panel.
This Is a Mac—What Could Go Wrong?
Appendix A
Finally, if you can connect to your ISP successfully but can’t connect to the Web, download files, and so on, your ISP may be using proxies that your system isn’t configured to use. Proxies serve as central clearinghouses for various types of Internet and network connections. Many ISPs use proxies to implement things such as filtering out pornographic sites, or simply to increase security at the ISP by running standard network services on different network ports than those services typically use. To see your current proxy settings, click the Proxies tab, which displays the dialog box shown in Figure A.15. Contact your ISP’s technical or customer support personnel to find out what settings you should be using on this panel, if any.
Figure A.15 Verifying proxy settings on the Network panel’s Proxies tab.
To activate a proxy, click the checkbox beside the service that your ISP is using a proxy for and enter the hostname (or IP address) and port number that were supplied by your ISP or their technical support personnel. At this point, you should be able to connect to your ISP using PPP. Congratulations, and welcome to the Internet. If you’re still having problems connecting, contact your ISP for any additional information or assistance.
555
556
Part V
Appendixes
Analyzing Network Connectivity Problems Believe it or not, connecting to a network (or to your ISP) through a cable or ADSL/DSL modem is actually often simpler than trying to connect to an ISP using PPP. Cable, DSL, and ADSL services are generally referred to as broadband services because they provide a much higher communication rate than it is physically possible for you to get over a standard telephone line. The connection and connection processes for cable, DSL, and ADSL modems are all conceptually very similar—once the high-speed modem is successfully connected in your home (usually done by the cable company, phone company, or whoever sold you the DSL/ADSL service), you connect these modems to your system’s network port. Though some broadband ISPs still give you a static IP address (a specific IP address that is uniquely assigned to your connection), most cable, DSL, and ADSL ISPs nowadays assign IP addresses dynamically using a protocol called DHCP (Dynamic Host Control Protocol). Using dynamic IP addresses reduces the number of IP addresses that the ISP must pay for, because it’s likely that not all customers will always be simultaneously connected to the Internet. Because cable, DSL, and ADSL modems connect to your system’s Ethernet port, the problems you may encounter when using them are exactly the same as the problems you might experience when directly connecting your system to any network. This section provides suggestions for resolving the most common network connectivity problems you may experience when using Mac OS X. If you are having problems connecting to the Internet through a network connection, first check that you are actually connected to the network, cable service, or DSL/ADSL provider. This is the standard “check that everything’s plugged in and turned on” initial advice. Next, make sure that you’ve actually enabled the Ethernet connection on your system. Do this by running the System Preferences application and selecting the Network panel. Make sure that your system’s Built-in Ethernet or Ethernet connection is active in the location that you are currently using by selecting the dropdown list beside the Show label and selecting the Active Network ports entry. This displays the dialog box shown in Figure A.10. Make sure that the Built-in Ethernet entry is checked (if your system has a built-in network device) or that any other entry for an Ethernet card is checked if you are using an Ethernet card that you installed in your system. If it not, activate it and try connecting again.
This Is a Mac—What Could Go Wrong?
Appendix A
NOTE If the selections for your network settings are grayed out and can’t be changed, click the lock icon in the lower left-hand corner of the Network panel. This displays an authentication dialog box where you can supply the name and password of a user with administrative privileges who can change your system’s network settings.
If you have other network devices active on this panel but are primarily connecting using your Ethernet card, drag the entry for your Ethernet card to the top of the list of available network ports to make this the first network interface that your OS X system uses. Click Apply Now to save any changes you’ve made to the current location, and try connecting again.
NOTE After making any changes to your system’s network settings, click Apply Now and then try connecting again. Any changes that you make are not actually made and saved until you click Apply Now.
Next, click the drop-down menu beside the Show label and select your Ethernet device from the menu. If your ISP is using DHCP, click the TCP/IP tab and select Using DHCP from the drop-down menu beside the Configure label, as shown in Figure A.16. You can optionally supply the IP addresses of any name servers that you want to search before any of the ones that are automatically supplied by your ISP. Similarly, you can enter the name of a specific domain to search before the one that is supplied by your ISP. You may want to do this if, for example, you have a home network to which your machine is connected and you want to be able to locate hosts on that network by short name. For the most part, you would only add specific DNS servers or search domains if you had a home network and your cable or DSL/ADSL modem was being used as a gateway from that network to the Internet. Configuring a home network in this fashion is outside the scope of this troubleshooting section, though knowing that this is possible is the first step to actually implementing it. Click Apply Now to save any changes you have made—if the TCP/IP panel displays IP address, subnet mask, and router information, congratulations—you’re connected!
557
558
Part V
Appendixes
Figure A.16 Verifying DHCP settings on the Network panel’s TCP/IP tab.
The Using DHCP setting shown in Figure A.16 is one of two possible DHCP configurations that may be used by your ISP. The other is the Manually Using DHCP Router setting, which is very similar, but you must enter the IP address of the DHCP server provided by your ISP. This option is not used by many ISPs, but is provided by Apple just in case. A quick phone call to your ISP should determine how your ISP uses DHCP. If your ISP provided a static IP address, select Manually from the drop-down menu beside the Configure label and enter the IP address, subnet mask, router, and DNS entries that your ISP provided when you subscribed. Click Apply Now to save your changes and try starting your Web browser. If the home page that you selected in your browser displays, congratulations—you’re connected! As discussed in Chapter 16, some ISPs now use PPPoE (PPP over Ethernet) to further reduce the number of IP addresses they need. If your ISP uses PPPoE, click the PPPoE tab and supply your account name and password, as shown in Figure A.17. Click Apply Now to save your changes and try connecting to the Internet. If everything works correctly, congratulations! If not, read on.
This Is a Mac—What Could Go Wrong?
Appendix A
Figure A.17 Verifying settings on the Network panel’s PPPoE tab.
If you believe that you are successfully connected to your ISP but still can’t connect to the Web, download files, and so on, your ISP may be using proxies that your system isn’t configured to use. Proxies serve as central clearinghouses for various Internet and network connections. Many ISPs use proxies to filter out pornographic sites or simply to increase security by running standard network services on different network ports than those services typically use. To see your current proxy settings, click the Proxies tab, which displays the dialog box shown in Figure A.15. You may need to contact your ISP’s technical or customer support personnel to find out what settings you should be using on this panel, if any. To activate a proxy, click the checkbox beside the service that your ISP is using a proxy for and enter the hostname (or IP address) and port number supplied by your ISP or their technical support personnel. If you can connect to TCP/IP web services but cannot access Apple printers or file servers that you know should be available, make sure that AppleTalk is enabled on your system by clicking the AppleTalk tab. The panel shown in Figure A.18 displays.
559
560
Part V
Appendixes
Figure A.18 Verifying settings on the Network panel’s AppleTalk tab.
It is fairly rare to want to use AppleTalk through an ISP because this enables other users to see your AppleTalk printers and file servers as easily as you can see theirs. However, on a corporate network, AppleTalk often is used to print to AppleTalk printers and mount and share files with AppleTalk file servers. If you need to enable AppleTalk, you will probably also have to select Manually as your AppleTalk Configuration option and manually specify the AppleTalk zone to which your AppleTalk communications should be restricted. Obtain the name of your AppleTalk zone from your ISP or network administrator. At this point, you should be able to connect to your network. Congratulations, and welcome to the Internet! If you’re still having problems connecting, contact your ISP or network administrator for additional information or assistance. If you’re using a laptop, you might be able to convince them to let you stop by and try to connect from their offices to ensure that your hardware is working correctly.
Resolving Application Problems Resolving problems such as PPP or network connectivity are essentially one-shot solutions—once you’ve identified and resolved the problem, things are fine for the
This Is a Mac—What Could Go Wrong?
Appendix A
rest of your life (or at least until you switch ISPs). Dealing with problems running applications is an entirely different issue. Each application is a separate entity with its own bugs, usability issues, implementation problems, and so on. This section highlights some of the ways in which applications can fail, shares some potential solutions for eliminating or working around those problems, and provides suggestions for resolving specific types of problems that you may encounter with multiple applications. One of the more frustrating things is to have an application hang or otherwise become unresponsive. In some ways, having the application crash outright is less frustrating, because at least in that case you aren’t being teased by being able to see your work on the screen without being able to save it. When running an application and the application becomes unresponsive to mouse or keyboard input, try the following steps to either resolve the problem or verify that it is indeed hung: ◆ Check your hardware—If you can no longer move the cursor at all, make sure that the mouse is still connected to your system. If the system no longer responds to keyboard input, quickly check your keyboard connection. It only takes a second to eliminate these as a potential source of problems, but if they should happen to be the actual cause, you’ll be glad that you checked the obvious before asking someone else for help. ◆ Minimize all application windows—If the application still responds to some extent (for example, if the Window controls work but you can’t type anything into its main window), minimize all of its windows by clicking on the yellow window control in the upper left corner of each application window. The application may have displayed a dialog box that is waiting for input. You may need to minimize all application windows to check this. ◆ Switch to another application and then return—Use the mouse, Dock, or the Å+Tab hot key combination to switch to some other application (including the Finder) and then reactivate the frozen application. In some cases, doing this causes Mac OS X and/or the Finder to wake up the application so that it now respond to your input. If this is the case, save your work immediately and exit the application—if the application became confused once, it may do so again.
561
562
Part V
Appendixes
TIP If you are working in an application and that application becomes unresponsive or begins to misbehave (incorrectly drawing the screen, automatically terminating windows, or anything along those lines), always immediately save your work and exit the application. Then restart the application and try using it again. However, when saving data in an application that appears to be malfunctioning, always save your work under a new filename. If a program is misbehaving in one sense, it may be misbehaving in others, including the ways in which it saves your data. Once you exit the application and restart it, examine your emergency save file. If it is correct, you can rename it to your actual data file. If it is not, you’ll be glad that you didn’t overwrite your previous version.
◆ Send a Quit event to the application—if you can’t explicitly invoke the application’s Save command, try pressing Å+Q to send the application a quit signal. In some cases, this causes the application to ask if you want to save your work before exiting. If none of these approaches help you save your work or terminate the application, you may need stronger measures, such as those described in the next section.
Terminating Applications If an application freezes or hangs, and the suggestions in the previous section don’t resolve the problem, you need Mac OS X to terminate the application. This is known as issuing the Force-Quit command or, in the more general Unix vernacular, as killing the process or shooting down the application, There are several ways to force-quit an application; try them in this order: ◆ Select the Force-Quit command from the Apple menu in the upper left corner of your screen while the application is the active application in the Finder. ◆ Press the Å+Option+Escape key combination while the application is the active application in the Finder. ◆ In the Dock, hold Option while clicking on the application’s icon. Any of these three approaches should display the Force-Quit Applications window, shown in Figure A.19. Once this window displays, select the application to terminate from the list displayed in the Force-Quit Applications window, and click Force-Quit.
This Is a Mac—What Could Go Wrong?
Appendix A
Figure A.19 The Force-Quit Applications window.
If the application still refuses to terminate, it’s time to move down a level. Doubleclick the ProcessViewer icon from your Applications folder’s Utilities sub-folder. The ProcessViewer window displays, as shown in Figure A.20. This application provides a high-level graphical equivalent of the Unix ps (process status) command, letting you see a listing of all of the processes running on your machine, examine the resources that they are using, and so on.
Figure A.20 The ProcessViewer window.
Each application running under Mac OS X typically has multiple processes and/or threads associated with it. This is partly because of the internal complexity of the OS X application support structure, but also because many modern applications use threads or subprocesses to simplifying multitasking, because each of these can be awakened and executed separately by the OS X kernel. You should, however, be able to scroll through the list and locate one or more processes whose name is clearly associated with the troublesome application.
563
564
Part V
Appendixes
To terminate a process from within the ProcessViewer, double-click its name. A dialog box such as the one shown in Figure A.21 displays. Click OK to terminate the process.
Figure A.21 The dialog box for terminating a process from the ProcessViewer.
If you still can’t terminate the application, log out and then log back in again. Logging out terminates all processes that you are currently running and displays the standard login screen. After logging out and logging back in, you will not see the windows associated with the problem process on your screen. Unfortunately, this does not always guarantee that all of the subprocesses or threads associated with that process have actually exited. Use the ProcessViewer to determine whether any of these are still running—if they are, or if you can’t open your data files because Mac OS X believes that they are still locked, your last resort is to reboot your machine by selecting the Apple menu’s Restart command.
Mapping Files to Applications A common problem with any graphically oriented computer system is determining which application should open certain files. Historically, the Mac OS uses the file type and creator codes inside the resource fork of Macintosh files to determine the application that should open certain types of files—with Mac OS X, Apple adopted a mixed strategy that still uses the file type and creator codes, but also checks file extensions (as Microsoft Windows does). On Mac OS X systems, you may find that certain types of files are associated with applications that are only available in Classic mode, which means that it takes longer to open those files, because Mac OS X first has to start its Classic mode and then start the appropriate application. Mac OS X’s Classic mode is discussed in greater detail in the last section of this Appendix. Mac OS X makes it easy to change the application associated with certain types of files. First, select a file of the type that you want to bind to a specific application
This Is a Mac—What Could Go Wrong?
Appendix A
and select the Finder’s Show Info command (or press the Å+I hot key combination). This displays the Finder’s Show Info dialog box, as shown in Figure A.24. Click the drop-down menu near the top of the Show Info window and select the Open with application command. This displays a dialog box such the one shown in Figure A.22, which displays the application currently associated with that type of file.
Figure A.22 The Finder’s Open with Application dialog box.
To modify the application associated with that type of file, click the icon in the middle left of the Show Info dialog. This pops up a menu that lists the application currently associated with the selected type of file. Click Other to display the dialog box shown in Figure A.23. Browse to the location of the desired application, select that application, and click OK to update Mac OS X’s association for the selected type of file.
Deleting Locked Files You may occasionally find that you are unable to delete files because they are marked as being locked. You may be unable to drag a file to the trash, or unable to empty the trash. Under earlier versions of the Mac OS, you could hold Option when selecting the Empty Trash command, and Mac OS would delete locked files. Under Mac OS X, do the equivalent by holding Option and then clicking and holding the mouse button over the dock’s Trash Can icon. In most cases, this deletes any locked files that are already in the trash. However, this doesn’t help if you can’t move the locked file into the trash in the first place.
565
566
Part V
Appendixes
Figure A.23 The Finder’s Choose Other Application dialog box.
To unlock a file in Mac OS X, select the file’s icon and select the Finder’s Show Info command (or press the Å+I hot key combination). This displays the Finder’s General Information dialog box, as shown in Figure A.24. If the checkbox beside the Locked entry is selected, deselect it. Now you should be able to delete the file or empty the trash. If the Finder displays a dialog box indicating that you do not have permission to unlock or modify the file, use the OS X Terminal application and the sudo com-
Figure A.24 The Finder’s General Information dialog box.
This Is a Mac—What Could Go Wrong?
Appendix A
mand to unlock and delete the file. Start the Terminal and change to the directory where the file is located, then issue the command: sudo chflags noschg,nouchg filename
Replace filename with the name of the file that you want to unlock. Now you should be able to delete it.
Restarting Applications After They Crash Once an application crashes or hangs, you may have problems restarting it—the application may restart incredibly slowly, or may appear to start and then hang. In these cases, try the following things: ◆ Check your system for file or filesystem corruption: If you have problems starting one or more applications after another application crashed or hung on your system, your system’s filesystem may be corrupt or inconsistent. Applications that crash or hang may leave your filesystem in an inconsistent state, which can cause problems the next time you start any application that automatically creates a new or temporary document, graphics file, and so on. If possible, follow the suggestions in the “Disk Repair/Recovery Utilities for Mac OS X” section of this chapter before proceeding. ◆ Open the application standalone: If you were working on a specific file and the application you were using crashed or hung, that input file may be corrupted. In that case, double-clicking on the file to start the application may cause it to crash or hang again. Try starting the application by itself by selecting its icon from the Finder’s Application window. If the application starts successfully in this mode, try opening the file by browsing from its Open command. If the application hangs when you re-open a specific file, you’ve found the problem. ◆ Check the application’s preferences file: If an application formerly worked fine, check the application’s preferences file. Most applications have a global preferences file located in the /Library/Preferences directory. Personal configuration information for applications is stored in the ~/Library/Preferences directory, in files or directories with the same name as your application. If other users can execute the application without problems but you cannot, try moving that application’s preferences file to another directory and then starting the application.
567
568
Part V
Appendixes ◆ Delete temporary or cache files: If you are having problems with a browser or other application that maintains a cache of recently visited files, use the Finder to locate the directory where those files are stored and delete them before restarting the application. ◆ Reinstall the application: Systems problems such as filesystem corruption may occasionally corrupt the binaries, shared libraries, or other files that actually make up part of the application itself. If these files are damaged, the easiest and most complete solution is to simply reinstall the application. Do this only as a last resort.
The suggestions in this and preceding sections should help you get past most of the problems that may arise in day-to-day use of applications under Mac OS X. However, running applications in OS X’s Classic mode, where Mac OS 9 essentially runs as a subprocess of your OS X system, has its own potential problems. The next section provides an overview of some of the problems that you may encounter when running older Mac OS applications in OS X’s Classic mode, and suggests workarounds wherever possible.
Mac OS X Compatibility Issues As you’ve seen throughout this book, Mac OS X is a quantum leap forward in terms of the performance and capabilities of the Macintosh operating system. As discussed earlier in this book, Mac OS X provides backward compatibility with and support for applications written for older versions of the Mac OS X by providing its Classic mode, which is essentially a complete copy of the last version of the standard Mac OS, Mac OS 9, that you can run as a sub-process under Mac OS X. Because everything about Mac OS X is new, including critical subsystems such as its memory allocation and memory management routines, some of the techniques used in older Macintosh applications are incompatible with Classic mode. The most common types of problems encountered with older applications running in Classic mode are the following: ◆ Problems with one application affect them all: If you have problems with any application running in Classic mode, remember that all Classic applications share the same pool of memory, exactly as all versions of the Mac OS did prior to Mac OS X. Once an application crashes or hangs in Classic mode, save your work in all other Classic applications, exit from
This Is a Mac—What Could Go Wrong?
Appendix A
those applications, and use the System Preferences application’s Classic panel to stop Classic mode. Then restart it if you need to continue working with Classic applications. ◆ Problems with Extensions: Under versions of the Mac OS prior to OS X, extensions were essentially plug-in patches for the operating system itself. Though these function much like OS X kernel extensions, the Mac OS’s memory management and protection routines made them somewhat problematic. Running extensions in an emulated version of an older operating system increases the potential for misbehavior. If you install applications in Classic mode that add extensions to your Classic System Folder, and you are not actively using them, move those extensions to another folder (in case you subsequently discover that you need them).
TIP Minimize the number of extensions that you load in Classic mode. Use the OS 9 Extensions Manager or third-party applications such as Conflict Catcher to create minimal sets of extensions for normal use, and more complex ones for applicationspecific purposes. To reduce the general memory requirements of Classic mode, minimize the number of control panels that you load in Classic mode. Control panels are generally safer because they do not interact with the system at the same low level as extensions.
◆ Problems with direct hardware access: Prior to Mac OS X, the Mac OS was a single-user computer system. Multiple users could use a Mac in succession, but not at the same time. Simultaneous access to devices was essentially impossible. Mac OS X, however, is a completely multiuser operating system that imposes protections and ownership on devices. If you absolutely must use older hardware-oriented software such as scanners, CD burners, and so on in Classic mode, boot the system in Classic mode rather than using this software in emulation mode under Mac OS X. ◆ Font problems: Mac OS X uses fonts from both the System Folder’s Fonts directory and from various generic and application-specific directories. If you are having problems running a specific application or displaying a document in a specific font, check the fonts in the system’s /Library/Fonts directory, as well as in any Fonts directories in your
569
570
Part V
Appendixes
~/Library directory. In general, minimizing the number of fonts on your system is always a good idea (as long as you’re not using them, of course). ◆ Slow performance or out-of-memory errors: Memory allocation in Classic mode works the same way as it did for all Macintosh applications before Mac OS X. Applications preallocate a certain amount of memory and have explicit settings for the preferred and minimum amounts of memory that they can allocate. Even though Mac OS X provides a sophisticated virtual memory management system, all Classic applications still run in the single Mac OS 9 emulator. To improve their performance or simply give them access to more memory, you must increase their memory requirements and capabilities using the Finder’s Show Info (Å+I) command, just as you did under older versions of the Mac OS. The Mac OS X Classic mode is an impressive piece of work by Apple, guaranteeing backward compatibility by supporting the entire system as a subprocess. This approach also helps guarantee that older Mac OS applications will eventually be ported to Mac OS X by providing a compatibility bridge rather than by trying to shoehorn support for them into Mac OS X itself. We hope that the troubleshooting and general suggestions provided in this chapter were useful to you. If you develop others that you wish you’d found in this Appendix and are willing to share with others, please contact us, and thanks in advance!
Appendix B Where to Go for More Information
572
Part V
Appendixes
his appendix summarizes some of the best Web sites found for obtaining general information, tips, and tricks about Mac OS X, general Apple and Macintosh news, information for Mac OS X developers, and information about installing or porting popular Unix and Linux applications to Mac OS X. This list is just the tip of the OS X iceberg, but it contains our favorites.
T
Mac OS X General Information Sites ◆ Apple’s OS X Site (http://www.apple.com/macosx/): It would be hard to think of a better site for general information about Mac OS X than Apple’s own site on the subject. ◆ Mac News Network (http://osx.macnn.com/): The OS X portion of the Mac News Network provides daily information about the latest and greatest software releases for Mac OS X, industry events related to Mac OS X, and other breaking OS X news. It also reports rumors about upcoming Apple software and OS X updates, as well as rumors about most software vendors that support OS X. ◆ MacAddict OS X Super Site (http://www.macaddict.com/osx/): MacAddict is the most entertaining US Macintosh magazine. Their site features recent articles; reviews; news; tips and tricks; and a number of forums that are easy to post to, search, and interact with. Consider subscribing to the magazine—it’s much easier to stuff into your brief case than the Web site is. ◆ Mac OS X Server (http://developer.apple.com/macosx/server/): Apple sells two versions of Mac OS X: the standard version that comes preinstalled on every new Mac, and a high-powered server-oriented version called Mac OS X Server. OS X Server includes a number of system administration utilities and server-oriented software packages, such as a mail server, that are targeted toward enterprise Mac OS X use. ◆ Mac OS X Labs (http://www.macosxlabs.org/): The OS X Labs site is full of information about using Mac OS X in higher education. This site was created and is maintained cooperatively by individuals who are responsible for managing Mac OS X systems in a variety of higher education situations. Therefore, it provides a great deal of practical information oriented toward educational use of Macs and Mac OS X.
Where to Go for More Information
Appendix B
◆ Mac OS Rumors (http://www.macosrumors.com/): For years, this site has been the best site on the Net for getting up-to-date, under-the-table information about upcoming Mac possibilities. This site often scoops almost every other Mac Web site. It’s great fun, and tantalizing at times.
Mac OS X Applications, Tips, and Support Sites ◆ Applications for Mac OS X (http://www.apple.com/macosx/applications/): Another Apple site, this page provides links to information about all currently registered applications available for Mac OS X. This site is continuously updated, and provides links to the sites of software vendors that support Mac OS X. This page includes a link to a list of applications that have been tested and certified for use in Classic mode. ◆ Mac OS X Apps ( http://www.macosxapps.com/): Mac OS X Apps is a great starting point for finding OS X software to suit almost any need. It is thorough, well-organized, and frequently updated—what more could you ask? ◆ Mac Os X Hints ( http://www.macosxhints.com/): Mac OS X Hints is a great site that provides tips and tricks for using Mac OS X. The site includes links to hundreds of open source, shareware, and demonstration software packages for Mac OS X. OS X Hints features a good search engine and a variety of mechanisms for contributing your own favorite hints, tips, and tricks. ◆ OSXFAQ ( http://www.osxfaq.com/): OSX FAQ is dedicated to providing tips and quick answers to common Mac OS X problems. The site features an FAQ, OS X forums, reviews of new OS X applications, and a daily tip from Bob “Dr. Mac” Levitus, long-time columnist for MacUser magazine, and author of a variety of books on the Macintosh, including the Mac OS for Dummies series. ◆ Pure Mac ( http://www.pure-mac.com/index.html): The Pure Mac site is a well-organized, hierarchical collection of most of the free, shareware, and demo software available for Mac OS X. ◆ SecureMac (http://www.securemac.com/): The SecureMac site focuses on Mac OS X security issues. It’s a great resource for information about
573
574
Part V
Appendixes
potential security problems, how to resolve them, and for general information about hardening your Mac against hackers. ◆ Version Tracker ( http://www.versiontracker.com/vt_mac_osx.shtml): The Version Tracker site has links to an incredible amount of OS X software, ranging from freeware and shareware to demonstration versions and updates to commercial packages.
Mac OS X Developer Sites ◆ Apple’s Mac OS X Developer Site (http://developer.apple.com/ macosx/): This site provides a convenient starting point for information about Mac OS X. This site provides links to PDF versions of most of the Apple OS X internal documentation, information about the latest OS X developer software releases, and the scoop on upcoming OS X-related conferences. ◆ Apple Developer Connection ( http://connect.apple.com/): Apple Developer Connection helps Macintosh developers create successful applications for the Macintosh. This site has been available for years, but it has taken on new meaning recently, due to Apple’s willingness to give away free development environments and related tools for Mac OS X. A free membership is required to access the tools and other information on this site. Once you join, you can download disk images of Apple’s complete OS X Integrated Development Environment, including the Project Builder, Interface Builder, and many more tools. ◆ Apple Java Site ( http://developer.apple.com/java/): Apple’s site for Java on OS X. Unlike previous versions of the Mac OS, OS X supports a full-blown Java environment that features optional hardware optimizations. No more silly Java Run-Time for the Mac—get the real thing! ◆ Apple’s Darwin Site (http://www.opensource.apple.com/projects/ darwin/index.html): The Apple page dedicated to information and source code for Darwin, the FreeBSD and Mach-based kernel that is the core of Mac OS X. ◆ DarwInfo ( http://darwinfo.org/): A site dedicated to promoting Darwin as an operating system on a variety of platforms. This site includes extensive information about installing and using Darwin on x86
Where to Go for More Information
Appendix B
hardware, including ISO images that you can download and use to create bootable install CDs for Darwin on x86 hardware. ◆ GNU Darwin Distribution ( http://gnu-darwin.sourceforge.net/): A complete site dedicated to Darwin development, and supporting and enhancing Darwin on Macintosh and other hardware. This site contains links to information and installable images for installing Darwin on x86 systems. This site hosts a number of mailing lists related to installing, using, and administering Darwin on x86 and Apple hardware. ◆ OpenSource Projects at Apple ( http://www.opensource.apple.com/): This page summarizes all of the Open Source projects that are underway at Apple, and provides a convenient central location to start from if you are looking to join one of these projects, download the source code, or if you simply want more information about Apple’s commitment to the Open Source community.
Unix and Linux Utilities for Mac OS X ◆ Fink (http://fink.sourceforge.net/): The Fink project is dedicated to making existing Linux and other open source packages available for Mac OS X in such a way that they can be easily installed and configured. The Fink project uses the Debian Linux toolset to make it easy for your to install a basic selection of Linux tools on your OS X system. You can then easily add other packages to your system using the Fink tools, which automatically identify and satisfy dependencies and requirements for the software that you are installing. The Fink software is installed in its own directory hierarchy, rooted at the directory /sw so that it will not interfere with existing versions of Linux and open source tools that you may already have installed on your system. Installing Fink is well worth the time if you are a Linux fan and you want to use a complete Linux toolset on your OS X system. ◆ GNU Mac OS X Public Archive (http://www.osxgnu.org/): A complete site dedicated to making GNU software available on OS X. This site includes general information for OS X developers, such as white papers about creating OS X packages, installing and managing software on OS X, and much more.
575
576
Part V
Appendixes ◆ TeX on Mac OS X ( http://www.rna.nl/tex.html): This provides information and downloadable software for the popular TeX markup language on Mac OS X. The site provides an overview of using TeX on OS X, and includes links and commentary on most of the versions of TeX for Mac OS X. TeX for OS X is free. ◆ XonX (http://sourceforge.net/projects/xonx): The XonX site is dedicated to making the Open Source version of the X Window system, XFree86, available on Mac OS X. You can download installers for the latest and greatest versions of Xfree86 from this site in installable package images that quickly and easily install on your OS X system. The latest versions of Xfree86 for Mac OS X supports rootless mode, where your X Window system and Aqua applications can simultaneously display windows on the same screen. If you are a fan of the X Window system or simply need to be able to run X Window system applications on OS X, you will want to visit this site.
Index 10-Base-T network, 320
aliases, 150–151
256 Colors setting, 72
All Fonts list, 227 Alsoft DiskWarrior, 546 ambient light color, 76
A About This Mac menu, 49 accessing files/folders, 152–153 accounts, users administrator privileges, 113–114 e-mail comparison, 371 editing, NetInfo Manager, 351–356 folders, 136 new, 110–113 removing users, 114–115 System Preferences, 347–351 updating, 113–115 Address Book, OS X Mail cards, 389–390 importing, 393–394 new, 390–392 Dock icon, 390 editing cards, 392–393 administrator privileges, user accounts, 113–114 ADSL/DSL modem, 584
Apache Web server, 363–365 configuration files, 365–366 expandability, 413–416 Home Directory, 366–367 log files, 366 Personal Web Sharing, 367 activating, 397–399 DNS, 399–402 API (Application Programming Interface), 477 API framework, 168 Carbon, 170 Classic, 168–170 Cocoa, 169, 170–171 Java, 171 Apple computers, history, 4–7 Apple Event Manager, 478 Apple menu, 31, 48–51 AppleScript, 476 applications, 478–479 debugging, 494–495
AFP (Apple File Protocol), 323, 325, 427
comments, 495–496
AIFF files, 283
data types, 495
AirPort, 318
flow-control statements, 496
traveling with, 460–461
GUI functions, 496 handlers, 496
578
Index
operators, 496
mapping files to, 564–565
overview, 476–479
opened, Dock, 38–39
recording, 482–483
opening, 38
resources, 499–500
docked, 33
sample script, writing, 486–494
packages, 174
script creation, 481
quitting, Dock and, 37–38
Script Editor, 481–482
removing, 175–182
subroutines, 496–499
switching, Dock, 34
tools, 499–500
termination, 562–564
variables, 495
troubleshooting, 560–568
AppleScript Studio, 499
Applications folder, 127, 129–131
AppleShare IP, 426–427
Aqua interface, 156
AppleShare servers, 329–332 AppleTalk, 323, 426–427 Application menu, 31 Application section, Dock, 32 applications AppleScript
Quartz, 166–167 ScriptMenu, 499 architecture, 156–158 Internet, 422–423 ARP (Address Resolution Protocol), 424 audio, Internet, iTunes, 307–309
backup, writing, 487–494
audio file formats, 284–285
debugging, 494–495
audio files
AppleScript interaction, 478–479
size, 290
bundles, 175
Authentication dialog box, 177
Classic
auto-arranging, icons (desktop/Finder), 61–62
starting, 186–190
auto-cleaning, icons (desktop/Finder), 61–62
starting automatically, 190–191
auto-login, 109
stopping, 191–192 crashed, restarting, 567–568 finding, Dock, 36–37 Force Quit, 195–196 installation, 175–182 launching, laptops, 463–464 locked files, deleting, 565–567 management Dock, 32–38 laptops, 463–464
B Back button on Finder, 139 background images, 101–102 backup application, AppleScript, 487–494 backups, 12 CD-Rs, 13 hard drive, 13–17 iDisk, 13
Index
partitioning and, 19
cards, Address Book, 389–390
traveling with laptop, 461
editing, 392–393
Tri-BACKUP, 13–17
importing, 393–394
100Base-T cabling, 321
new, 390–392
bash (Bourne Again Shell), 510
CD-R drives, backups, 13
batteries, Apple laptops, 458–460
CDs, audio
bits per sample, audio files, 285
encoding for recording, 298–299
Blue Box, 6
iTunes, 291
BNC (barrel nut connectors), network cabling, 320
playing, 296–298
bouncing icons, 34
MP3 and, 289–290
broadband services, troubleshooting, 284–288
recording using iTunes, 298–300
browsers, 442–443 iCab, 443 Internet Explorer, 444
579
channels, Sherlock Internet search, 212 creating, 217 new sites, 217
Mozilla, 444–445
chat rooms, 449–450
Netscape Communicator, 445–446
child domain, NetInfo domains, 345
OmniWeb, 446–447
CIFS (Common Internet File Sharing Protocol), 323, 325
Opera, 447 bugs, 534
Classic API, 168–170
bulletin boards (bboards), 450
Classic applications
bundles, 175
starting, 186–191 stopping, 191–192
C C-shell, Unix, 509–510 cabling, networks, 319–322 BNC, 320 drop cable, 319–320 protocols and, 322–323 RJ-45 connectors, 321 thin net, 320 vampire tap, 319 CacheAgent DNS, 401 calibration, color profiles, 73–77 Carbon API, 170 switching between, 189
Classic collection, Font panel, 227 Classic environment, 11 Finder (See desktop) client/server file sharing, 324 clips, video, 268–269 cropping, 272–273 cutting/pasting, 270–271 splitting, 271–272 titles, 275–276 transitions, 273–275 trimming, 273 Close tool, windows, 55 CMS (Content Management System), 416–417
580
Index
Cocoa API, 169, 170–171 fonts, 224
connections file servers, 325–335
codecs, 245–246
AppleShare servers, 329–332
collections, fonts, 227–228
WebDAV, 332–334
Favorites, 228–229 color
Windows, 328–329 networks, 357–363
ambient light color, 76 monitor setup, 71–77
troubleshooting, 556–560 user connections, 108–109
number to use, 225
Control Panels. See System Preferences
profiles, 72
Control Strip, 30
white point, 76
Copland, 5
Column view, Finder, 139, 141, 145–147
core layer, 156
command files, 476
crashed applications, restarting, 567–568
command information, Unix, 521–522
CSLIP (Compressed SLIP), 427
command-line, Unix
currency configuration, 94–96
access, 508–509 arguments, 516 NetInfo utility, 356–357 comments, AppleScript, 495 compatibility software, 10–12 troubleshooting issues, 568–570 compressed files, downloading, 176–178 Computer folder, 126 configuration errors, 534–535 files, Apache Web server, 365–366 Internet, 428–429 Network pane, System Preferences, 429–435 network connection, 429–435 QuickTime player, 257–261 Sherlock, 213 plug-ins, 215–216 saving search criteria, 214–215
D Darwin, 159 graphics layer, 165–166 OpenGL, 167 Quartz, 166–167 QuickTime, 167–168 interprocess communication, 165 memory management, 164–165 multiprocessing, 163–164 multitasking, 163–164 Data Rescue (ProSoft), 548 data types, AppleScript, 495 date and time, 87–94 DDP (Datagram Delivery Protocol), 329 debugging AppleScript applications, 494–495 decompression, Download Manager and, 176 desktop, 30 icon arrangement, 59 preferences, 68–82
Index
desktop appearance, 97–103
opened, 38–39
background images, 101–102
quitting, 37–38
General panel, 98–100
switching, 34–35
screen savers, personalized, 103
customizing
Desktop Folder, 127
appearance, 43–47
developer Web sites, 574–575
contents, 38–43
DHCP, 557–558
icons
diagnostic tools
Address Book, 390
anti-virus software, 544–545
deleting, 42–43
disk repair utilities, 545–548
inserting, 41
recovery utilities, 545–548
Internet Shortcuts, 41–42
System Profiler, 538–544
iTunes icon, 292
digital cameras, 263
preferences, 43–46
exporting movies to, iMovie2, 277
resizing, 43
directories
windows, switching between, 36
Apache Web server, 357
Dock Preferences tool, 43–46
Computer folder, 126
DocRoot, Apache Web server, 367
Network volume, 126
documents, printing, 235–236
shared, unmounting, 334–335
Download Manager, decompression and, 176
structure, 125
downloading fonts, 230–231
Unix, 517–518
Drive 10 and TechTool Pro (MicroMat), 548
Unix, listing, 512–517
Drive icons, 31
directory service, 343
drop cable, networks, 319–320
disk repair utilities, 545–548 Disk Utility, 545–546 disks, ejecting, 64 DiskWarrior (Alsoft), 546 DNS (Domain Name Service), 326 Personal Web Sharing (Apache), 399–402 DNSAgent (DNS Agent), DNS, 402 Dock, 30–31 application management, 32–38 Application section, 32 applications finding, 36–37
E e-mail, 370. See also OS X Mail account setup, 372–374 accounts, 371 custom, 377–383 attachments, 386–387 importing to OS X Mail, 375–377 Ed text editor, Unix, 518–519 Eject icon, 64 electrical plugs, traveling and, 461 Emacs text editor, Unix, 519
581
582
Index
encapsulation, 323
file storage, 124–129
energy savers, 104–105
Computer folder, 126
errors, 532–533
directory structure, 125
bugs, 534
Finder, 137–139
configuration errors, 534–535
folders
hardware failure, 537
Applications, 127, 129–131
pilot error, 533
Library, 127, 132, 133
viruses, 535–536
System, 127, 132–134
worms, 535–536
System/Library, 133–134 Users, 127, 134–137
Ethernet, 318, 319, 320 PARC and, 423 Xerox PARC, 323 Ex text editor, Unix, 519
Network volume, 126 files access control, Finder, 152–153 Apache Web server, 357 configuration, 365–366
F favorites Finder, 153–154 QTV channels, 254 Favorites collection, Font panel, 227–229 FFAgent (Flat File Agent), DNS, 402 file information, Finder, 151–152 file servers connections, 325–335 AppleShare, 329–332 WebDAV servers, 332–334 Windows servers, 328–329 Unix connections, 326–328 NFS volumes, mounting, 327 File Sharing, 135 file sharing client/server, 324 enabling, 336–338 overview, 335–336 peer-to-peer, 324
log files, 366 attachments to e-mail, 386–387 formats, sound, 284–285 hosts file, 401 moving, 129 naming, 149 printing to, 237–238 QuickTime format, 243–244 Unix, 505–506 listing, 512–517 Finder, 137–139 aliases, 150–151 Back button, 139 Column view, 139, 140 favorites, 153–154 file information, 151–152 files, access control, 152–153 folders, access control, 152–153 icon arrangement, 59 Icon view, 139
Index
List view, 139, 142–145
history, 222–224
MultiFinder, 163
Key Caps and, 231
Status bar, 139
management, 225–230
tasks, 149–154
number to use, 225
toolbar, 147–149
Old Style, 223
views
Roman lettering, 223
Column view, 145–147
sans serif, 223
consistency, 141–142
saving, 230–231
switching, 140–141
serifs, 223
Finder Preferences dialog box, 141–142
sizes, 229–230
Finder toolbar, 31
Suitcase, 227
Finder window, 31
viewing, 230–231
FireWire, digital cameras and, 263
FontViewer, 232
flow-control statements, AppleScript, 496
Force Quit option, 50, 195–196, 562–564
folders
FreeBSD, 159–160, 163
access control, Finder, 152–153
fsck (File System Check) utility, 546
Applications, 127, 129–131
FTP (File Transfer Protocol), 451–452
Computer folder, 126
Fun collection, Font panel, 227
creating, 150 Library, 127, 132, 133 moving, 129 naming, 149 Network volume, 126 protected, 128 System, 127, 132–134 System/Library, 133–134 user accounts, 136 Users, 127, 134–137 Font panel, 225, 226–227 fonts, 222 Cocoa, 224 collections, 227–228 Favorites, 228–229 downloading, 230–231 Get Fonts option, 230–231
G General panel, 98–100 geometry of monitor, 77–79 Get Fonts option, 230–231 Google searches, 212 GPL (General Public License), 161–162, 525 Grab service, 193–194 graphics layer, 156, 165–166 OpenGL, 167 Quartz, 166–167 QuickTime, 167–168 GUI functions, AppleScript, 496 GUI (graphical user interface), 4 Gutenberg, Johannes, 222–223
583
584
Index
icons, 58–63
H handlers, AppleScript, 496
application icon, 34
hard drive
arrangement, desktop/finder, 59
backups, 13–17
bouncing, 34
checking, 19
Dock
setup for upgrade, 19–22 hardware failure, 537
Address Book, 390 deleting, 42–43 inserting, 41
iBook, 456–457
shortcuts, 63
PowerBook, 456–457
shortcuts comparison, 58–59
sound
sizing, 62
MIDI, 288–289 USB and, 287–288
Users folder, 134 iDisk, 13
Height/Width tool, monitor, 77–79
access, 417–418
Help Viewer, 128
mounting, 418–419
hierarchies, NetInfo and, 344–345
overview, 416–417
home page, 403
IMAP (Internet Mail Access Protocol), 373
HomePage software, iDisk, 417
iMovie2, 262–263
hosts file, 401
editing video, 267–268
HotSync Manager, PDAs, 467
clip organization, 268–269
HTML (Hypertext Markup Language), 404
cropping clips, 272–273
HTTP (HyperText Transfer Protocol), 448–449
cutting/pasting clips, 270–271
hubs, uplink ports (networks), 321
splitting clips, 271–272
Huffman encoding, MP3, 290
titles, 275–276
HyperCards, 477–478
transitions, 273–275 trimming clips, 273 exporting movies to camera, 277
I
FireWire, digital cameras and, 263
iBook. See also laptops; PowerBook batteries, 458–460 hardware, 456–457 network connections, 470–472 PowerBook comparison, 456 iCab browser, 443 Icon view, Finder, 139
importing movies, 264–267 import operations e-mail to OS X Mail, 375–377 iMovie2, 264–267 incoming mail server, OS X Mail setup, 372 indexes, Sherlock, 201 size, 203
Index
Info panel, 151 installation applications, 175–182 decompressed, 176–178
585
IP addresses, 424 AppleShare IP, 426–427 IP layer, TCP/IP, 425 iPod, 291
OS X version 10.1, 22–26
IPX (Internetwork Packet Exchange) protocol, 323
plug-ins, Sherlock, 216
IRC (Internet Relay Chat), 449–450
small-scale routine, 175–176
ISAM (Indexed Sequential Access Method), 505
International panel, 83
ISPs (Internet service providers), 371, 422
Internet. See also Web sites
iTools, Internet configuration, 438
architecture, 422–423 audio
account signup, 440–442 iTunes, 286, 290–291
iTunes, 307–309
CDDB (CD Database), 293
sources, saving, 309
CDs, recording, 304–307
browsers, 442–443
Dock icon, 292
configuration for, 428–429
Internet radio, 307
Network pane, System Preferences, 429–435 connections, troubleshooting, 549–560
library, 294 adding MP3s, 302–304
overview, 422
playing CDs, 296–298
searches, 210–213
playlists, 291
Google, 212 Lycos, 212 services, 447
creating, 300–301 recording CDs, 298–300 starting, 291–296
chat rooms, 449–450 FTP, 451–452 SSH, 452 Telnet, 452 Usenet, 450–451 WWW (World Wide Web), 448–449 settings, upgrading and, 17–19 Internet CD Database (CDDB), iTunes, 293 Internet Connection Settings, 18–19 Internet Explorer, 442–443, 444 Internet panel, System Preferences, 437–440 Internet ratio, iTunes, 307 Internet Shortcuts, Dock, 41–42 invisible Web, 211
J–K JAR ( Java archive) files, 171 Java API, 171 Jobs, Steve, 4 kernel, 159 Key Caps, 231 keyboard, 85–87 Keychain Access default, changing, 120–121 locking keychains, 121–122 new password item, 119–120
586
Index
Keychain function, 115, 116–118
mach file, 129
Keystone tool, monitor, 77
mach_kernel, file, 129
killer apps, 370
mach.sym file, 129
ksh (Korn Shell), 510
mail, 370. See also OS X Mail mail server type, OS X Mail setup, 372–373 mailboxes, OS X Mail, 387–389
L LANs (local area networks), 319 laptops, 456. See also iBook; PowerBook application management, 463–464 launching applications, 463–464 memory management, 462–463 network connections, 470–472 screen space, 463 software, 461–462 traveler tips, 460–461 Library folder, 127, 132, 133 link layer, TCP/IP, 424 LisaOS, 4 List view, Finder, 139, 142–145 LocalTalk, 319, 320, 323, 426–427 Location Manager, 429 locked files, deleting, 565–567 locks, keychains, 121–122 Log Out command, 51 login, 109 auto-login, 109 Login Picture, 111 logs, Apache Web server files, 366 lookupd (lookup daemon), 401 ls command, Unix, 513 Lycos searches, 212
M MAC (Media Access Control) addresses, 424 Mach, 159–160
mapping files to applications, 564–565 McAfee Virux 7, 545 memory management Darwin, 164–165 laptops, 462–463 Menu bar, 31, 47–54 clock, 93–94 MicroMat's Drive 10 and TechTool Pro, 548 MIDI (Musical Instrument Digital Interface) hardware, 288–289 Millions, color setting, 72 minimization effect, 56 Minimize tool, windows, 55 mkdir command, Unix, 517 Modern collection, Font panel, 227 monitor color profiles, 72 height/width, 77–79 refresh rate, 72 setup, 68–69 color, 71–77 geometry, 77–79 refresh rate, 72 resolution, 69–71 movies iMovie2, 262–263 exporting to camera, 277 importing, 264–267
Index
QuickTime, 242–245
NeXT computers and, 343
exporting to, 278
organization, 343–346
saved, playing, 246–249
parent domain, 345
Mozilla browser, 444–445
NetNews, 450
MP3 (MPEG-3) files, 283, 289–290
Netscape Communicator browser, 445–446
iTunes, 290–309 library, adding, 302–304
open source and, 162 network layer, TCP/IP, 424
MPEG (Motion Pictures Expert Group), 289–290
Network pane, System Preferences, 429–435
MultiFinder, 163
Network volume, 126
multi-user capability, 108–109
networks. See also cabling
multimedia, 242
AppleTalk, 323
iMovie2, 262–263
cabling, 319–322
Preview, 261–262
configuration, 429–435
publishing, 276–278
connections
QuickTime, 242–245 multiprocessing, 163–164 multitasking, 163–164
Mac OS X, 357–363 troubleshooting, 556–560 Ethernet, 319 LANs, 319
N name servers, 401 names files, 149 folders, 149 NCP (NetWare Core Protocol), 323 NetBEUI (Network Basic Extended User Interface) protocol, 323
laptop connections, 470–472 LocalTalk, 319, 323 PDAs, 321 protocols, 423–424 SSH, 358 topologies, 319 WANs, 319 news readers, 450
NetBIOS (Network Basic Input/Output System) protocol, 323
Newton, 4
NetInfo, 342–343
NFS (Network File System) protocol, 325
NeXT, Inc., 5
child domain, 345
Unix file servers, 326
command-line utilities, 356–357
volumns, mounting (Unix file servers), 327
directory service and, 343
NIAgent (NetInfo Agent), DNS, 402
graphical tools, 346–356
nicl command, 356
hierarchies, 344–345
nidomain command, 356
NetInfo Manager, 346–347
nidump command, 356
587
588
Index
nifind command, 356
Address Book
nigrep command, 357
editing cards, 392–393
NILAgent (NIL Agent) DNS, 402
importing cards, 393–394
niload command, 357
new cards, 390–392
nireport command, 357
addresses, 389–390
NIS (Network Information Service), 343
attachments to messages, 386–387
niutil command, 357
composing messages, 384–386
Norton AntiVirus for Mac OS X, 545
IMAP (Internet Mail Access Protocol), 373
Norton SystemWorks for Macintosh, 548
importing existing messages, 375–377
Norton Utilities, 548
message management, 387–389
NTP (Network Time Protocol), 92
POP, 373
number of channels, audio files, 285
setup, starting for first time, 371–374
numbers configuration, 94–96
OSA (Open Scripting Architecture), 477 outgoing mail server, OS X Mail setup, 373
O Old Style font, 223
P
OmniWeb browser, 446–447
packages, 174
open source, 160–163, 523–524
Palm Desktop (PDAs), 465–467
Apache Web source, 364 software, 525–528 OpenAFS Unix file sharing system, 326
synchronizing software, 468–470 PARC (Palo Alto Research Center), 423 Ethernet and, 423
OpenGL, 167
parent domain, NetInfo domains, 345
OpenStep operating system, 5
partitions, 19
Opera browser, 447 operators, AppleScript, 496 OS X
backups and, 19 passwords changing, 116
compatible computers, 8–9
Keychain Access, 116–118
installation, 22–26
Keychain function, 115
naming, 6
OS X Mail setup, 373
OS X Mail, 370. See also e-mail; mail accounts creating, 377–383 custom, 377–383 setup, 372–374
protected folders, Personal Web Sharing, 409–413 Unix systems, 342–343 user connections, 115–122 PDAs (Personal Digital Assistants), 456, 464–467 HotSync Manager, 467 networking and, 321
Index
Newton, 4
PPC (PowerPC) architecture, 5
Palm Desktop, 465–467
PPP (Point-To-Point) protocol, 427–428
synchronizing software, 468–470
PPPoE (PPP over Ethernet), 428
589
PDF collection, Font panel, 227
PRAM (Parameter Random Access Memory), 535
PDF (Portable Document Format) files
preferences
printing to, 237–238
personal system preferences, 82–96
Quartz and, 167
printers, 239
PEBKAC (Problem Exists Between Keyboard and Chair), 533
QuickTime Player, 257–258 Preferences menu, 194
peer-to-peer file sharing, 324
Preview, 261–262
personal system preferences, 82
Print Center, 232–235
currency, 94–96
adding printers, 233–234
date and time, 87–94
default printers, 234
keyboard, 85–87
holding jobs, 240
language, 83–85
removing printers, 235
numbers, 94–96 Personal Web Sharing, Apache Web server, 367 activating, 397–399 DNS, 399–402 protected folders, 406–413 setup, 396 sharing Web pages, 402–403 shared folders, 403–404
print job manager, 232 print jobs, previewing, 238–239 Print panel Copies & Pages, 235–236 print job, 238–239 printers adding, 233–234 default, 234
Pico text editor, 519
preferences, 239
Picture Viewer application. See Preview
removing, 235
pilot error, 533
printing, 232
Pincushion control, monitor, 77
documents, 235–236
pipe character ( | ), 506
to files, 237–238
pixels, iMovie and, 262–263
mobile, 239–240
playlists, iTunes, 291–301
to PDF files, 237–238
POP (Post Office Protocol), 373
Quartz and, 232
PowerBook. See also iBook; laptops
settings, 236–237
batteries, 458–460
processes, 163
hardware, 456–457
processor, multiple chips, 164
iBook comparison, 456
prompt, Terminal and, 509
network connections, 470–472
590
Index
ProSoft Data Rescue, 548
R
protected folders, Personal Web Sharing, 406–413
RARP (Reverse Address Resolution Protocol), 424
protocols
Recent Items submenu, 50
AFP, 323
recovery utilities, 545–548
cabling and, 322–323
refresh rate, monitor, 72
CIFS, 323
removable media, 64
DDP, 329
resolution, monitor, 69–71
IPX, 323
resolving host names, 401
NCP, 323
resources, Web sites
NetBEUI, 323
applications, OS X, 573–574
NetBIOS, 323
developer sites, 574–575
networks, 423–424
general information, 572–573
SMB, 323
Linux utilities, 575–576
SOAP, 476
support sites, OS X, 573–574
SPX, 323
tips, OS X, 573–574
TCP/IP, 323
Unix utilities, 575–576
XNS, 323 psychoachoustic modeling, MP3, 290
Restart command, 51 Rhapsody, 5 RISC technology, 5
Q
RJ-45 connectors, network cabling, 321
QTV, 252–254
ROM (Read Only Memory), 535
QTVR (QuickTime VR), 255–257
Roman lettering, 223
Quartz, 166–167
root directory, 124–125 Apache Web server, 366–367
printing and, 232 QuickDraw, 156, 157–158
root user, 125
QuickTime, 167–168, 242–245
RPCs (Remote Procedure Calls), 326
configuration, 257–261 exporting video to, 278
S
file formats, 243–244
sample rate, audio files, 285
non-visual files, 249
sans-serif fonts, 223
saved movies, playing, 246–249
scheduling Software Update, 185–186
TV (See QTV)
screen color, 71–77
Web movies, 249–251
screen resolution, 69–71
quitting applications, Dock and, 37–38
screen savers, personalized, 103 screen space, laptops, 463
Index
Script Editor, 481–482
shared Web pages, iDisk, 416–419
backup application, writing script, 487–494
Sharing Preferences panel, 135
compiling scripts, 484–486
shells, Unix, 509–510
debugging scripts, 494–495
Sherlock search facility, 198
generating scripts, 482–483 sample script, writing, 486–494 saving scripts, 484–486 scripting languages, 476
configuration, 213 plug-ins, 215–216 saving criteria, 214–215 by contents, 201–202
overview of scripting, 480–495
custom search options, 207–210
Script Editor, 481–482
custom searches, 206–207
ScriptMenu, AppleScript and, 499 searches Internet, 210–213
indexes, 201 size, 203 Internet, 212–213
Google, 212
local searches, 198–210
Lycos, 212
by name, 199–201
Sherlock, 198
591
volumes, adding folders, 204–205
by contents, 201–202
Show Info command, 151
custom search options, 207–210
shut down, 65–66
custom searches, 206–207
Shut Down command, 51
indexes, 201
single-window navigation, 138
Internet, 212–213
Sleep command, 51, 104–105
local, 198–210
SLIP (Serial Line Internet Protocol), 427
by name, 199–201
small-scale installation routine, 175–176
volumes, adding folders, 204–205
SMB (Server Message Block) protocol, 323, 325
security
SMP (symmetric multiprocessing), 164
files, 152–153
SMTP mail server, OS X Mail, 373
folders, 152–153
sneaker net, 318
protected folders, Personal Web Sharing, 406–413
SOAP (Simple Object Access Protocol), 476
serifs, fonts, 223 Services menu, 192–193 Grab service, 193–194
software compatibility with OS X, 10–12 laptops, 461–462
shared directories, unmounting, 334–335
open source, 525–528
shared files, iDisk, 416–419
Unix compatibility issues, 523–524
shared folders, Personal Web Sharing, 403–406 shared volumes, unmounting, 334–335
Software License Agreement dialog box, 177
592
Index
Software Update, 182–183
System Status menus, 51–54
reactivating inactive updates, 185–186 scheduling, 186
controls, new, 53–54 System Volume, 52
Sophos Anti-Virus for Macintosh, 545 sound, 80–82 file formats, 284–285 hardware
T TCP/IP (Transmission Control Protocol/Internet Protocol), 323
MIDI, 288–289
IP layer, 425
USB and, 287–288
link layer, 424
MP3, 289–290
MacIP, 426
overview, 282–287
multiple locations, network config and, 435–437
speech recognition, 310
network layer, 424
activating, 312–314
overview, 423–426
SPX (Sequenced Packet eXchange) protocol, 323
PPP protocol, 427–428
SSH (Secure Shell), 358, 452
TCP layer, 425
activation, 358–360
TCP layer, 425
SSH server, 358
tcsh shell (Unix), 509–512
Stallman, Richard, 161–162
TECO (Tape/Text Editor and Corrector), 519
standard file type and creator information, 282 Star topology, 320
Telnet (Network Virtual Terminal Protocol), 361–363, 452
start up, 65–66
Terminal
OS X Mail, initial, 371–374 StuffIt Lite, 177 subroutines, AppleScript, 496–499
prompt, 509 starting, 508 text editors, Unix
Suitcase font manager, 227
Ed, 518–519
System Disk, 19
Emacs, 519
System folder, 127, 132–134
Ex, 519
System/Library folder, 133–134
Pico, 519
System Preferences, 43
Vi, 520
Internet panel, 437–440
Text-to-Speech, 310–311
Network pane, 429–435
thin-net cables, networks, 320
users, new accounts, 347–351
Thousands, color setting, 72
System Profiler, 538–544
threads, 163
system sounds, 80–82
THX certification, sound, 80 time. See date and time
Index
Time Server connection, 92–93
file servers
time zone setting, 91–92
connections, 326–328
Times New Roman, 223
NFS volumes, mounting, 327
Token Ring topology, 320
files, listing, 512–517
Toolbox layer, 157
filesystem, 505–506
topologies, networks, 319
fsck (File System Check) utility, 546
tranceivers, networks, 320
interactions, 507
traveling with laptops, 460–461
ksh, 510
Tri-BACKUP, 13–17
ls command, 513
troubleshooting, 548
Mac compatibility, 504
application problems, 560–568
mkdir command, 517
bugs, 534
overview, 504–507
compatibility, 568–570
shells, 509–510
configuration errors, 534–535
software compatibility issues, 523–524
hardware failure, 537
tcsh shell, 509–512
Internet connections
Terminal, starting, 508
network connectivity, 556–560 PPP, 549–555
text editors Ed, 518–519
pilot error, 533
Emacs, 519
viruses, 535–536
Ex, 519
worms, 535–536
Pico, 519
TV, QuickTime. See QTV
Vi, 520 Unix, BSD and, 160
U UBD (User Brain Damage), 533 UDP (Universal Datagram Protocol), 425 Unix bash, 510 C-shell, 509–510 characteristics, 505 command information, 521–522 command-line arguments, 516 directories, 517–518 directories, listing, 512–517
upgrades hard drive prep, 19–22 OS 9.2.1, 23 vs buying new, 6–10 uplink ports, networks, 321 USB (Universal Serial Bus), sound hardware, 287–288 Usenet, 450–451 bulletin boards, 450 NetNews, 450 news readers, 450 User Account ID, OS X Mail setup, 373
593
594
Index
user IDs, 111
VirusBarrier, 545
users, 108–109
viruses, 535–536
accounts
anti-virus software, 544–545
e-mail accounts comparison, 371
Volume Control, 52
editing, NetInfo Manager, 351–356
volumes
folders, 136 new, 110–113 updating, 113–115 administrator privileges, 113–114
creating, 21–22 shared, unmounting, 334–335 VR (virtual reality), 255 VSAM (Virtual Sequential Access Method), 505
new accounts, system preferences, 347–351 passwords, 115–122 Public folder, 135 removing users, 114–115 switching users, 113 Users folder, 127, 134–137 Users panel, new users, 110–112 utilities command-line, NetInfo, 356–357 disk repair, 545–548 recovery, 545–548 tcsh shell, Unix, 509–512 UUCP (Unix to Unix Copy Program), 450
W wallpaper, 101 WANs (wide area networks), 319 Web collection, Font panel, 227 Web movies, QuickTime, 249–251 Web sites. See also Internet applications, Mac OS X, 573–574 developer sites, 574–575 font downloads, 230–231 general information, OS X, 572–573 HTML, 404 invisible Web, 211 Linux utilities, 575–576
V vampire tap, cabling, 319–320
sharing, 402–403 shared folders, 403–404
variables, AppleScript, 495
Sherlock plug-ins, 215
VCF (Virtual Card Files), OS X Mail, 390
support sites, Mac OS X, 573–574
Vi text editor, 520
tips, Mac OS X, 573–574
video
Unix utilities, 575–576
editing, iMovie, 267–276 QuickTime, 242–245 video cards, color, 71 views, Finder
WebDAV (Web Distributed Authoring and Versioning) protocol, 325, 415 overview, 416–417 servers, connections, 332–334
Column view, 145–147
Webmin system administration interface, 413–414
consistency, 141–142
white point color and, 76
switching, 140–141
Index
windows, 54–58 minimizing, 55–56
595
X–Y–Z
resizing, manually, 57–58
XML-RPC (eXtensible Markup Language Remote Procedure Calls), 476
shortcuts, 58
XNS (Xerox Network System) protocol, 323
single-window navigation, 138 Zoom control, 55
YPAgent (Yellow Pages Agent), DNS, 402
Windows file servers, 328–329 Windows share, 328 WindowShade control panel, laptops, 463 worms, 535–536 Wozniak, Steve, 4 WWW (World Wide Web), 448–449
Zoom control, windows, 55
This page intentionally left blank
NEED A COMPUTER BOOK? WE’VE GOT YOU COVERED! Try a Premier Press Series...
In a Weekend®
Fast & Easy ®
Linux®
For The Absolute Beginner
Fast & Easy ® Web Development
Administrator’s Guide
Game Development
Professional Projects
™
Premier Press, Inc. www.premierpressbooks.com
To Order Call
1.800.428.7267
The Premier Press Professional Projects series offers intermediate to advanced programmers hands-on guides for accomplishing real-world, professional tasks. Each book includes several projects—each one focusing on a specific programming concept and based on a real-world situation. Use the skills developed throughout the book and modify the projects to fit your professional needs! .NET Framework Professional Projects 1-931841-24-1 U.S. $49.99 Can. $77.95 U.K. £36.99
ADO.NET Professional Projects
PHP Professional Projects
1-931841-54-3 U.S. $49.99 Can. $77.95 U.K. £36.99
1-931841-53-5 U.S. $49.99 Can. $77.95 U.K. £36.99
ASP.NET Professional Projects
Streaming Media Professional Projects
1-931841-21-7 U.S. $49.99 Can. $77.95 U.K. £36.99
1-931841-14-4 U.S. $49.99 Can. $77.95 U.K. £36.99
C# Professional Projects
VBA Professional Projects
1-931841-30-6 U.S. $49.99 Can. $77.95 U.K. £36.99
1-931841-55-1 U.S. $49.99 Can. $77.95 U.K. £36.99
Dynamic Web Forms Professional Projects
Visual Basic.NET Professional Projects
1-931841-13-6 U.S. $49.99 Can. $77.95 U.K. £36.99
1-931841-29-2 U.S. $49.99 Can. $77.95 U.K. £36.99
J2EE Professional Projects
Visual C++.NET Professional Projects
1-931841-22-5 U.S. $49.99 Can. $77.95 U.K. £36.99
1-931841-31-4 U.S. $49.99 Can. $77.95 U.K. £36.99
™
Premier Press, Inc. www.premierpressbooks.com
Call now to order!
1.800.428.7267
“Game programming is without a doubt the most intellectually challenging field of Computer Science in the world. However, we would be fooling ourselves if we said that we are ‘serious’ people! Writing (and reading) a game programming book should be an exciting adventure for both the author and the reader.” —André LaMothe, Series Editor
™
Premier Press, Inc. www.premierpressbooks.com
®
Less Time. Less Effort. More Development. Don’t spend your time leafing through lengthy manuals looking for the information you need. Spend it doing what you do best— Web development. Premier Press’s fast & easy ® web development series leads the way with step-by-step instructions and real screen shots to help you grasp concepts and master skills quickly and easily.
Adobe® LiveMotion™ Fast & Easy® Web Development 0-7615-3254-4 CD Included $29.99 U.S. $44.95 Can. £21.99 U.K. ■
■
■
Macromedia® Dreamweaver® 4 Fast & Easy® Web Development 0-7615-3518-7 CD Included $29.99 U.S. $44.95 Can. £21.99 U.K.
0-7615-2854-7 CD Included $24.99 U.S. $37.95 Can. £18.99 U.K. ■
■
■
CGI Fast & Easy® Web Development
■
Macromedia® Dreamweaver® UltraDev™ 4 Fast & Easy® Web Development 0-7615-3517-9 CD Included $29.99 U.S. $44.95 Can. £21.99 U.K. ■
■
0-7615-2938-1 CD Included $24.99 U.S. $37.95 Can. £18.99 U.K.
■
■
ColdFusion® Fast & Easy® Web Development 0-7615-3016-9 CD Included $24.99 U.S. $37.95 Can. £18.99 U.K. ■
■
Macromedia® Fireworks® 4 Fast & Easy® Web Development 0-7615-3519-5 CD Included $29.99 U.S. $44.95 Can. £21.99 U.K. ■
■
■
™
■
Java™ 2 Fast & Easy® Web Development 0-7615-3056-8 CD Included $24.99 U.S. $37.95 Can. £18.99 U.K. ■
■
■
JavaServer Pages™ Fast & Easy® Web Development 0-7615-3428-8 CD Included $29.99 U.S. $44.95 Can. £21.99 U.K. ■
■
PHP Fast & Easy® Web Development 0-7615-3055-x CD Included $24.99 U.S. $37.95 Can. £18.99 U.K. ■
■
■
Macromedia® Director® 8 and Lingo Fast & Easy® Web Development
■
■
■
■
■
0-7615-3182-3 CD Included $29.99 U.S. $44.95 Can. £21.99 U.K.
■
■
ASP 3 Fast & Easy® Web Development
HomeSite™ 4.5 Fast & Easy® Web Development
■
Macromedia® Flash™ 5 Fast & Easy® Web Development
XHTML Fast & Easy® Web Development
0-7615-2930-6 CD Included $24.99 U.S. $37.95 Can. £18.99 U.K.
0-7615-2785-0 CD Included $24.99 U.S. $37.95 Can. £18.99 U.K.
■
■
■
■
■
■
0-7615-3049-5 CD Included $24.99 U.S. $37.95 Can. £18.99 U.K. ■
■
™
■
Premier Press, Inc. www.premierpressbooks.com
Call now to order!
1.800.428.7267