main

• | Table of Contents
• | Index
• | Reviews
• | Reader Reviews
• | Errata
• | Academic
Mac OS X Power Hound, Panther Edition
By Rob Griffiths
Publisher | : O'Reilly
Pub Date | : September 2004
ISBN | : 0-596-00818-X
Pages | : 574

In Mac OS X Power Hound, creator and editor of the extremely popular Mac OS X Hints Web site (http://www.macosxhints.com) Rob Griffiths lifts the hood on the Formula-One-powered operating system and delivers over 500 high-octane secrets for finding easier, faster, and better ways of using Panther and the programs that come with it--and even a bunch that don't. He includes chapters on Unix, the engine under Mac OS X's hood.


Table of Contents

• | Table of Contents
• | Index
• | Reviews
• | Reader Reviews
• | Errata
• | Academic
Mac OS X Power Hound, Panther Edition
By Rob Griffiths
Publisher | : O'Reilly
Pub Date | : September 2004
ISBN | : 0-596-00818-X
Pages | : 574

Copyright
The Missing Credits
 | About the Author
 | About the Creative Team
 | Acknowledgements
Introduction
 | How this Book Works
 | Some Experience Required
 | About [image] These [image] Arrows
 | Gaffes and Goofs
 | Some Groundwork
Chapter 1. Designing Your World
 | Section 1.1. Startup and Shutdown
 | Section 1.2. Display and Sound
 | Section 1.3. Window Tricks
 | Section 1.4. Menulets
 | Section 1.5. Setting Up
Chapter 2. The Finder and Desktop
 | Section 2.1. Finder Basics
 | Section 2.2. Navigating the Finder
 | Section 2.3. Aliases
 | Section 2.4. The Finder Toolbar
 | Section 2.5. Working with Files and Folders
 | Section 2.6. Desktop Interior Design
Chapter 3. The Dock
 | Section 3.1. The Dock Makeover
 | Section 3.2. Working with the Dock
 | Section 3.3. Random Acts of Coolness
Chapter 4. Programs
 | Section 4.1. Managing Programs
 | Section 4.2. Exposé
 | Section 4.3. General Productivity
 | Section 4.4. Printing, Fonts, and Text
 | Section 4.5. Classic
 | Section 4.6. Troubleshooting
Chapter 5. System Preferences
 | Section 5.1. System Preferences
 | Section 5.2. Accounts
 | Section 5.3. CDs & DVDs
 | Section 5.4. Date & Time
 | Section 5.5. Desktop & Screen Saver
 | Section 5.6. Keyboard
 | Section 5.7. Software Update
 | Section 5.8. Speech
 | Section 5.9. Universal Access
Chapter 6. Networking
 | Section 6.1. Making Connections
 | Section 6.2. .Mac and iDisk
 | Section 6.3. Remote Connections
 | Section 6.4. File Sharing
Chapter 7. Mail
 | Section 7.1. The Mail Window
 | Section 7.2. Reading Mail
 | Section 7.3. Sending Mail
 | Section 7.4. Troubleshooting
Chapter 8. iTunes
 | Section 8.1. Mini Modes
 | Section 8.2. The iTunes Music Store
 | Section 8.3. Navigating iTunes
 | Section 8.4. The Visualizer
 | Section 8.5. Songs and Playlists
 | Section 8.6. Smart Playlists
Chapter 9. iPhoto 4
 | Section 9.1. The Basics
 | Section 9.2. Libraries
 | Section 9.3. Film Rolls
 | Section 9.4. Albums
 | Section 9.5. Books
 | Section 9.6. Working with Other Programs
Chapter 10. The Other iApps
 | Section 10.1. iCal
 | Section 10.2. iChat
 | Section 10.3. iDVD
 | Section 10.4. iMovie
Chapter 11. Other Apple Goodies
 | Section 11.1. Address Book
 | Section 11.2. Apple System Profiler
 | Section 11.3. Calculator
 | Section 11.4. ColorSync Utility
 | Section 11.5. Disk Utility
 | Section 11.6. Font Book
 | Section 11.7. Image Capture
 | Section 11.8. Keynote
 | Section 11.9. Preview
 | Section 11.10. Printer Setup Utility
 | Section 11.11. Stickies
 | Section 11.12. TextEdit
Chapter 12. Web Browsers
 | Section 12.1. Hints for All Browsers
 | Section 12.2. Internet Explorer Hints
 | Section 12.3. Safari Hints
 | Section 12.4. OmniWeb Hints
 | Section 12.5. Mozilla, Netscape, Camino, and Firefox Hints
 | Section 12.6. Camino-Only Hints
Chapter 13. Other Applications
 | Section 13.1. Acrobat Reader 6
 | Section 13.2. BBEdit
 | Section 13.3. DragThing
 | Section 13.4. Microsoft Office 2004
 | Section 13.5. Photoshop and Photoshop Elements
 | Section 13.6. Quicken
 | Section 13.7. SnapzPro X
Chapter 14. Add-Ons Worth Adding
 | Section 14.1. Make Mac OS X Feel Like Mac OS 9
 | Section 14.2. Program Launchers and Switchers
 | Section 14.3. Expanding Your Mac OS X Experience
 | Section 14.4. Other Programs
 | Section 14.5. Explore the Possibilities
Chapter 15. Useful Unix Hints
 | Section 15.1. Unix Basics
 | Section 15.2. Terminal Shortcuts
 | Section 15.3. Window Administration
 | Section 15.4. Manipulating Commands
 | Section 15.5. Administering the Mac
 | Section 15.6. Finder-Terminal: A Joint Venture
 | Section 15.7. Cool Commands
 | Section 15.8. Troubleshooting via Terminal
 | Section 15.9. Terminal Help
 | Section 15.10. Fun Stuff
Chapter 16. Intermediate Unix Hints
 | Section 16.1. Terminal for Productivity
 | Section 16.2. File Sharing Hints
 | Section 16.3. Remote Access Hints
 | Section 16.4. FTP Hints
 | Section 16.5. Shell Hints
 | Section 16.6. X11 Hints
 | Section 16.7. Apache and Web Hints
Colophon
Index


Day Day Up

Copyright © 2004, 2003 O'Reilly Media, Inc. All rights reserved.

Printed in the United States of America.

Published by O'Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.

O'Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://safari.oreilly.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com.

Nutshell Handbook, the Nutshell Handbook logo, and the O'Reilly logo are registered trademarks of O'Reilly Media, Inc. Mac OS X Power Hound, Panther Edition, The Missing Manual, The Missing Manual logo, Pogue Press, the Pogue Press logo, and "The book that should have been in the box" are trademarks of O'Reilly Media, Inc.

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O'Reilly Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps.

While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.


The Missing Credits

    About the Author

    About the Creative Team

    Acknowledgements


About the Author

Rob Griffiths dove into Mac OS X with the public beta version in 2001, despite an innate fear of Unix and no understanding of the command line. Shortly thereafter, tired of searching the Net for the same answers to the same questions and looking for a way to force his Unix learning skills forward, he launched MacOSXhints.com, a site dedicated to tips and tricks on all things Mac OS X-related. Since then, MacOSXhints.com has amassed a searchable database of over 6,000 hints—and 45,000 follow-up comments on those hints from enthusiastic readers.

When he's not maintaining the site, finding new hints, working at his actual full-time job, or writing this book, Rob enjoys spending time with his family and friends, playing (bad) golf, and traveling. Email: rgriffiths@macosxhints.com.


About the Creative Team

David Pogue (co-editor) is the weekly computer columnist for the New York Times, technology correspondent for "CBS News Sunday Morning," and the creator of the Missing Manual series. He's the author or co-author of 35 books, including 13 in this series and 6 in the "For Dummies" line (including Macs, Magic, Opera, and Classical Music). In his other life, David is a former Broadway show conductor, a magician, and a pianist. News and photos await at www.davidpogue.com.

Adam Goldstein (co-editor) is the 16-year-old founder of GoldfishSoft, a software company specializing in cool programs for Mac OS X. He has worked on several titles in the Missing Manual series, including Mac OS X (as technical editor) and AppleScript (as author). In his spare time, he grudgingly attends high school. Email: mail@goldfishsoft.com. Web: www.goldfishsoft.com.

Kirk McElhearn (contributor, Chapters 15 and 16) has written and co-written more than a half-dozen books on the Macintosh, covering both software and hardware. As a journalist, he has written articles for a variety of publications, including Macworld magazine and TidBITS. A native New Yorker, he has lived in France for almost two decades, and currently lives in Guillestre, a village in the French Alps.

Nan Barber (copy editor) co-authored Office X for the Macintosh: The Missing Manual and Office 2001 for Macintosh: The Missing Manual. As the principal copy editor for this series, she has edited the titles on iPhoto, Mac OS 9, AppleWorks 6, iMovie, Dreamweaver 4, and Windows XP. Email: nanbarber@mac.com.

John Cacciatore (copy editor) has worked as an event specialist and freelance writer for many a moon. Among his passions: Asian cuisine, Cheers reruns (starring Coach or Woody), and his 23-year-old Rawlings baseball glove that still picks 'em clean at short. Email: j_cacciatore@yahoo.com.

Marlowe Shaeffer (production editor) enjoys working at O'Reilly because of the excitement of finding out which animal will be on the cover of her next book. Email: marlowe@oreilly.com.


Acknowledgements

This book would not have been possible without the wonderful MacOSXhints.com community, which has helped create one of the greatest Mac OS X resources on the Web. Every day I'm amazed at the caliber not only of the hints (which are moderated prior to posting), but of the comments as well (which are not moderated). I feel thankful each day knowing that I'm involved in something this interesting and useful.

Very little of the Web site's material is repeated verbatim in the book; content has been rewritten and expanded for print use. Still, the knowledge provided by the hints on the site made this book possible in the first place.

Craig Arko, John Hancock, and Phil St. Romain make the Macosxhints.com forum possible. Their daily attention to this important troubleshooting resource frees me to work on the main site and this project. In addition, their candid feedback on the sites and the book have made both much stronger over time. Thanks, guys, for making our forum a great place to find answers to Mac OS X questions!

Numerous people helped me with the Unix chapters—the most difficult part of the book (for me, anyway): Kirk McElhearn did an amazing job at updating both Unix chapters to reflect the new bash shell in Panther, and also added a number of new hints. Without his valuable assistance, this book would have been much slower in reaching completion! In addition, I need to thank Neal Parikh, head of technical operations for the Macintosh News Network and forum moderator of MacNN's Mac OS X and Unix forums; Brian Duart, a technology consultant and systems administrator at-large in the Bay Area of northern California; and O'Reilly's Chris Stone, author of the command reference in Mac OS X in a Nutshell. Their expertise and modifications helped make the Unix hints clearer, more accurate, and easier to implement.

A heartfelt thank you to editors David Pogue and Adam Goldstein, copy editors Nan Barber and John Cacciatore who took my ramblings and somehow worked their magic to turn them into the elegant, flowing prose that you're now holding in your hands, and to the production and design team at O'Reilly, including Marlowe Shaeffer, David Futato, Rob Romano, and Andrew Savikas.

To James and Simon and Jacco and Jason and all the others who have enhanced my understanding of Mac OS X, Unix, the Web, and life in general: your contributions have been invaluable in helping me gain the knowledge necessary to tackle this project.

Thanks to my loving wife Marian, whose support was far more important than that of anyone else on this project. Little did we know when we started revising this book that it would consume every moment of my free time for many months. Through it all, her encouragement kept me going. And finally, thanks to our daughter Kylie, for providing the daily smiles that helped keep this project moving forward. You are the sunshine of our lives.

Rob Griffiths


Introduction

You're about to gain insight into Mac OS X, an elegant operating system with Formula One power under the hood. This book is like your pit crew, helping you find easier, faster, and better ways of using the Finder, the Dock, the assortment of programs that come with Mac OS X, and a bunch of programs that don't. And if you want to become your own master mechanic, this book also includes two massive chapters on Unix, the engine under Mac OS X's hood.

Even though the 650+ hints in this book are based on tips published on the Mac OS X Hints Web site (www.macosxhints.com), they're not just a rehash of the information on the site. That would be far too easy. Every hint has been rewritten, expanded, organized, indexed, tested for compatibility with the latest version of Mac OS X 10.3, and, in many cases, illustrated.

This book assumes that you're running version 10.3.3 or later. If you use any of these hints with previous versions of the system, you should expect that—as they say in the car business—your mileage may vary. The vast majority of hints will work just fine with an earlier 10.3 version. However, Apple has implemented a number of new features that work only with the 10.3.3 "dot update," and some of the hints in this book rely on those features.


How this Book Works

Typically, computer books make the most sense when you read them from start to finish—but not this one. Most hints in these pages address problems or solutions that are independent of other hints. Think of it as a vast table of hors d'oeuvres for your brain.


Some Experience Required

This book assumes that you already know the basics of Mac OS X. For instance, it doesn't explain how to log in, open System Preferences, create an account, or perform other common tasks. (You might think of this book, then, as a sort of sequel to Mac OS X: The Missing Manual.)

Once you have some experience with Mac OS X, this book can help you progress from an anybody-can-do-this user to a power user.


Day Day Up

About These Arrows

Throughout this book, you'll find sentences like this one: "Open the System [image] Libraries [image] Fonts folder." That's shorthand for a much longer instruction that directs you to open three nested folders in sequence, like this: "On your hard drive, you'll find a folder called System. Open that. Inside the System folder window is a folder called Libraries. Double-click it to open it. Inside that folder is yet another one called Fonts. Double-click to open it, too."

Similarly, this kind of arrow shorthand simplifies the business of choosing commands in menus, such as [image] [image] Dock [image] Position on Bottom, as shown in Figure P-1. Occasionally, you'll also see arrow notation used to indicate which tab or pane of a dialog box you're supposed to click: "Open the System Preferences [image] Sound panel," for example.

Figure P-1. In this book, arrow notation helps to simplify folder and menu instructions. For example, "Choose [image] [image] Dock [image] Position on Bottom" is a more compact way of saying, "From the [image] menu, choose Dock. From the submenu that appears next, choose Position on Bottom," as shown here.


Gaffes and Goofs

On the MissingManuals.com Web site, you'll find corrections and updates to the book (to view them, click the book's title, then click Errata). In fact, you're invited and encouraged to submit such corrections and updates yourself. In an effort to keep the book as current and accurate as possible, each time we print more copies, we'll make any confirmed corrections you've suggested. We'll also note these changes on the Web site, so that you can mark important corrections into your own copy of the book, if you like.


Some Groundwork

Throughout the book, a handful of ideas and processes come up again and again. They're explained here so you don't have to read them 500 more times.

Digging Around in Programs

You may have noticed that most Mac OS X programs aren't marred by 50,000 support files strewn across your hard drive. To open Internet Explorer, you merely have to double-click a single Internet Explorer icon. There's no need to initially open an Internet Explorer folder. This, inarguably, is a far superior arrangement than the ones found in Mac OS 9 or Windows, where many programs must remain in special folders, surrounded by libraries, dictionaries, foreign language components, and other support files and folders.

So where did all those support files go?

Most Mac OS X programs come in the form of packages or bundles, which are actually folders that behave like single files. A Mac OS X program may look like a single, double-clickable application icon, yet to the Mac, it's actually a folder that contains both the application and all of its support files, which are hidden for your convenience. (In fact, even documents can be packages, including iDVD project files and certain TextEdit documents.)

This book will repeatedly direct you to peek inside these cleverly disguised folders. And no, you can't do that by double-clicking them. Instead, follow the routine shown in Figure P-2.

Once you're inside, look around as much as you like, but don't move or remove any of the files you find there—unless a hint tells you to. Doing so may cause the program to quit working more suddenly than a McDonald's cashier at the end of a shift.

Dragging a Text File into TextEdit

TextEdit is a basic text processor included in Mac OS X. Among other things, it's the perfect freebie tool to help you create or modify Mac OS X's system and program preference files. Many of the hints in this book refer to TextEdit.

To open a file with TextEdit, drag its icon (the document) from the Finder or desktop onto the TextEdit icon on the Dock or in your Applications folder.

Figure P-2. Left: In the Finder, highlight a program, Control-click it, and then choose Show Package Contents from the contextual menu.

Because so many of the hints in this book direct you to use TextEdit, you'll find it worthwhile to put its icon on your Dock right now. Simply drag it there from your Applications folder.

One more thing: TextEdit can typically create two kinds of files: unformatted plain text files, and Rich Text documents that contain formatting like bold and italics. Rich Text documents offer more artistic freedom, but they're baffling to many Mac OS X programs. It's very important that when you edit Mac OS X system files, you save the result exclusively as plain text files.

Figure P-3 shows you how to verify exactly what you're getting.

Finally, it's worth noting that TextEdit isn't the only program you can use to edit Mac OS X system files. If you're an old hand at Mac OS X, you may have run across programs like BBEdit, TextWrangler, PropertyList Editor (which comes with the Developer Tools, described below), or any of the Unix editors (like vi or emacs), which you reach through Terminal. In any of the hints in this book that direct you to open a file with TextEdit, feel free to substitute any of these other programs.

Never, ever use a program like AppleWorks or Microsoft Word to edit system files.

Terminal Basics

This book refers often to Terminal. Terminal is a program in your Applications [image] Utilities folder that serves as the door to Mac OS X's Unix underbelly. Unfortunately, that underbelly has no graphics, icons, or menus. Terminal is all text, all the time.

Figure P-3. To make TextEdit use plain text, choose TextEdit [image] Preferences. In the New Document Attributes section, turn on "Plain text," shown here next to the cursor. From now on, when you create or edit a file, TextEdit will save it in plain text format, just the way Mac OS X system software likes it.

Still, the command line (this type-a-command-to-control-the-Mac mode) opens up a world of possibilities. It lets you reach corners of Mac OS X that you can't access from the regular desktop. It lets you perform certain tasks with much greater speed and efficiency than you'd get by dragging around icons. And it gives you a glimpse into the minds and moods of people who live and breathe computers.

When you double-click Terminal's icon, you're greeted with something like this:

Last login: Fri Mar 26 05:40:57 on ttyp1

Welcome to Darwin!

MyPowerBook:~ chris$

The $ sign is the command prompt—the Mac's way of saying, "I'm all yours. What's your pleasure?" The insertion point blinks just to its right, waiting for you to type a Unix command like the ones suggested in this book. After you type each specified command, press Return or Enter to seal the deal.

If you upgraded from a previous version of Mac OS X, your command prompt may look slightly different; it might have a % sign instead of a $ one, for example. This is a result of your shell settings.

When you're done using Terminal, type logout or exit, press Enter, and then choose File [image] Quit.

All of the commands and scripts in this book are also available in a convenient text file that spares you from having to type anything at all. You can download this file from www.macosxhints.com/book/103scripts.html.

The Defaults Command

Many of the hints in this book direct you to change a program's settings by issuing a command, in Terminal, known as the defaults command. It's nothing more than the Unix way of changing a setting that doesn't have a corresponding button in the program's Preferences dialog box.

For example, hint 2-17 details how to turn off the Finder's zooming effect, that animated growing puff you see briefly when you double-click an icon. You're directed to open Terminal and type the following command after the command prompt:

defaults write com.apple.finder ZoomRects -bool no

Whenever you read instructions to type something into Terminal, capitalization counts. If you type a single letter as lowercase when in actuality it should be capped (or vice versa), the command might not work.

The full command breaks down like this:

  • defaults write tells Terminal that you'd like to modify (write) a new value for a preference setting.

  • com.apple.finder refers to the Finder's preference file. That's the file you're going to change.

  • ZoomRects refers to "zooming rectangles," the name of the actual setting you're going to change.

  • -bool refers to the type of value you're going to write. In this case, -bool is short for Boolean. A Boolean variable has only two possible values: yes and no.

  • no means no, just like your parents always told you. But in this case, it's also the value for the ZoomRects Boolean preference that you're changing.

Put it all together, and you've got a command telling your system to modify the Finder's zooming preference setting by turning it off. (You can reverse this command by repeating the command but changing no to yes.)

For more information on defaults, open Terminal and type man defaults. Using "man" opens the manual pages for the command you specify.

Installing the Developer Tools

If you bought the retail, boxed version of Mac OS X, it came with a special CD called Xcode Tools. If Mac OS X came with your Mac, the Xcode Tools CD may be a disk image on one of your Software Restore discs. (Use Disk Copy to burn this image onto a real CD, as described on Section 11.5.1.)

The Xcode Tools are essential for anyone who writes software for Mac OS X; the programs that come with them help you create, debug, and compile programs. But the Xcode Tools can be useful even if you're not a programmer. They include some useful utilities, including PropertyList Editor (which makes it easy to edit a program's preference files), and they give you a bunch of extra Unix commands. In fact, some of the hints in this book require that you have Developer Tools installed (you'll see which ones).

If the Xcode Tools CD or disk image didn't come with your Mac or your copy of Mac OS X, you can download it from the Web for free, although you first must sign up for Apple's developer program (also free). A high-speed Internet connection is recommended, since the files are more than 300 MB.

In your Web browser, visit http://connect.apple.com, and then click the Join ADC button at the lower right of the screen. Follow the instructions to create your free account. Next, log in at http://connect.apple.com, and then click Download Software to reveal a submenu. When you choose Mac OS X, you jump to a screen containing recent Xcode Tools releases.

Find the latest version, click Download, and then wait. The download is long, even over a fast connection.

Once downloaded, Xcode Tools can be installed the same way as many other Mac OS X programs: Just expand the archive, double-click the package installer, and then provide your administrative password when requested. If the installation is successful, you end up with a Developer folder on your hard drive containing all the Xcode Tool goodies.


Chapter 1. Designing Your World

Mac OS X may look "so good, you just want to lick it," as Steve Jobs famously put it. The truth is, though, that the best stuff is under the hood. The incredibly stable Unix core multitasks like a pro and opens up a world of software previously unavailable to Mac fans.

This OS is unlike anything that came before, which has tripped up more than one computer veteran. But the time you invest learning Mac OS X will gain you boatloads of speed and efficiency. Just keep an open mind—think "Zen and the Art of Computing."


1.1 Startup and Shutdown

You won't get far with your Mac (or this book) until your Mac is turned on. But even that simple act, as it turns out, has a few nuances worth learning.

1.1.1 Keyboard Login

The dialog box shown in Figure 1-1 greets millions of Mac mavens every morning. It's the login dialog box, which you use to identify yourself and instruct the Mac to display your files, desktop picture, and settings while hiding everyone else's. (More on this accounts system in Chapter 5.)

You can save some mousing around by navigating this box with the keyboard. For example, select your name from the list by typing your first initial (or the first couple of letters, if the list is long). As you do so, the highlight bar moves down the list, matching what you type. When the name you want is highlighted, press the Return or Enter key, type the password, and then hit Return again.

If you hold down Shift when you select your account's name, the window will fade to the password screen in super-slow motion. (Make sure a jealous PC fanatic is watching when you do this.)

Figure 1-1. Before you can start using your machine, your Mac wants to make sure it knows who you are . . . or at least who you want to be today.

1.1.2 Automatic Login

Of course, the accounts system mentioned in the previous hint is primarily designed for families, schools, or businesses, where different people use the same Mac at different times. If you're the only one who uses your machine, and you're not worried about security, all this business about choosing your name from a list and entering a password is so much red tape. "It's me!" you feel like saying, "Who the heck else would it be?"

If that's your situation, you can set up the system so it logs you in automatically at startup, bypassing the login screen altogether.

Start the maneuver by opening System Preferences. Click the Accounts icon, and then choose Login Options at the bottom of the left pane. Click Automatically Log Me In As, select your account from the pop-up list, and enter your password. From now on, OS X won't bother you with the login dialog box unless you summon it yourself—by choosing [image] [image] Log Out or using Fast User Switching, for example.

UP TO SPEED Administrator Accounts

Since the day you started using your Mac, you may have made a number of changes to your desktop without realizing that they were only affecting your account. For instance, maybe you adjusted some Dock settings, arranged your folders and desktop the way you like them, or added some favorites to your Web browser.

Your account lives in your Home folder, which is named after you and stashed in the Users folder on your hard drive. It stores not only your own work, but also your preference settings for all the programs you use, special fonts and programs that you've installed, and so on. (To get there quickly, in the Finder choose Go [image] Home.)

If you create an account for a second person, though, when she turns on the computer and signs in, she'll find the desktop exactly the way it was factory-installed by Apple: with a blue swirling desktop picture, Dock positioned at the bottom, and so on. She can make the same kinds of changes to the Mac that you've made, but nothing she does will affect your environment the next time you log in.

In other words, the accounts feature has two components: a security element that protects both the Mac's system software and other people's work and a convenience element that hides everyone else's junk.

To see the list of accounts on your Mac, open System Preferences, and then click Accounts.

It's important to understand the phrase you see below your name in the left-hand panel. On your own personal Mac, it probably says Admin below your name. This, as you could probably guess, stands for Administrator. Only an administrator is allowed to install new programs in the Applications folder, add fonts that everybody can use, change certain System Preferences panels (including Network, Date & Time, Energy Saver, and Startup Disk), create new folders outside of your Home folder, decide who gets to have accounts on the Mac, and so on.

Only Administrator account holders, moreover, can make many of the kinds of changes described in this book.

Anyone who isn't an administrator is likely to be an ordinary, everyday Normal account holder. These people have ordinary, everyday access to their own Home folders and to some System Preferences, but most other areas of the Mac are off-limits.

If you're merely a Normal account holder, you can't enact certain changes described by the hints in this book by yourself. Fortunately, you're not required to log out so an administrator can log in and make changes. Instead you can just call the administrator over, click the padlock icon, and let him type in his name and password. (That is, if he feels comfortable with you making the changes you're about to make.)

How does the Mac know who's an administrator? Because they're all listed in the Accounts pane of System Preferences. If you're a Normal type, an administrator can select your name in this panel, click the Security tab, and turn on "Allow user to administer this computer." This is the master switch that turns a normal, unsuspecting account holder into an administrator.

1.1.3 The Listless Login Screen

There are two ways of displaying the login panel. The user-friendly way is the list of names shown in Figure 1-1.

For greater security (though less convenience), though, you may prefer to require all who desire to log in to type both their names and passwords into text boxes (Figure 1-2). That way, would-be evildoers must know both the correct spelling of a legitimate account holder's name and its password.

Figure 1-2. To return to the list view, click the Back button at the lower left of the login panel.

You might also want to consider this compact arrangement if you use your computer in a school or business. This way, people won't have to scroll through dozens of other names to find their own.

Most people think that accessing this text box login screen entails opening System Preferences, clicking Accounts, clicking Login Options, and selecting "Name and password." Truth is, there's a much quicker way to switch, without System Preferences—a trick you might use when you want to log in as >console (the full-screen Unix user), for example. From the list-of-names view, hold down the Option key, hit the down arrow, and then hit Enter. The login panel switches to displaying the text entry boxes, where you can now log in as console or root.

1.1.4 Startup Items Tricks

What Apple calls a login item is a program, file, folder, or other icon that you've designated to open automatically as soon as you log in. If the first thing you do is check a favorite Web page, by all means, designate your Web browser as a startup item so it will be open and ready by the time you've finished your morning coffee.

With your user name selected in the Account pane of System Preferences, you build your list of auto-opening items by dragging their icons into the Startup Items tab. You can even rearrange items within this list; items on top launch first.

Sometimes, however, you don't want your regularly scheduled programs to fire at startup. Maybe you're dying to see if your spouse, boss, or senator responded to your email and you want to get to your desktop as quickly as possible. Or maybe you've recently installed a program that you think might be causing problems when it autostarts.

In these cases, you'll want to prevent login items from opening. To do that, hold down the Shift key just after entering your user name and password on the login screen.

1.1.5 The Login Screen "Marquis"

In case you've been lying awake wondering how to add customized text to your login window (Figure 1-3), help is at hand. Maybe you work somewhere that requires a disclaimer on the usage of computing resources. Or maybe you want to add a touch of personalization to your login window—a daily reminder to back up your hard drive or to floss, for example.

Adding this line of text entails editing a special preference file—a running theme in the Mac OS X hacking community, as well as in this book.

In the Finder, open the Library [image] Preferences folder. Inside you'll find a file called com.apple.loginwindow.plist. To edit it, open it using TextEdit (read the details of this ritual on Section P.3.5.2).

The file contains a long list of bracketed words known to programmers as tags (Figure 1-3, bottom). Just below the first <dict> tag, insert these two lines:

<key>LoginwindowText</key>

<string>Your text goes here</string>

Replace Your text goes here with whatever you'd like displayed in the login window screen. If you'd like to show the whole Constitution on the login screen, then go ahead: OS X will turn the marquis into a scrolling text block if it's too long to fit on one screen.

Close the window, and click Save. When TextEdit asks you, "Attempt to overwrite?" click Overwrite.

The next time you log in, you'll savor the results of your modification.

Figure 1-3. Top: The login screen as public billboard. It can display a friendly reminder, a favorite political slogan, or whatever you like.

UP TO SPEED Feed the Hunger

Mac OS X loves memory (RAM). RAM is a relatively cheap upgrade that can pay large dividends in increased productivity and reduced frustration levels.

How much RAM is right for you? More is always better, so buy as much as you can afford. According to Apple, Mac OS X requires 128 MB. But 256 MB is a more realistic minimum, and Mac OS X gets really sweet with 512 MB or more (depending on how many programs you like to keep open at once). Yes, if you're someone who remembers the day when only rich snobs could afford a 2-MB Mac, that seems like a disgraceful amount. Ah, but times have changed. RAM is now relatively cheap and delivers a lot of boost for

the buck. Once again, buy as much as you can afford. (If you're too cheap to even pay a professional to install it, visit apple.com/support for instructions on how to do it yourself.)

The primary advantage of more RAM is that you can open more programs simultaneously without waiting for Mac to juggle disk space when you switch between them.

At the same time, Mac OS X also loves hard drive space—and not just the 3 GB that you need to install Mac OS X. You should always keep at least 1 GB free on the drive that contains OS X. The system will need that room to hold its swap files, which it uses when it can't keep everything in RAM.

1.1.6 Quick Restart, Shut Down, and Log Out

As confirmation boxes go, the one that appears when you choose Restart, Log Out, or Shut Down from the [image] menu is especially pointless. If you're like most people, your reaction is: "Well, duh—I chose that command, didn't I? Of course I'm sure."

In this case, you're a perfect candidate for the following trick: hold down Option before selecting Restart, Log Out, or Shut Down in the [image] menu. The instant you do so, the ellipsis (...) after each of these menu choices disappears. This is your clue that Mac OS X won't ask for any further comment as you restart, log out, or shut down.

1.1.7 Restart, Shut Down, or Sleep Keystrokes

If, like many an efficiency freak before you, you prefer keyboard shortcuts to choosing commands from menus, here's your cheat sheet:

  • Shut down by pressing Control-Option- [image] -Eject. (It's not as complex as it looks; the first three keys are all in a tidy row to the left of the Space bar.)

If your computer freezes (an unlikely occurrence in the Mac OS X world), you can force it to shut down by holding the power button down for about six seconds. Keep in mind, though, that you'll instantly lose all changes to your open documents if you shut down this way.

  • Restart with Control- [image] -Eject.

You can force-restart by pressing Control- [image] -Power key. Just like a force-shutdown, though, you'll lose all changes to open documents.

  • Log out by pressing Shift- [image] -Q.

  • Sleep with Option- [image] -Eject.

If your older Mac lacks an Eject key, substitute the F12 key in each of these keystrokes.

1.1.8 Restart/Sleep/Shut Down Dialog Box

There's yet another way to power down your computer. Press Control-Eject (or Control-F12 if you don't have an Eject key, or, on a laptop, just press the power button). You get the dialog box shown in Figure 1-4, where you can tap a single letter to trigger the option you want.


1.2 Display and Sound

Sight and sound are the primary senses you use to experience the glory of a Mac. (Smell cartridges are, mercifully, still years away.) Mastering the screen and speaker controls, therefore, offers big payoffs.

Figure 1-4. Once the Shut Down dialog box appears, press the R key instead of Restart, S for Sleep, Esc for Cancel, or Enter for Shut Down.

1.2.1 Opening Sound and Displays Panels

Ordinarily, you're supposed to adjust your screen or speaker settings by opening System Preferences and clicking the Displays or Sound icon. But if you're just seeking a quick brightness or volume adjustment, life's too short for that slow-lane method. Instead, you can use the dedicated keys for adjusting brightness or volume that come on every modern Mac keyboard. (The brightness keys look like suns, and the volume keys look like speakers.)

Sometimes, though, you need access to more sophisticated controls. For example, you might want to adjust the screen resolution to see how your Web page would look on a different screen, or you might want to change the built-in beep sound. For these tasks, only the System Preferences panes will do.

So here's the tip: on a PowerBook or iBook, you can jump directly to the Displays preference pane by holding down Option and pressing one of the brightness keys. You can jump to the Sound pane by holding down Option and pressing one of the volume keys. And if you're lucky enough to have a PowerBook with a glow-in-the-dark keyboard, you can jump to the Keyboard & Mouse pane by holding down Option and pressing one of the keyboard-brightness keys.

On desktop Macs, you can only access the Sound pane using this trick; desktop keyboards don't have brightness keys.

1.2.2 The Volume-Changing Click

When you change the volume on Mac OS X using the keyboard, you hear a muted clicking noise while a speaker icon appears on the screen. According to Apple's logic, if you can see and hear how loud your volume is set, you're less likely to accidentally set it to a deafening level.

The default "click" sound, though, is duller than a speech by Bill Gates. If you'd like to spice it up a bit, simply set the volume-change sound to any AIFF sound file—a Bart Simpson snippet, rude noise from the Internet, or whatever.

  1. Open the System [image] Library [image] LoginPlugins [image] BezelServices.loginPlugin [image] Contents folder.

    Your job is to replace the standard sound file within the Contents [image] Resources folder, but you'll be thwarted by the highly skeptical attitude that Mac OS X takes toward people who try to mess with its innermost settings. To protect itself from the mean-intentioned or inexperienced, Mac OS X prevents most civilians from changing anything in the System folder.

    But you, intrepid hacker, don't care about that. As long as you have an Administrator account (Sidebar 1.1), you can change whatever you like by telling the system software that the owner of the Resources folder is you.

  2. Highlight the Resources folder, and then choose File [image] Get Info.

    The Info window appears (Section 2.1.14).

  3. Expand the Ownership & Permissions triangle and then the Details triangle below it.

    If you see a small locked padlock icon, click it. From the Owner pop-up menu, choose your account name, and then, in the dialog box that appears, enter your password.

    You've just told Mac OS X that you are the rightful owner of the Resources folder. Therefore, you're allowed to make any changes you like to it, such as replacing the volume-change sound.

    Leave the Info window open for now.

  4. Within the Resources window, highlight the file called volume.aiff. Choose File [image] Duplicate.

    You've just created a backup, in case you decide to eventually restore the original clicking sound.

  5. Delete the volume.aiff file. Drag your replacement sound into the window, and then rename it so that it is now called volume.aiff.

    The next time you log in and tap the volume keys to adjust your speakers, you'll hear your new volume-changing sound—for better or worse.

If anything went wrong—say, you inadvertently chose a full-length sound file of the Wagner Ring cycle as the volume-key click—repeat these steps, but remove your "bad" new sound and rename the backed-up copy to return the folder to its pre-modification state.

On the other hand, if you want to get rid of volume-key sounds altogether, just turn off "Play feedback when volume keys are pressed" in the Sound panel of System Preferences.

1.2.3 Disable Touch-Sensitive Switches on Apple LCDs

Before you try this hint, take a look at your Displays panel. If you already see the Options tab, then there's no need for these special steps. Apple made this "hidden" behavior standard in recent OS X releases.

If you're lucky enough to own a standalone Apple LCD display, you're probably unlucky enough to have accidentally put your machine to sleep while dusting the monitor case. One move in the wrong spot near the monitor's touch-sensitive power button, and presto, your Mac is suddenly taking a nap.

To avoid this problem, first make sure System Preferences isn't running. Now press and hold Shift- [image], and then touch the Brightness button on the front of the monitor. System Preferences should launch and show the Displays panel, with a new Options tab, as seen in Figure 1-5.

Figure 1-5. Quit System Preferences, hold down Shift- [image], and touch your Apple LCD Brightness button to reveal this super-secret Options tab. Turn off the box. Now your system won't ever go to sleep just because you brush the Power switch.

Turn off the box. Your touch-sensitive switches are now safe to touch.

To re-enable your touch switches, open System Preferences, hold down Shift and [image], and click the Displays button. The panel will open with a gratuitous slow-motion effect (thanks to the Shift key), but when it's done, you'll see the Options tab again.

However, if you've opened the Displays pane without holding down Shift- [image], you'll need to quit and reopen System Preferences before you'll see the tab.


1.3 Window Tricks

What would the Mac be without its glorious, overlapping, drop-shadowed windows?

Unix, that's what.

In any case, mastering the many wonders of the Mac OS X window is a key survival skill.

1.3.1 Docking Multiple Windows

Minimizing windows is one of OS X's more compelling visual tricks. With a simple click of the yellow button, the active window shrinks down and places itself in your dock, ready for future use with the click of a mouse.

But what if you've minimized 15 different Safari windows to the Dock, and decide you want them all back? It's rather annoying to click 15 times just to get your windows back.

Luckily, there's a fast way out: just hold down the Option key before you click any of the minimized windows, and they'll all expand into a nicely organized bunch on your desktop.

Unfortunately, this great timesaver generally works only for Cocoa applications such as Mail, Safari, TextEdit, and OmniWeb. Carbon programs (like the Finder and Office 2004) won't even unminimize a single window if you have the Option key held down.

1.3.2 Insta-Closing Multiple Windows

When you find yourself with several open windows in one program, especially in the Finder, don't waste time trying to close them individually. Instead, Option-click the red close button at the top left of any open window. Presto! All windows close at once. (That is, except in Word 2004; Microsoft marches to a different drummer.)

1.3.3 Moving Background Windows

Suppose you're writing a training manual about a piece of software. As you write up your witty little descriptions of the elements of some dialog box, you may find it frustrating that your word processor's own window is covering up what you're trying to describe.

That's precisely when you should use the [image] -key trick. By pressing [image] as you drag their title bars, you can move background windows without bringing them to the foreground. (Make sure, however, that you don't drag a window by its name—anywhere else along the title bar is fine.)

1.3.4 Bringing Program Windows Forward

For efficiency's sake, sometimes you want to bring up all open windows of one program. Unfortunately, as many Mac OS 9 veterans quickly discover, clicking in the window of a Mac OS X program brings only that window forward, leaving the program's other windows in the background (see Figure 1-6).

If you use [image] -Tab to switch programs, however, or if you switch by clicking a program's Dock icon, all of the program's windows come forward.

Alternatively, you can install a shareware program like DragThing (Section 13.3), which includes a setting that brings "all windows forward" as the preferred behavior when you click an individual window.

Figure 1-6. Here's a delicious Safari/System Preferences sandwich.Notice how the System Preferences window is trapped between two Safari windows.

1.3.5 Three Scroll Bar Stunts

You may have noticed an intriguing option on the Appearance panel of System Preferences, something called "Scroll to here."

Ordinarily, when you click in the scroll bar track above or below the gelatinous handle, the window scrolls by one screenful. But if you turn on "Scroll to here" mode, when you click in the scroll bar track, the Mac considers the entire scroll bar a proportional map of the document and scrolls precisely to the spot you clicked. That is, if you click at the very bottom of the scroll bar track, you see the very last page. (In general, this feature works only in Cocoa programs; see Sidebar 4.2.)

Here's another tip: no matter which scrolling option you choose in the General panel, you can always override your decision on a case-by-case basis by Option-clicking in the scroll bar track. In other words, if you've selected the "Scroll to here" option, you can produce a "jump to next page" scroll by Option-clicking in the scroll bar track.

Even that's not the end of the Option-key magic:

  • If you're trying to read something carefully and slowly, you can slow down the scrolling. If you hold Option while dragging the scroll bar handle, the window shifts smoothly as you drag rather than turbo-scrolling one screen at a time. (This, too, works only in Cocoa programs.)

  • Conversely, Option-clicking the up or down scroll arrow speeds up scrolling, shifting by a page at a time instead of a line at a time. (Yes, yes, that's what the Page Up and Page Down keys are for, but when you're already manipulating these scroll buttons with the mouse, it's nice to be able to switch quickly back and forth between line scrolling and page scrolling.) This trick works in all Mac OS X programs, Cocoa or not.

1.3.6 Double Arrows on Both Ends

In System Preferences, the General pane offers to "Place scroll arrows" either together at the bottom (or left) of the scroll bar, or split up, appearing at opposite ends of the scroll bar. Both settings can lead to extra mousing around.

The ideal arrangement, of course, is to have both scroll arrows at both ends of the bar, as shown in Figure 1-7.

Figure 1-7. Scroll bar utopia. To return to the standard arrows, select one of the existing scroll bar options in the General panel of System Preferences. Or, if you like, repeat the Terminal command described in this hint, replacing DoubleBoth with either Single (top and bottom single arrows) or DoubleMax (double arrows at the bottom).

To create this effect, open Terminal (Section P.3.5.3). At the prompt, type this:

defaults write "Apple Global Domain" AppleScrollBarVariant DoubleBoth

and then press Enter. (See Section P.3.5.4 for more on the defaults command.)

The next time you launch any program, you'll find that its scroll bar buttons are nestled, in pairs, at both ends of the scroll bars.


1.4 Menulets

Apple calls them Menu Extras, but Mac fans on the Internet have named the little menu-bar icons shown in Figure 1-8 menulets. Most are both indicators and menus that provide direct access to settings in System Preferences. However, there's more to them than you may suspect.

Figure 1-8. You can rearrange the icons (including the clock) by holding down the [image] key and dragging them around the menu bar. You may wish to position your most-used icon in the top-right corner, so it never gets cut off by a program with numerous menus.

1.4.1 Menulet Basics

In general, you install a menulet by turning on the representative checkbox in System Preferences. You'll find such checkboxes in the Date & Time, Displays, Sound, and other panels.

You can remove a menulet by [image] -dragging it off of your menu bar (or by turning off the corresponding checkbox in System Preferences). You move them around on the menu bar the same way—by [image] -dragging them horizontally.

If you have a small computer screen, OS X may cut off the leftmost menulets when you have a program with a lot of menus open. (This happens on some laptop screens when using Xcode, for example.) For this reason, it's best to position your most essential menulets on the right—that way, they'll never get cut off.

1.4.2 The Secret Eject Icon

The prescribed way to eject a CD or DVD is to press the Eject (or F12) key on your keyboard. That's not much help if you have a non-Apple keyboard, though (or if, thanks to a rash of bad luck, you find yourself without a keyboard altogether).

Fortunately, there's a secret way to accomplish the same thing: install the Eject menulet.

To find the installer, open your hard drive [image] System [image] Library [image] CoreServices [image] Menu Extras folder. Inside that window, double-click the icon called Eject.menu.

Now look at your menu bar: there's the new Eject icon (second from left in Figure 1-8). Use it like a menu to choose the drive you'd like to eject.


1.5 Setting Up

Whether you've just started using Mac OS X or switched a long time ago, you should take some time to individualize your new computing world. After all, the odds that Apple came up with an operating system that perfectly suits you, NASA scientists, and the 8-year-old down the street are pretty slim.

1.5.1 Saving Memory

Like it or not, Mac OS X comes with a number of built-in features that you may not need; they also drink up memory and horsepower that could be used for stuff you do care about. Called services in Apple-speak, they include Personal File Sharing, Windows Sharing, Personal Web Sharing, Remote Login, FTP Access, Remote Apple Events, Printer Sharing, and so on.

To limit the amount of memory these services use, simply turn off the ones you don't need. If you're not on a network (or the Internet), you don't need any of them. If you share files with a Mac or a Windows PC on a network, though, leave on Personal File Sharing (for sharing with other Macs) and/or Windows Sharing (for sharing with networked PCs).

To turn these features on and off, choose [image] [image] System Preferences. Click the Sharing icon, click the Services tab, and check off the corresponding checkboxes.

1.5.2 Printer Sharing

It's a classic problem. You're sitting in a large office, with printers scattered all over the premises. You print an important document and have no clue where to pick it up. (This situation is especially worrisome if what you're printing is your resumé and cover letter to a headhunter.)

Fortunately, Figure 1-9 illustrates a sneaky trick that reveals the name of the Mac that's attached to a certain printer, the better to help you stalk it down.

1.5.3 System Maintenance

Every night, without complaint or fuss, Mac OS X performs a series of system-maintenance tasks: exciting things like cleaning up temporary files left by your programs, updating databases that track files, and deleting system logs. Without these regular operations, you'll wind up with wasted hard drive space and some file searches won't work.

But Mac OS X only does its janitorial duties if you leave your machine on overnight, wasting energy and filling the room with the hum of its fan.

That leaves you two options for running the maintenance programs. You can either get your hands dirty and run them yourself in Terminal (see Chapter 15), or you can use a program like MacJanitor (available at http://personalpages.tds.net/~brian_hill/macjanitor.html) to run them manually.

To use MacJanitor, double-click its icon, click the padlock icon next to "Click to allow tasks," and enter your administrator's password when prompted (Sidebar 1.1). The Daily, Weekly, Monthly, and All Tasks buttons in the toolbar spring to life.

Choose Help [image] MacJanitor Help for a technical explanation of what each cleanup routine does, and then run the ones that sound good to you. If you haven't left your machine on for a long time (so that the normal tasks never had a chance to run), just select All Tasks the first time you run the program. After that, you can follow the suggested schedule and run the appropriate tasks daily, weekly, or monthly.

Figure 1-9. From within an application, select a printer from the pop-up list in the Print dialog box, and then point to it with the mouse. A yellow tag appears showing the name of the machine that's hosting the printer. Of course, this trick won't actually help much if the machines aren't logically named after users or locations, but it'll still make you feel like an insider.

1.5.4 Apple Help

You might not expect to need help with Help. After all, this built-in, online help system is supposed to be self-explanatory.

It's not.

For proof, go to the Finder and choose Help [image] Mac Help (or hit [image] -?) to open the Help Viewer (Figure 1-10). This simple interface is hiding a ton of detailed information on many of your machine's programs, but you may not know that, especially if you used previous versions of OS X. Prior to 10.3, Apple provided a "drawer" that showed every application for which you could find help topics. In 10.3, this useful information has been moved to the Library menu.

Help serves as the master help system for most OS X applications (excluding various Terminal applications). The theory of bunching up all of your programs' help in one master program is that it allows you to cross-search. If you're in iPhoto, for example, and you're having trouble printing, you might not know that the Printing topics are in the standard Mac OS X help and not the iPhoto-specific help.

Your main interaction with the Help Viewer will probably be through the search box on the toolbar. Type your question in plain English ("How do I print?" for example), and then press Return or Enter to make Help Center find topics that match your query.

Figure 1-10. The Help Viewer application can help you learn the details of Mac OS X and many of your installed applications. The Help Viewer can also connect to the Internet to check for updated data, which may be more current than the help files on your hard drive.

If you're sure that the information you want to find is in the current program's help file, you can narrow down your search results by clicking the magnifying glass icon in the search box and selecting "Search [Current Program] Help."

The results page contains columns with the topics' names, Help Viewer's estimate of their relevance to your query, and a Location column showing which section of the Help Center contains the topics. You can sort by a different criterion by clicking a different heading; if you double-click a heading, the order of the items will be reversed.

The fun doesn't end there, however. For Panther, Apple based Help Viewer on Safari's web engine—and it shows. Some examples:

  • The navigation buttons are the same.

  • As in Safari, you can hold down the mouse on the back and forward buttons in Help Viewer to see a list of pages you've visited in the past few minutes.

  • They both support drag-and-drop.

  • You can drag a picture from Help Viewer into a word processing document, iMovie project, or iPhoto album, just as you can with Safari. You can even drag links from Help Viewer into Safari, if you'd rather read your help files there.

  • They both let you browse more than one page at once.

  • In Safari, you choose File [image] New Window to open a new window. In Help Viewer, choose File [image] New to accomplish the same thing.

If you use the Help Center often, you owe it to yourself to spend a couple of minutes customizing its toolbar by adding buttons for commonly used tasks. Start by selecting View [image] Customize Toolbar, and then drag the buttons you'd like to add up to the toolbar. In Figure 1-10, buttons have been added to make the font size larger or smaller, and a printer icon (set off with a separator and surrounded by flexible space) has been included for one-click printing. With these simple changes, you'll find the Mac OS X Help not only helpful, but easier to use.


Chapter 2. The Finder and Desktop

The Finder, also known as the desktop, represents what most people think of when they picture a Macintosh: user-friendly and efficient. As you'll discover in this chapter, however, you can make it even more so.


2.1 Finder Basics

Although it appears simple on the surface, the Finder is actually a complex program, powerful enough to manage disk and network interaction. To maximize your time in the Finder, you'll want to get acquainted with some of its more subtle features.

2.1.1 The Many Faces of the Finder

In Mac OS X 10.3, your Finder can seemingly have as many unique looks as cats have lives, as seen in Figure 2-1.

To eliminate the sidebar from a standard Finder window, just double-click the small dot between the sidebar and the main portion of the window. To remove the toolbar and the sidebar, click the pill-shaped button in the upper-right corner of the window, or select View [image] Hide Toolbar.

It's impossible to have a Finder window without a toolbar but with a sidebar.

Figure 2-1. Eenie, meenie, minie, moe...with which Finder shall I go? At top is a Finder window with its toolbar and sidebar; the middle version has vanquished the sidebar; and the bottom image has lost both the sidebar and toolbar.

2.1.2 Insta-Sort

When a Finder window is in list view, you can re-sort the list by clicking any column heading, like Date Modified or Kind, as shown in Figure 2-2.

But that's baby stuff. The power user, of course, can change the sort column without assistance from the mouse by simply pressing Control-Tab to "click" the column to the right, or Shift-Control-Tab to "click" the one to the left.

2.1.3 Erasing Disks

Mac OS X no longer comes with an Erase Disk command, at least not in the Finder. Instead, to erase one of your disks—say, a rewritable CD—you must use Disk Utility, a program in your Applications [image] Utilities folder.

Once you're in the program, select the disk you wish to erase from the list on the left, and then click the Erase tab.

Make sure that the proper name is reflected in the Name box before you proceed!

Then click Erase and let the utility go to work.

Figure 2-2. When you're viewing a window in list view mode, clicking a column heading sorts the list by that criterion. Click the heading again to reverse the sort order; you can tell the order has been reversed because the small triangle turns upside-down.

2.1.4 Window Size and Location

You can set the size of new Finder windows as well as their positions on the screen when they open. This procedure is Apple's version of a secret handshake: it's easy to carry out, but it's not obvious how to do it.

First, close all open Finder windows, and then open one new window (File [image] New Finder Window or [image] -N). Set up the size and location of this window manually, and then close the window without selecting anything in it.

From now on, any new window you create (by choosing File [image] New Finder Window or pressing [image] -N) will appear at the location you set and the size you specified.

2.1.5 List View

In list view, the flippy triangle to the left of each folder's name (Figure 2-3) lets you peek inside that particular folder without double-clicking.

Figure 2-3. In list view (left), clicking the small triangle reveals the selected folder's contents in the same window, as shown at right. If you prefer the keyboard, you can also use the right arrow to open the expanded view and the left arrow to collapse the expanded folder.

If you Option-click the triangle, all folders within the selected folder also open, producing a one-click view of every nested folder's contents.

The real power, though, comes from combining the Option key with the arrow keys. Start by selecting all the folders you'd like to see expanded ( [image] -click one at a time). Now release the [image] key, hold down Option, and then hit the right arrow key. You've just expanded all selected folders and all folders inside them.

If you select a folder with multiple buried subfolders and lots of icons inside each, this can take a while!

To return to the normal collapsed view, make sure each folder is selected again, and then press the left arrow key.

2.1.6 Column View

The idea behind column view is simple: to create a means of burrowing down through nested folders without leaving a trail of messy, overlapping windows in your wake. As shown in Figure 2-4, the solution is a list view that's divided into several vertical panes.

When you click a disk in the sidebar, the second pane shows a list of all folders inside it. Each time you click a folder in one pane, the pane to its right reveals what's inside.

Column view has two primary benefits. First, it keeps your screen tidy. It effectively shows you several simultaneous folder levels, but contains them within a single window. With a quick [image] -W, you can close the entire window, panes and all. Second, column view provides an excellent sense of where you are. Because your trail is visible at all times, it's much harder to get lost, wondering what folder you're in and how you got there.

You can even control this entire process by keyboard alone. For example:

  • You can jump from one pane to the next by pressing the right or left arrow keys. Each press highlights the closest icon in the next or previous pane.

  • The Back command (clicking the Back button on the toolbar, pressing [image] -[, or choosing Go [image] Back) works just as it would in a Web browser: it lets you retrace your steps backward. You can use this command repeatedly until you return to the setup that first appeared when you switched to column view. Similarly, pressing [image] -], clicking the Forward button in the toolbar, or choosing Go [image] Forward moves you forward through the panes you've recently visited.

  • Within a pane, press the up or down arrow keys to highlight successive icons in the list. You can also type the first couple letters of an icon's name to jump directly to it.

  • When you finally highlight the icon you've been looking for, press [image] -O or [image] -down arrow to open it. You're free to open anything in any column—no need to wait until you've pinpointed a file in the rightmost column.

Figure 2-4. If the rightmost folder contains pictures, sounds, or movies, Mac OS X lets you view or play them right there in the Finder. If it's a certain kind of text document (AppleWorks or PDF, for example), you actually see a preview of the first page. If it's any other kind of document, you see a blowup of its icon and a few file statistics. You can then drag this jumbo icon anywhere—into another folder, for example.

2.1.7 Resizing the Columns

When using column view, dragging one of the small handles at the bottom of the columns (circled in Figure 2-5) will resize just that column.

And should you ever want to quickly change the widths of all columns, just Option-drag any column handle, as shown in Figure 2-5.

2.1.8 Viewing Full File Names

Mac OS X is generous: it allows file names of up to 255 characters long. But if you use views with restricted space, like narrow columns, the Finder shortens the names, chopping text out of the middle of the file names.

Figure 2-5. In the Finder's column view, you can save space—and allow more columns to appear in one window—by tightening columns that have relatively short file names, while leaving other columns alone. To change the width of all columns at once, just press Option as you drag the column-divider widget (the small double vertical bar at the bottom of each column).

In other words, your magnificently titled photo Vacation - Hotel Photo.jpg becomes Vacatio...hoto.jpg. This contraction wouldn't be a problem, except that the same window also contains a file called Vacation - Airport Photo.jpg, which now appears to have the same name. The solution is revealed in Figure 2-6.

Figure 2-6. If you press the Option key while mousing over a list of file names (or just point the cursor and wait motionlessly), you force the Finder to display a pop-up balloon that reveals the full wording of any truncated file name.

2.1.9 More Icons in a Column

If you've ever played around with the Finder's font size options (choose View [image] Show View Options) in icon or list view, you may have discovered that shrinking the font size doesn't actually make room for more icons in a given window's height (Figure 2-7, top). Fortunately, it's a different story in column view (Figure 2-7, bottom).

If you can, find a font size that's easy on your eyes and also maximizes the amount of data you can see without mousing for the scroll bars.

Figure 2-7. Top: Setting the font size in list view isn't particularly useful. As you can see here, dropping the font size from 12 point to 10 point (left and right, respectively) doesn't fit any more icons into the list.

2.1.10 A Second Line of File Info

Start by opening any icon view window, and then choose View [image] Show View Options (Figure 2-8).

While you've got the View Options palette open, try turning on "Show item info." Suddenly, a new line of information appears, in tiny blue type, with further details about the icons. For example:

  • Folders. The info line lets you know how many icons are inside each folder without you having to open them.

You may wish to leave this setting off for hard drives that are connected to a network. If they contain a large number of folders, you'll wind up analyzing the chemical makeup of the stains on your keyboard while you wait for the system to count the number of items.

  • Graphics files. Certain other kinds of files may show a helpful info line, too. For example, graphics files in TIFF, JPEG, and certain other formats display their dimensions in pixels.

  • Sounds and QuickTime movies. The light blue bonus line tells you how long the sound or movie takes to play. For example, "02'49" means 2 minutes, 49 seconds.

You can see these effects illustrated in Figure 2-8.

Figure 2-8. Choose View [image] Show View Options, and then turn on "Show item info." A line of blue text appears below each icon, showing supplementary information depending on icon type. Unfortunately, this works only in icon view.

2.1.11 Window Backgrounds

In icon view, you can use images or colors as the backgrounds for Finder windows. It may sound like nothing more than eye candy, but this option actually has a very practical raison d'être. If you color-code your windows, you can tell which folders are open on your desktop without even reading their title bars. And nothing makes it easier to tell windows apart when they're minimized to the Dock (see Figure 2-9).

Figure 2-9. Even in this grayscale picture, it's obvious how different colors help you distinguish among minimized Finder windows in the Dock.

For a more dramatic effect, try giving your hot projects folder a light red background. Give less important stuff—lists of all the airline silverware you've ever stolen, for example—a light blue background. Light green could signify your personal finances folder. An image of your favorite lawn ornament could serve as the background for your Pictures folder. The fun is limitless!

To change the background of a Finder window, follow these steps.

  1. Make sure the window is in icon view, and then [image] choose View [image] > Show View Options.

    If you want to apply a color or picture to only one folder, turn on "This window only" at the top of the dialog box.

  2. At the bottom of the box, choose either Color or Picture.

    Choosing Color brings up a little frame that, when you click it, opens the color picker dialog box. Click anywhere in the color wheel to select a pleasing tint, or play with the color display options at the top of the box (Color Sliders, Color Palettes, Image Palettes, and Crayons).

    If you choose Picture, press Select to open a dialog box you can navigate through to pick an image.

As you work, remember that light background colors and low-contrast photos work best for legibility. Remember, too, that if you decide to choose a photographic background, Mac OS X has no idea what sizes and shapes your window may assume in its lifetime and therefore makes no attempt to scale down a selected photo to fit neatly into the window. If you have a high-resolution digital camera, your window background may show only the upper-left corner of a photo. (Use a graphics program to scale the picture down to something smaller for better results.)

2.1.12 Making Column View Speedier

In column view, the rightmost panel shows a preview of whatever document or folder is selected in the previous column, as shown in Figure 2-10. Although this feature is handy for taking a sneak peak at a graphic or even a QuickTime movie, it can dramatically slow down your column view browsing, especially with folders containing lots of images. (It's even worse if you've highlighted a graphic or QuickTime movie file that turns out to be damaged. You'll sit there, watching the "spinning pizza of death" cursor forever, or until you relaunch the Finder, whichever comes first.)

If you'd prefer to do without this final column in the name of accelerating things, choose View [image] Show View Options, and then turn off "Show preview column."

While you're at it, you may also want to turn off "Show icons," an option that refers to the tiny icons next to each file and folder name. They look nice, but on a slower machine, you could watch the entire Godfather trilogy while you wait for the window to fill them in.

In any case, turning off these two options makes column view much more responsive. And if you ever find yourself missing the information or the preview that would have appeared in the rightmost column, just open the Inspector window.

Figure 2-10. Inspector windows (accessed by typing Shift- [image] -I in the Finder) contain the full scoop on files and folders. If you leave the Inspector open, the information in it changes each time you select a new file in the Finder.

2.1.13 Previewing Multimedia Files

As noted earlier, the rightmost column in column view lets you check out your multimedia goodies without opening any additional programs—a real time and memory saver. It not only displays a thumbnail of a selected graphics file, it can even play QuickTime movies or MP3 music files.

What about list and icon views? Are you to be left stranded and preview-less?

Of course not. Figure 2-11 shows how you can enjoy multimedia previews even when you're not in column view.

Figure 2-11. To preview a graphics or multimedia file in a list or icon view, just highlight the icon (left) and then press Option- [image] -I to bring up the Info dialog box (right). Click to expand the triangle next to Preview; you can now play the movie or sound. From now on, each time you click a different file in the Finder, a preview appears in the Inspector, as shown at right.

If your movie files have resource forks (those bits of data used to track information about the file), they will not play in the Inspector window. The resource fork for a movie file holds that nice "preview" icon that shows the first frame of the movie. To delete the resource fork, you'll need a program like GrimRipper (http://free.abracode.com/cmworkshop/grim_ripper.html) or Resource Dropper (http://homepages.tig.com.au/~cthulhu/sbc/index.html). Once the resource fork is removed, your movie files will be playable in the Inspector.

2.1.14 Get Info vs. the Inspector

It's been a proud and noble tradition since the earliest days of Macintosh: when you highlight an icon and then press [image] -I, the Get Info window appears. In OS X, it's a collapsible, multi-paned screen that provides a wealth of information about a highlighted icon. For example:

  • For a disk icon, you get statistics about its capacity and how much of it is full.

  • For a document icon, you see when it was created and modified, and what program it "belongs" to.

  • For an alias, you learn the location of the actual icon it refers to.

  • If you open the Get Info window when nothing is selected, you get information about the desktop itself, including the amount of disk space consumed by everything sitting on it.

  • If you highlight a gaggle of icons simultaneously, the Get Info window details precisely how many you highlighted, breaking it down by type ("23 documents, 3 folders," for example), and adding up all of their file sizes. This is a great opportunity to change certain file characteristics on numerous files simultaneously (locking or unlocking them, hiding or showing their file name extensions, changing their ownership or permissions, and so on).

In earlier versions of Mac OS X, a single Info window remained onscreen continually as you clicked one icon after another. That was great for reducing clutter, but it didn't let you compare the statistics for the Get Info windows of two or three folders side-by-side. Macintosh purists howled.

So Apple responded the way a software company should: it put the old way back, but left the new way in as an option.

In other words, when you choose File [image] Get Info, you get a new dialog box each time you get info on an icon. But the one-window approach is still available for those occasions when you don't need side-by-side Get Info windows—if you know the secret. Highlight the icon and then press Option- [image] -I (or hold down Option and choose File [image] Show Inspector). The Get Info window that appears looks normal (except for a thinner title bar) but changes to reflect whatever icons you now click.

Bottom line: if your intention is to compare a number of files, use Get Info. If you want to add the same comment to or adjust the same characteristic of many files, use the Inspector.

2.1.15 Temporarily Overriding "Snap to grid"

Finder windows in icon view let you turn on a setting that keeps everything neatly ordered. It's called "Snap to grid," and it's located in View [image] Show View Options.

To place an icon within a window but outside the grid—perhaps to make it stand out—you can temporarily override this setting. The trick is to [image] -drag the icon to free it from the magnetic pole of the invisible grid.

The opposite is true, too: if you haven't turned on "Snap to grid," [image] -dragging makes an icon line up like a good soldier.

2.1.16 Custom Icons

There's no need to settle for a generic blue folder image for your "Hot Projects" folder when instead you could be looking at an actual hot projects folder, as shown in Figure 2-12. Fortunately, Mac OS X is perfectly happy to accept new icons that you draw or paste in yourself.

Figure 2-12. Top: The basic blue Aqua folder is probably fine for most things, but when you really want a folder to stand out, give it a custom icon.

The first step in customizing a file or folder icon is to locate a set of icons that you'd like to use. If you're truly talented, you can create your own using your favorite graphics program or a specialized icon-making program like Iconographer (www.mscape.com/products/iconographer.html).

If, on the other hand, you have as much artistic talent as a block of cement, just head out to the Internet to scour for icons. You'll find thousands of ready-made icons at, for example, www.xicons.com and www.iconfactory.com.

Start by clicking the icon you wish to customize in the Finder. Choose File [image] Get Info to open the Get Info window. Then click the icon whose picture you'd like to swap (one that you downloaded, for example) and again choose File [image] Get Info. Position the two Get Info windows so that you can see both of them, as shown in Figure 2-12 at bottom.

To replace the standard icon with your selected custom icon, click once on the small icon in the Get Info window for the custom icon (Figure 2-12, bottom right). The icon sprouts a faint blue glow to show that it's selected. Now choose Edit [image] Copy. Click the original icon in the Get Info window (Figure 2-12, bottom left), and choose Edit [image] Paste. Finally, close both Get Info windows; your new custom icon now appears in the Finder.

To revert to the original icon, open the Get Info window for the customized item, click the icon, and press the Delete key.

2.1.17 Nixing Zoom Effects

In the Finder, when you double-click a document or program, you see, just for a fraction of a second, a little animation. An expanding version of the icon "zooms" to show you that the file is opening.

Somewhere deep inside the extremely busy Mac fan, however, a little birdie is saying: "I'm waiting for half a second about 20 times a day. Over the course of my lifetime, I'll have spent an entire afternoon just waiting for zooming animations!"

If that's your reaction, you can give it the axe in either of these two ways:

  • Use Terminal, the Unix editing program described on Section P.3.5.3.

  • Download the free program called TinkerTool (available at www.bresink.com/osx/TinkerTool.html) and click a couple of buttons.

The latter method, while more user-friendly, doesn't give you nearly the same rush of power as the Terminal method.

Both of these alternatives can also be used in hints Section 2.1.19 and Section 2.1.20.

If you decide to proceed with Terminal, start by opening the program (it's in Applications [image] Utilities). At the prompt, type this:

defaults write com.apple.finder ZoomRects -bool no

Press Enter at the end of the line.

For more information on the "defaults" command, see Section P.3.5.4, or in Terminal, type man defaults and then press Enter. This command opens the "manual" (man) pages for the command, so you can learn in greater detail how it works. In any case, back to the task at hand: quit Terminal (File [image] Quit).

All you have to do now is restart the Finder. You can do that either by logging out and logging in again, or by choosing [image] [image] Force Quit, clicking Finder, and clicking Relaunch. Now, sure enough, whenever you open an icon, the animated zoom effect is gone.

If, upon reaching retirement age, you decide that you have time for the animation again, repeat the Terminal command, but replace no with yes.

2.1.18 Rearrange Third-Party Shortcut Menu Items

The Finder's shortcut menu is the one that appears when you control-click an item in the Finder. (It's sometimes called a contextual menu because its contents can vary based on what you've selected.) There are a number of third-party plug-ins that you can easily add to the standard shortcut menus, in order to preview pictures, change file information, and provide quick access to files and folders, for example. See http://free.abracode.com/cmworkshop for some free shortcut menu item plug-ins.

After you've installed a number of these plug-ins, you'll probably find that you use one or two more than the others, and it's somewhat of a pain scrolling through the pop-up menu to find those that you use the most. Wouldn't it be easier if the most-used items were at the top of the list, as seen in Figure 2-13?

Figure 2-13. Left: Quick, where's the PicturePop shortcut menu item?

To reorder your shortcut menu plug-ins, open your Home [image] Library [image] Contextual Menu Items folder. For each item you want closer to the top, simply add a space to the beginning of its name. The next time you log out and log in (or quit and restart the Finder; see hint Section 2.1.17), you'll find that the renamed items have jumped to the top of the list.

Note that some shortcut menu items actually have multiple menu items within them. Unfortunately, you can't rename those using this technique.

2.1.19 A Quit Menu in the Finder

The Finder may start up automatically each time you log in, but behind the scenes, it's nothing more than a standard Mac OS X program. It may not appear to have a Quit command, but you can indeed quit the Finder when you need a smidge more memory or computer horsepower for, say, some 3-D graphical battle simulator.

There are a number of different ways to quit the Finder—force quitting it, for example. If you find yourself wanting to quit the Finder with any regularity, the simplest way is to add a Quit menu item at the bottom of the Finder menu (Figure 2-14). Here's how to go about it:

Open Terminal (located in your Applications [image] Utilities folder) and type the following:

defaults write com.apple.finder QuitMenuItem -bool yes

Press Enter and restart the Finder, exactly as described in hint Section 2.1.17.

Now, lo and behold, you can press [image] -Q (or choose Finder [image] Quit Finder) whenever you want to quit the Finder. When you need the Finder back, a simple click on its Dock icon revives it.

Figure 2-14. You can quit the Finder just like any other program. Oh, by the way: to remove the Quit menu item, repeat the Terminal command described in this hint, but replace yes with no.

2.1.20 Showing Hidden Files

Mac OS X is a massive operating system composed of thousands of little files scattered all over your hard drive. So why haven't you ever seen them? Because Apple programs Mac OS X to hide them in the folders that contain them (such as the Unix folders bin, etc, and usr). If you believe in corporate transparency—or if you have to do some advanced troubleshooting—you can make these files and folders visible in the Finder at all times.

To make them appear, open the Terminal program (in Applications [image] Utilities) and type this, followed by Enter:

defaults write com.apple.finder AppleShowAllFiles -bool yes

The next time you log in (or follow the directions on how to relaunch the Finder in hint Section 2.1.17), you'll see an amazing number of formerly hidden files and folders.

If these files are clogging up the screen, you can hide them by repeating the Terminal command, this time replacing yes with no.

2.1.21 Printing Finder Windows I

Annoyingly enough, Mac OS X doesn't include a feature in the Finder to easily print the contents of a Finder window. That's a crushing disappointment to people who like to print little table of contents pages for their CD cases, for example. Good news, though: you can work around that omission with any of three methods.

The first method is simple. To begin, open the folder whose contents you wish to print. Highlight everything inside the window (press [image] -A for the Select All command), copy the selection ( [image] -C), and then switch to a word processor and paste ( [image] -V). A tidy little list of the original window's contents appears, ready for you to edit, format, and print out. (You might want to add the name of the folder at the very top.)

2.1.22 Printing Finder Windows II

The copy-and-paste method described in the previous hint creates only a list of icon names—not sizes, dates, and so on. To print out additional information about a Finder window, you can use Terminal (Chapter 15).

Open Terminal, and at the prompt, type cd and then a space. Next, drag the folder whose contents you would like to print straight off the desktop and into the Terminal window, then press Enter. (This fabulous shortcut tells Terminal, "I'm talking about this.")

At the next prompt, type ls | lpr (create the vertical bar by pressing Shift-backslash), and then press Enter. Presto! A list of the window contents starts spewing out of your default printer.

If you've installed the AppleScript menulet, you can shorten this process down to one quick menu selection (see Section 4.3.13).

2.1.23 Printing Finder Windows III

The Terminal method described in the previous hint is reliable but not exactly effortless.

Fortunately, there's a method of printing window contents that's as complete as the Terminal method but as easy as the copy-and-paste method. Just download PrintWindow from www.swssoftware.com.

Once you've installed the program, you can drag-and-drop a folder onto PrintWindow's Dock icon and let it rip. You can even tell the Finder to respond to [image] -P, just like the good old Mac OS 9 days. The program lets you print full information (name, type, size, modified date) or names only; you can even specify how many columns print out. If you print lots of folder windows, PrintWindow is worth every penny of the $15 suggested donation.

2.1.24 Making Printing Easier

The standard way to print something in Mac OS X is to first open the program that created the document, then open the document, then select File [image] Print and select a printer. That's a lot of work, though, especially if you have to dig around in the Open dialog box to remember where you saved the file. Here, then, are some tricks for quicker printing in the future.

One way to ease printing pains is to drag the Printer Setup Utility into your dock, the sidebar, or the Finder's toolbar. If you drag and drop a PDF onto that icon, the PDF will be printed on your default printer—no program opening involved. Dragging and dropping other sorts of documents usually launches the program that opens them and then presents the Print dialog box (although this behavior depends on the application and file in question).

A better solution, though, is to use so-called "desktop printers," which are nothing more than icons representing specific printers. To create one, just open Printer Setup Utility, select a printer from the list, and then choose Printers [image] Create Desktop Printer.

Name the printer and save it somewhere useful, such as your Documents folder or desktop. From there, you can drag it into the Finder's toolbar, the sidebar, or the dock—anywhere you'd like to keep it for easy access. From now on, you can print to a specific printer by simply dragging files onto its desktop printer icon.

2.1.25 Undo

You just deleted the novel you've been working on since 1982. Just choose Edit [image] Undo, or press [image] -Z, and the Finder undoes your last operation.

This feature applies to most activities (like renaming folders, moving a file or folder, duplicating an object), but not all. You can't undo a change from icon view to list view, for example. Most important, while you can undo moving an object into the Trash, you cannot undo emptying the Trash! Once it's emptied, everything is gone for good. Caveat emptier.


2.2 Navigating the Finder

The Finder offers a variety of ways to navigate the various windows and menus on your screen. Some, like clicking, are obvious. Others, such as the hints in this section, are less so.

2.2.1 Keyboard Shortcuts

When you're typing up a storm, the six inches from your keyboard to your mouse can feel like six miles. To help keep your hands in one place, Apple provides some keyboard shortcuts for the Finder:

  • In the Finder, [image] -1, -2, and -3 switch the window to icon view, list view, and column view, respectively.

  • If you press [image] -` (next to 1 on the keyboard), the Finder cycles among its open windows. The Finder treats the desktop itself as a window, so if you've got three open windows, you must repeat the keystroke four times to return to the first one.

This window-rotating ploy works in any program, not just the Finder.

  • In list view, if you press the right arrow key, the Finder expands a selected folder's flippy triangle, revealing the files and folders inside it. If you press the left arrow key, the Finder collapses it again (Figure 2-5).

  • If you press [image] -delete, the Finder throws your selected item(s) in the Trash.

  • If you press Shift- [image] -delete, the Finder empties the Trash. (To bypass the confirmation box, hold down Option, too.)

  • If you press [image] -K, the Finder brings up the Connect to Server dialog box.

  • If you press Shift- [image] and the first letter of certain important Mac OS X folders, you jump directly to that folder: C for the Computer window, H for your Home folder, A for the Applications folder, and so on. (Inspect the Go menu if you need reminders.)

If you're a keyboard shortcut fanatic, you may also be interested in Apple's own list: http://docs.info.apple.com/article.html?artnum=75459. There's also an independent list with even more keyboard goodies here: http://davespicks.com/writing/programming/mackeys.html.

2.2.2 The Multibutton Mouse

Apple has long held that only one mouse button should be required with a Macintosh. But once you've used a mouse with a scroll wheel and more than one button, you'll wonder what kind of Kool-Aid the company has been drinking all these years.

Happily, Mac OS X allows you to use two-button mice with scroll wheels, and you don't even need to install software drivers. Almost any USB mouse works right off the bat, although the scroll wheel probably won't work in your Classic programs.

Most of the time, right-clicking something on the screen is the same as Control-clicking it—that is, it makes a shortcut menu appear.

If you want to use more than two buttons, you can buy a multibutton mouse from Macally, Logitech, or Microsoft, all of which make drivers for Mac OS X. Or you can try a generic mouse from some random PC-mouse company in combination with a shareware driver like USB Overdrive (www.usboverdrive.com).

2.2.3 Secrets of the Scrolling Mouse

If you've invested in a non-Apple mouse that has a little scroll wheel on the top, a world of shortcuts and conveniences awaits you. For example:

  • You can pick menu items from an open menu just by spinning the scroll wheel to move up or down the commands and pressing Return to select one.

  • In the Finder, pressing Option while you scroll turbocharges the scrolling. It lets you jump half a page at a time, instead of a few lines at a time.

  • If you press Shift, you can often make the scroll wheel scroll a window horizontally instead of vertically. This surprising trick works in, for example, the Finder, Photoshop, and the Open and Save dialog boxes for certain programs.

2.2.4 Scrolling Diagonally

You probably know already that you can scroll a Finder window either vertically or horizontally, using the corresponding scroll bars. What you may not know is that in list or icon views, there's an invisible, third scroll bar—a diagonal one—that can be handy when you want to find a folder or file in one corner of the window and you don't want to use two scroll bars to do it.

The trick: Option- [image] -drag inside the window, as shown in Figure 2-15.

2.2.5 Canceling a Drag-and-Drop

Suppose you're dragging an icon across the screen, then halfway through the operation, you decide you don't want to drop it. You could, of course, mouse back and drop it where you started.

Ah, but life's too short. It's much easier to press the Esc key (in the upper-left corner of your keyboard) while dragging, then release the mouse button. A quick animation shows you the icon returning to its original location, no harm done.

2.2.6 Opening the Home Folder

Need to get to your Home folder in a hurry? Sure, you can press Shift- [image] -H, but that's for sissies. Here's the power way: click the desktop, and then press [image] -up arrow. ( [image] -up arrow always means, "Take me to the folder that contains this one." Remember that in Mac OS X, the Desktop is nothing more than a folder inside your Home folder. So pressing [image] -up arrow, as it turns out, is perfectly consistent.)

This stratagem is even more useful when you're not already in the Finder. From within some program, for example, you can almost always see a piece of the desktop, so you're just one mouse click and a keystroke away from Home.

Figure 2-15. How to scroll without the scroll bars? Press Option- [image] and drag. The cursor changes into a hand, and the window scrolls—in any direction—as you move the mouse.

2.2.7 Opening Sidebar Folders in New Windows

The sidebar is a great spot for storing often-used files and folders, providing fast one-click access to those items. When you click a folder in the sidebar, it normally jumps to that folder in the currently open Finder window. But what if you want to open a sidebar folder without losing your currently open Finder window?

The solution is simple and elegant, if not obvious. Just like with "normal" Finder windows, you can force open a new window by using the [image] key. Press and hold [image], then click a folder in the sidebar, and it will open in a new window.

This same trick works if you're using spring loaded folders, too (Section 2.5.7). Click and hold on an icon, and as you drag it, hold down the [image] key. Now when you hover over a sidebar folder, it will open a new window into which you can drop your dragged item.

2.2.8 Jumping Directly to Folders

Like a dog digging for a bone, you may find yourself occasionally rifling through a lot of dirt to reach buried folders. If you need to access them frequently, you'll be growling unhappily from dawn to dusk. Shed some hassle by using the following hint.

Choose Go [image] Go to Folder (or press Shift- [image] -G). In the sheet that rolls down from the Finder window's title bar, start typing the path to the folder. (The path is the sequence of folders you need to double-click to access a certain file, with each folder name separated by a slash. Here's an example: Macintosh HD/Users/chris/Pictures/Mount Rushmore.jpg.)

Of course, you'd have to be crazy to type all of that every time you wanted to find a folder—and you'd have to have a photographic memory, too, to remember the precise spelling of each folder name. Fortunately, Mac OS X lets you use electronic shorthand. All you have to do is type a couple of letters and then press Tab—or just wait a moment—to make Mac OS X autocomplete that segment of the path.

If, for example, you want to reach Hard Drive [image] Library [image] WebServer [image] Documents, type /Lib followed by a Tab to make the Finder autocomplete rary/ for you. Type Web (and then hit Tab), and Server/ appears. Finally, type Do (and then Tab), and the rest of the path appears. When you press Enter, the Finder opens the specified folder for you.


2.3 Aliases

Highlighting an icon and then choosing File [image] Make Alias (or pressing [image] -L), generates an alias, a specially branded duplicate of the original icon (see Figure 2-16, top). Since it's not a duplicate of the file—just of the icon—it therefore requires negligible storage space. When you double-click the alias, the original file opens. Even if you rename the alias, rename the original file, move the alias (even to a different drive), or move the original (on the same drive only), double-clicking the alias still opens the original icon.

Because you can create as many aliases as you want of a single file, aliases let you, in effect, stash that file in many different folder locations simultaneously.

2.3.1 Aliases by Dragging

The only problem with creating an alias by using the Make Alias command is that you wind up with the word alias on the end of the file name. If you want the thing to look halfway decent, you're now committed to the tedious task of backspacing over that little suffix. You can also create an alias by Control-clicking a normal icon and choosing Make Alias from the shortcut menu that appears, but once again, the word alias appears on the resulting alias.

Fortunately, you can avoid the whole issue by creating an alias by Option- [image] -dragging the original icon out of its window. Aliases created this way lack the word alias on the file name.

Figure 2-16. Top: You can identify an alias by the tiny arrow badge on the lower-left corner. (Longtime Mac fans should note that the name no longer appears in italics.)

2.3.2 Finding the Original

Mac OS X makes it easy to find the file to which an alias points without actually having to open it. Just highlight the alias and then choose File [image] Show Original ( [image] -R). Mac OS X immediately displays the original file, sitting patiently in its folder, wherever that may be.


2.4 The Finder Toolbar

At the top of every Finder window is a row of navigation and function icons. One click on any of these icons takes you directly to the corresponding disk or folder, or triggers the corresponding command.

The first time you run Mac OS X, for example, you'll find these icons on the toolbar:

  • Back, Forward. As you've probably noticed, the Mac OS X Finder works something like a Web browser. In general, only a single window remains open as you navigate the various folders on your hard drive.

  • The Back button returns you to whichever folder you were just viewing. (Instead of clicking Back, you can also press [image] -[, or choose Go [image] Back—particularly handy if the toolbar is hidden.)

  • The Forward button springs to life only after you've used the Back button. Clicking it (or pressing [image] -]) returns you to the window you just backed out of.

The Back button is also your ticket to the window you were in before you used the Finder's Search bar.

  • View controls. The three tiny buttons next to the Forward button switch the current window into icon, list, or column view, respectively.

  • Action button. This pop-up contains an assortment of handy "action" items that help with tasks such as labeling files and folders, moving items to the Trash, and creating new folders. Nearly identical actions are also available when you control-click an item in the Finder.

  • Search. This is your Find command. It lets you pinpoint a certain icon within this window (or within any of its folders).

(If you don't see the toolbar at all, choose View [image] Show Toolbar.)

2.4.1 Removing or Shrinking the Toolbar

If you're desperate for screen space, you can eliminate the toolbar with one click on the white, oval toolbar button. You can also hide the toolbar (and the sidebar as well) by choosing View [image] Hide Toolbar or pressing [image] -option-T. (The same keystroke, or choosing View [image] Show Toolbar, brings it back.)

Bear in mind, though, you don't have to do without the toolbar altogether. If its consumption of screen space is your main concern, you may prefer to simply collapse it, which deletes the pictures but preserves the text buttons.

To make it so, choose View [image] Customize Toolbar. The dialog box that appears offers a Show pop-up menu at the bottom. It lets you choose picture-buttons with Icon Only, or, for the greatest space conservation, Text Only. You can see the results without even closing the dialog box. (Figure 2-17 illustrates three possible arrangements.) In addition to these three choices, Mac OS X 10.3 has an added Use Small Size checkbox that employs a smaller icon for any icons in the toolbar, giving you the option of having a visual indicator while still conserving some screen real estate.

Click Done or press Enter to make your changes stick.

Once you've mastered these basic sizing tricks, step up to the faster advanced method: -click the oval toolbar button to cycle through all six toolbar variations, one at a time.

2.4.2 Customizing the Toolbar

If you want to improve your workflow, or if you just like to put your personal stamp on everything in sight, you can customize the Finder's toolbar.

To customize your toolbar, open a Finder window and choose View [image] Customize Toolbar. Alternatively, Control-click the toolbar itself and choose Customize Toolbar from the shortcut menu, or just Option- [image] -click the toolbar button in the upper-right corner of the window.

In any case, the Customize Toolbar window now appears (Figure 2-18). It offers some commonly used tools, including the Path pop-up menu (which displays the path to a selected item), New Folder (which creates a new folder inside the currently open one), Delete (which tosses a selected item in the Trash), and Get Info (which opens the Info window for a selected item). Drag the icons you want to the toolbar, and add separators if you so desire. Click Done when you're finished setting things up.

Figure 2-17. The Finder toolbar starts out with both picture and text buttons (top). Of course, you may prefer to see only icons (middle) for greater horizontal compactness or only text (bottom) for greater vertical compactness. In that case, the trio of View icons turns into a single View pop-up menu, as shown here.

The Path pop-up menu is a convenient way to find out which folders contain the icon you're looking at. On the downside, it takes up valuable toolbar space. To display the exact same menu—without the toolbar icon—just [image] -click a window's title.

The best part of this method is that it works in other programs, too. Once you've saved a TextEdit document, for example, you can [image] -click its title to see where it's saved. You can even select one of the items in the menu to jump right to that folder in the Finder.

In addition to Apple's predetermined icons, you can also add the icons of your own files, folders, programs, and disks to the toolbar—making it something like a miniature, secondary Dock. Simply drag any icon onto the toolbar, hover there for a second until the green plus sign appears, then drop the item. (This feature is especially useful for programs like StuffIt Expander because once you've installed a program's icon in the toolbar, you can drag-and-drop files right onto it.)

To rearrange the icons on your toolbar, [image] -drag them horizontally (don't worry, the others will scoot around to make room).

Finally, you can remove icons from the toolbar by [image] -dragging them away from it. If, for instance, you never use the Action button, just drag it off the toolbar. It disappears with an animated puff of smoke.

Figure 2-18. While this window is open, you can add even more icons to the toolbar by dragging them from this gallery. You can also remove icons from the toolbar by dragging them off of it or rearrange them by dragging them horizontally.

2.4.3 Folders on the Toolbar

When you click a folder on your toolbar, the Finder opens that folder in the current window. Sometimes, though, you really want to open it in a new window.

For example, if you want to remember whether you copied an item from your Kitchen Renovation folder into your Stalled Projects folder (which you keep in the toolbar), it'd be nice to leave Kitchen Renovation open while you check Stalled Projects.

The trick is to press [image] as you click the toolbar folder. Doing so makes the Finder open it in a new window.

In fact, there's a third possibility, too: if you press Option instead of [image], the folder opens in a new window while closing the old window. The benefit of this, of course, is that the new folder opens in its own size, shape, and view, rather than being constrained by the previous window.

2.4.4 Heavily Used Toolbar Icons

Often, you'll find that a certain window isn't wide enough to display all of the icons you've stashed on the toolbar. That's a good argument for keeping tools that you use most often, like Delete or Path, on the left end of your toolbar (Figure 2-19).

Fortunately, Mac OS X adds a little >> button at the right end of the toolbar in case your items overflow.

Figure 2-19. The toolbar on top isn't very useful when you open a new window that cuts off your favorite tools—Path, Expander, Activity Monitor, and your Downloads folder. The toolbar below, however, has the most frequently used icons on the left, making them accessible even in narrow Finder windows.

2.4.5 The Permanence of Server Icons

If you, a network maven, regularly connect to a couple of servers, consider dragging their icons onto the toolbar for easy access. In fact, you can even set the icons to automatically log you in so that a single click connects you. Here's how:

  1. In the Finder, press Shift- [image] -K.

    The network browser appears. If your network is working properly, you'll see icons for the other computers on it in this window.

  2. Double-click the server you want.

    The Server dialog box opens.

  3. Enter your user name and password.

    This is the name and password that were set up for your account on the other machine (the one you're connecting to).

  4. Click Options.

    This is the key.

  5. In the Options box, turn on Add Password to Keychain, and then click OK.

    You return to the Connect to Server dialog box, having just told Mac OS X to memorize your password so you'll never have to type it again.

  6. Click Connect.

    The icon of the other computer's shared disk or folder—the server—now appears on your desktop. (See Chapter 6 for more on networking.)

  7. Drag the server's icon from the desktop to the toolbar.

    From now on, when connecting to another machine, just click that icon. One click does the trick: Mac OS X remembers your name and password.

When the server isn't online at the moment, the icon appears as a question mark. (The same ? icon appears for removable disks like CDs and external hard drives that aren't connected at the moment.)


2.5 Working with Files and Folders

When you're not actually working on a document, you're probably manipulating one or more files or folders in the Finder. The following hints will help you maximize your file and folder manipulation time.

2.5.1 Copying by Dragging

You can drag icons from one folder to another, from one drive to another, from a drive to a folder on another drive, and so on. Unfortunately, understanding when the Mac copies a dragged icon, as opposed to merely moving it, bewilders many a beginner. Here's the scheme:

  • Dragging from one folder to another (on the same disk) moves the icon.

  • Dragging from one disk (or disk partition) to another copies the folder or file.

  • Option-dragging copies the icon instead of moving it—always. Doing so within a single folder produces a duplicate of the file called "[Whatever its name was] copy."

  • Dragging an icon from one disk to another while pressing [image] moves the file or folder, deleting it from the original disk in the process. (Press [image] immediately after you start to drag.)

This method is not recommended for moving batches of files. If a network connection (or the electricity) goes out during the operation, you have no way of knowing when the system will delete the originals, and you could lose some files as a result. When moving large selections, therefore, it's better to copy the files first and manually delete the originals later (once you're sure the new files were copied successfully).

2.5.2 Copying by Pasting

Instead of copying files by dragging and dropping as described in the previous hint, you can copy them from one folder to another using the everyday Copy and Paste commands. (This feature has been available in Windows for years, but hey, it's not as though Microsoft has never borrowed anything from the Mac.)

To make it work, highlight one or more icons. Choose Edit [image] Copy, press [image] -C, or Control-click any one of the selected icons and choose Copy from the shortcut menu. You'll note that the command itself changes to reflect what you've selected—"Copy 5 items," for example.

Now open the folder or disk where you want the copies to appear, and then choose Edit [image] Paste or press [image] -V. Ta da! You have copied the selection to the new location.

Unfortunately, you can't cut and paste icons—you can only copy them.

Once you copy a file from the Finder, though, you're not restricted to pasting it back in the Finder. Here are some other places you can use such files:

  • Mail. If you paste a file in a new email message, it'll automatically be added as an attachment.

  • iChat. If you need to send a file while you're chatting with someone, you can just paste it into the chat field and hit Return.

  • iLife applications. Each member of the iLife suite accepts certain kinds of pasted files—photos in iPhoto, music in iTunes and GarageBand, and so on.

  • A word processor. When you paste a non-graphics file in a program like Microsoft Word, it'll paste just the name of the file. The exception, of course, is TextEdit, which will insert an icon representing the file itself.

2.5.3 Copying System Folders

If you've tweaked your machine to the moon and back, you may find yourself wishing that you could back up your System folder to preserve all of your ingenious changes. Just copying your System folder isn't always enough, though. For example, if you want to recreate your tweaked world on another machine or drive, Mac OS X won't copy all the invisible files that actually let your computer start up.

CarbonCopyCloner, however, will. (You can download it from www.bombich.com/software/ccc.html.) This program takes advantage of a number of built-in Unix programs to create an exact clone of one drive on another.

2.5.4 How Much Stuff Is in the Trash?

Sometimes, you'd like to know how much stuff is in the Trash before you empty it. If you see, for instance, that there's 20 GB of data in the Trash, you might want to peruse it to make sure you didn't accidentally delete your Home Movies folder. In Mac OS 9, this information was displayed when you tried to empty the Trash. Since Mac OS X has no such feature, here's a workaround.

Open the Trash folder by clicking its dock icon, hit [image] -A to select everything in the Trash, then [image] -I to open a Multiple Item Info window, as seen in Figure 2-20. You'll instantly see how may documents and folders are in the Trash, and—after some calculation time—exactly how much space they use.

Figure 2-20. By selecting everything in the Trash and using the Finder's Get Info command, you can see exactly how much stuff you'll be erasing when you empty the Trash.

If all you're interested in is how much space the items in the Trash occupy (not how many documents and folders there are), you can deselect everything in the Trash and use Get Info on the Trash itself.

If everything seems OK, then go ahead and empty the Trash. If the size or file count seems too high, it's time to do what your parents warned you not to do: dig around in the Trash until you find what you didn't mean to throw away.

2.5.5 Search the Trash, too!

It's a common scenario: you've created and updated a very important document, but your boss tells you to revert to the previous version because of changes in the agreement. You head back to your Mac and quickly find the modified file, but the original is nowhere to be found. You're quite sure you saved the new one by appending "MODIFIED" to the name, and yet you can't find the original. So you call up the Finder's search ( [image] -F) and tell it to find your original. After a few minutes of disk activity, it, too, draws a blank. So what happened to your original?

Possibly, after making the modifications, you moved the original file to the Trash can, but haven't yet emptied the Trash. The problem is that the Finder's Find command doesn't look in the Trash during a search; it's sort of a "find only the obvious stuff" search. Luckily, this problem is easily fixed, as depicted in Figure 2-21.

Figure 2-21. If you'd like to search everywhere, including the Trash, when looking for lost files, you'll need to modify the Finder's default search criteria. Hit [image] -F to bring up the Find panel, and then click the + button to add a new item. As seen here, set the left pop-up to Visibility, and the right pop-up to "visible and invisible items." This will force the Finder to look in the normally invisible Trash folder, as well as other normally hidden regions of your Mac.

2.5.6 Find Items with Spaces at the Start of Their Names

The Finder's Find command ( [image] -F) has trouble with leading spaces. For example, a search for " Data," (notice the space), will find not only "My Data" but also "Data"—even though it doesn't technically match. If you want to find just the exact matches for " Data," then, here's the trick: in the Finder's search box, enter the space while holding down the Option key. Now a search for Option-space followed by "Data" will find only the My Data folder.

2.5.7 Spring-Loaded Folders

Here's a common dilemma: you want to drag an icon not just into a folder, but into a folder nested inside that folder. This awkward challenge would ordinarily require opening the folder, opening the inner folder, dragging the icon in, and then closing both of the windows you had opened. As you can imagine, the process is even messier if you want to drag an icon into a sub-subfolder or even a sub-sub-subfolder.

Fortunately, Mac OS X's spring-loaded folders feature saves you all of that hassle. As shown in Figure 2-22, it lets you drag an icon into a deeply nested folder with a single mouse movement. When you finally release the mouse, all the windows except the last one close automatically. You've neatly placed the icon into the core of the nested folders.

All of this means you can navigate around without a lot of clicking; just drag an icon over a folder, wait, drag to the next subfolder, wait, and so on. It also means you don't need to know where you want to file something before you head to the Finder.

To enable this feature, choose Finder [image] Preferences, click General, and turn on "Spring-loaded folders and windows." Here you can also establish the length of the delay before windows spring open.

The following tips will help you get the most out of spring-loaded folders:

  • Although spring-loaded folders work in any Finder view, they're especially useful in column view. As you hold a dragged icon over a folder, successive levels of folders open to the right, as shown in Figure 2-22.

Figure 2-22. Top: To make spring-loaded folders work, start by dragging an icon onto a folder or disk icon, but don't release the mouse button. Wait for the window to open automatically around your cursor. (If the inner folder you intend to open isn't visible in the window, you can scroll by dragging your cursor close to any edge of the window.)

  • Weird but true: Spring-loaded folders can be more useful when you've turned off the feature (in Finder [image] Preferences). That way, folders spring open only when you press the Space bar. With automatic spring-loading turned off, folders never slide open unexpectedly. Instead, you'd drag an item over a folder, press the Space bar, find the next folder, press the Space bar, and so on.

  • You can even drag icons onto disks or folders whose icons appear in the Finder's sidebar. When you do so, the window will jump to that folder or disk, and you can continue your drag-and-hold folder navigation from there.

  • If you work in list view, hovering over the flippy triangle (to the left of the folder name) will cause the folder to expand within the current window. If you hover over the actual folder name, the Finder will use a new window instead of the current window.

2.5.8 Return of the Pop-up Windows

For quick and easy filing, nothing beats Finder windows that you just leave open. Conversely, if you're borderline psychotic about extraneous stuff on your desktop, even one extra Finder window might send you over the edge.

Fortunately for all, with a combination of spring-loaded folders and Finder windows that sit mostly off the screen, you can access nearly anywhere on your hard drive without cluttering the screen. (In brief, you're going to create the perfect analog to the pop-up windows feature of Mac OS 9.) Here's the rundown:

  1. Make sure your Finder is set to use spring-loaded folders.

    See Section 2.5.7.

  2. Move your dock from the bottom of the screen to one of the sides.

    You can find out how in hint Section 3.1.5.

Although this maneuver isn't necessary, it's a good idea if you want to drag Finder windows all the way to the bottom of the screen.

  1. Open a new Finder window for a folder you'd like to use regularly, and set it to your favorite view.

    You actually can open several Finder windows in this way. If that's your goal, you might consider setting them all to list view, which provides the narrowest possible display.

  2. Drag the window to the bottom of the screen, as shown in Figure 2-23.

Figure 2-23. Three windows perched quietly at the bottom of the screen, showing a new file being dragged into the now popped-up Pictures folder.

Now it's time for the magic. The next time you want to file an icon, drag it onto a folder's title bar at the bottom of the screen and wait a moment without releasing the mouse. Suddenly, the hidden window scrolls smoothly onto the screen, as seen in Figure 2-23. If you continue your drag onto one of the folders within the newly expanded window, you'll find that the spring-loaded action lets you navigate the whole window without additional clicking.

You can also use this hint with spring-loaded turned off. Just press the Space bar when you're hovering over the title bar to make a hidden window pop up, and then press the Space bar again for every inner folder you want to spring open.

When you move the icon off the window, the window glides back into place. (If you drop the icon inside the window, you'll have to move the window back yourself.)

There's nothing that says you have to keep your hidden windows on the bottom of the screen, though. If you want, you can drag windows off the sides or in the corners of your screen, where they'll take up even less space. Then, when you drag an icon onto them, they'll pop out of anywhere they're hidden.

2.5.9 Renaming Files Without Delay

To rename a file in the Finder, you're supposed to click its name to put it in editing mode (indicated by a rectangle). The system waits a second to see what you intend to do (to rule out the possibility that, for example, your first click was only the first part of a double-click).

But if all you want to do is rename a file, and you want to do it post-haste, click the icon once (or its name) and then press Return or Enter. The renaming box appears immediately.

2.5.10 Weird Sorts

Let's say you have a report cunningly named "The Boss Will Fire Me If I Don't Finish This Report." If you file it in your Documents folder, and you sort the contents of that folder alphabetically (by clicking the Name column heading), the report could get lost in the fray.

You can force it to the top of the list, however, by adding punctuation in front of the file name. (Heads up if you're a Mac OS 9 convert: in that system, if you added punctuation in front of a folder or file name, the item would move to the bottom of a Finder window sorted alphabetically.)

Most punctuation marks (and spaces) force an icon to the top of a file list. If you want to force something to the bottom, though, precede its name with one of these special characters: (Option-M); (Option-P); (Option-Z), or [image] (Shift-Option-K). These symbols, as listed here, indicate the proper sorting order—that is, a folder named Fish Heads would appear higher in the list than one called Fish Heads.

2.5.11 Editing Multiple File Names

If your job is to rename a whole bunch of files, here are a few thoughts that can make your life easier:

  • Put the window into list or column view. Click the first icon. Press Enter to open the renaming box and edit the file's name (use the arrow keys to move around within the name). Then press Enter, press the down arrow to highlight the next icon, press Enter to open its renaming box, and so on. Lather, rinse, repeat.

  • The trouble with that method, unfortunately, is that each time you press Enter after editing a name, the icon might jump around in the list to maintain its new alphabetical position. It's easy to see how this could drive you crazy.

  • The solution, of course, is to put the list view into a sorting order that isn't alphabetical. Click Date Modified, for example, to sort the list by date. Now the file names you edit won't affect the sorting order.

  • If you work on, for example, computer books—or any other endeavor where you must frequently rename or renumber batches of graphics, chapters, and so on—invest in A Better Finder Rename. This amazing shareware program can slice and dice file names, en masse, in any conceivable way: adding or removing sequence numbers, searching and replacing text in a batch of file names, adding prefixes or suffixes, and so on. (You can download it from www.publicspace.net/ABetterFinderRename, among other places.)

2.5.12 Folder Action Scripts

Folder action scripts are a fascinating and rarely explored feature of AppleScript, the Mac's built-in scripting language. These special scripts let you monitor certain folders—and trigger automatic events accordingly.

For example, Mac OS X comes with a script capable of playing a certain sound whenever somebody adds new icons to a watched folder. This feature comes in handy when, say, you've shared a folder on a network and you want to be alerted whenever another network citizen deposits anything in your Repaid IOUs folder. Here's how to activate it:

  1. Control-click any folder and choose Enable Folder Actions from the shortcut menu.

    You've just flipped the master switch. You only need to do this once on any folder to enable Folder Actions for all folders.

  2. Control-click the folder to which you'd like to attach an action, and select Attach Folder Action.

    The standard Mac OS X Open dialog box appears, pointing to the Folder Action Scripts folder (which is buried in the Library [image] Scripts folder). You're probably looking at a column view listing, which may not be very useful, given the long script names in the folder. Click the list view icon at the top left for a much more readable view, as seen in Figure 2-24.

Figure 2-24. When attaching a folder action script to a folder, it's much easier to read all the names when you switch the dialog box into list view, as seen here.

  1. Click the script you want, and then click OK.

    This will attach your chosen script to the folder. For instance, to be alerted every time something is added to the folder, select "add - new item alert.scpt" from the list.

    You can add as many actions to a folder as you want. You could have one that runs when the folder opens, one when something is added to it, and one when it closes, for example.

    That's all there is to it. From now on, when things are added to the folder, a dialog box will appear asking if you'd like to see the newly added items. (Other folder actions will have other behaviors.)

    To remove a folder action, just control-click the folder again, select Remove Folder Action, and then highlight the folder action to be removed.

In addition to editing existing folder action scripts, you can—and probably should—write your own. After all, folder action scripts are an incredibly powerful resource that can help you automate tedious tasks in the Finder. For more details, see Apple's help page at www.apple.com/applescript/folder_actions.

2.5.13 A Folder Action Script to Organize the Desktop

Folder action scripts (see hint Section 2.5.12) can be used for many mundane tasks, such as organizing your desktop. The following script, for example, moves image files from your Desktop folder to an Unfiled folder in your Pictures folder. Launch Script Editor (in Applications [image] Utilities) and input the following code (or download it from www.macosxhints.com/book/103scripts.html):

on adding folder items to this_folder after receiving added_items

  tell application "Finder"

    set homeFolder to (container of (path to desktop folder) as string)

    set folderLocation to homeFolder & "Pictures:Unfiled:"

    repeat with aFile in added_items

      if the name extension of aFile is in ¬

        {"jpg", "gif", "png", "pict", "tiff", "gif", "psd", "bmp"} then

        tell application "Finder"

          try

            move aFile to folder folderLocation

            display dialog ¬

              "Image files have been moved to the Unfiled" & return & ¬

              "folder in your Pictures folder."

          on error err

            display dialog err

          end try

        end tell

      end if

    end repeat

  end tell

end adding folder items to

The "¬" symbols above are line break characters in Script Editor. Resist the urge to enter them—just hit the Space bar instead.

Once entered, save the script in a convenient location, and then attach it to your Desktop folder as an action (see the previous hint for details). Now whenever you download any graphics files to your desktop, Mac OS X will automatically transfer them to your Pictures [image] Unfiled folder.

2.5.14 Open the Finder Selection in the Terminal

If you work often in the Terminal (the interface to Mac OS X's Unix core), you probably do a fair bit of switching from the Finder to the Terminal and back again. Oftentimes, you'll see a folder in the Finder and think, "Ah, yeah, I need to do some Terminal tasks inside that folder." The standard solution is to switch to the Terminal and type cd /Library/Fonts/etc, or whatever the path is for the folder you're interested in.

The power user's solution, though, is to open Terminal, type cd, hit the Space bar, switch back to the Finder, and then drag and drop the folder of interest onto the Terminal window. This trick autocompletes the path, and you can then hit Enter to execute the command.

The best way to handle your Finder to Terminal exchanges, though, is with the following AppleScript. Open Script Editor and enter the script (or download it directly from www.macosxhints.com/book/103scripts.html):

(*

Open in Terminal

Copyright 2002 Gregory Ramsperger <oit@jitjat.com>

*)

property badPathChars : ¬

{"\\","`","!","$","&","(",")","{","}","|","'","\"",";","<",">","?"," "}

-- drag-and-drop open

on open theList

  set dir to (item 1 of theList) as text

  my oit(dir)

end open

-- direct run

on run

  try

    tell application "Finder"

      set dir to the target of Finder window 1 as text

    end tell

    my oit(dir)

  on error

    my oit(path to desktop)

  end try

end run

-- run a command in the terminal

on oit(d)

  tell application "Finder"

    if d does not end with ":" then

      set d to (container of item d) as text

    end if

  end tell

  set p to (POSIX path of d)

  repeat with c in badPathChars

    set AppleScript's text item delimiters to c

    set tempitemList to every text item of p

    set AppleScript's text item delimiters to ("\\" & c)

    set p to the tempitemList as string

    set AppleScript's text item delimiters to ""

  end repeat

  tell application "Terminal"

    activate

    do script with command ("cd " & p)

  end tell

end oit

Just like in the previous script, type a space instead of the "¬" symbol.

Once everything's entered, select File [image] Save. Then name your script, set the File Format pop-up to Application, and store it somewhere handy (like your Documents folder).

Once saved, find the script in the Finder. From here, you can drag the script to the Finder's sidebar, its toolbar, or into the left side of your dock. Once in place, you can open any folder in the Terminal by simply dragging and dropping it onto the script's icon. You can also select any file or folder in the Finder and launch the script's icon to accomplish the same result.

2.5.15 Renaming System Folders

Mac OS X gives you lots of freedom in lots of areas, but it's fairly stern about one: you're not allowed to rename any of the key system folders—Applications, Library, and so on. Likewise, you really shouldn't rename the preinstalled folders inside your Home folder (like Movies, Pictures, Documents, and Music) either.

Mac OS X will let you change Music to My Music Collection, but bad digital things may happen when your programs go looking for folder names that no longer exist. For instance, iTunes will no longer be able to find its library unless you tell it the new location, and other programs may flat-out fail when they can't find the Music folder.

You can safely rename any folder, though, if you know the secret (Figure 2-25). While this technique has its advantages, it only gives you custom names in the Finder—other programs won't show the new names. Here's the trick:

  1. In the Finder, open the System [image] Library [image] CoreServices [image] SystemFolderLocalizations folder. Inside, click the en.lproj folder once.

    This folder contains the file that stores System folders' names. (If English is not your native language, open the folder that matches your language.)

  2. Choose File [image] Get Info. In the Info window, click the triangle next to Ownership & Permissions.

    Click the flippy triangle next to Ownership & Permissions, too.

  3. Click the small lock icon (so it appears unlocked). Using the Owner pop-up menu, choose your account name.

    If a password dialog box appears to confirm that you are indeed an Administrator account holder (Sidebar 1.1), enter your password and then click OK. In any case, the point here is that you have just seized control of a folder that Mac OS X normally keeps to itself.

Figure 2-25. "Flix" instead of "Movies"? "Messy Desktop" instead of "Desktop"? "Snaps" instead of "Pictures"? What kind of mischief is afoot here? Just a little handy-dandy folder name hacking.

  1. Open the en.lproj folder. Inside, you'll find a file called SystemFolderLocalizations.strings. Drag this icon onto the icon of TextEdit.

    You'll find TextEdit inside your Applications folder. See Section P.3.5.2 for an important primer on the procedure you're about to follow.

    In any case, you just opened what appears to be a document filled with computer code, starting with this:

    /* Top-level folders */

"System" = "System";

"Applications" = "Applications";

"Library" = "Library";

    What you're actually seeing is a little table. Behind the scenes, Mac OS X maintains a list of the original names of certain folders (on the left side of this table), along with the names you actually see in the Finder (on the right side).

    Again, the name on the left side of each pairing is the actual name of the folder. Do not change the left side! You can change the name on the right side to anything you like.

    So much for the main system folders. What about the folders inside your Home folder?

    Look for a section heading called "Folders in user homes." If you don't see it, you need to add a file named .localized in each folder that you wish to rename (Desktop, Movies, Pictures, and so on).

    You can create these files in Terminal. Open Applications [image] Utilities [image] [image] Terminal. Type touch ~/Desktop/.localized and then press Enter to add the file to the Desktop folder. Repeat the command with each remaining folder. Log out and log back in. When you reopen the SystemFolderLocalizations.strings file, you're now faced with the "Folders in user homes" section, which you can edit as described above.

  2. Once you've made all your edits, close and save the file.

    When TextEdit warns you about permissions on the file, click Overwrite to save your changes.

  3. In the Info window, set the owner back to system.

    In techno-speak, this chore is known as "housekeeping."

  4. Log out and log back in, open a Finder window, and discover your folders' new vanity plates.

Your custom names won't always show up if you have the Finder preferences set to "Always show file extensions."

Also, you'll see your custom names when you connect to other machines on a network. Don't worry, though, you haven't renamed anything on the connected machine. Your Mac is simply replacing the names with your preferred versions for display on your machine only.

2.5.16 Unused Languages: Your Free Megabytes

Many Mac OS X programs let you work in a number of languages. iPhoto, for example, comes with more than 10 languages, which contribute to its taking up a whopping 60 or more megabytes of your hard drive.

You can recover some of that space by deleting the languages you don't need. You can slim down iPhoto, for example, to just under 13 MB by deleting everything but English. Not bad for two minutes' worth of work.

Before you proceed, note that this operation involves removing files from inside a software package. Play it safe, and start by creating a copy of the application in the Finder—highlight the program's name and select File [image] Duplicate (or hit [image] -D). Then perform the following steps on the copy of the program.

  1. Click the application and select File [image] Get Info (or hit [image] -I).

  2. This will open the info window for the program you'd like to send on a diet.

  3. Click the triangle next to Languages.

  4. This will reveal any language files within the application. You may see all sorts of weird abbreviations, such as zh_TW, sv, no, and so on. If you use a North American English system, the only language you need to keep is English.

  5. Remove the languages you don't need.

  6. Highlight a language by clicking on its name (do not click the checkbox; just click the name next to the checkbox), and then click the Remove button. Repeat for each language you wish to delete.

  • When you're done deleting, launch the copy of the application and make sure it's working properly. If it is, then you can empty your Trash and archive the original copy of the program to a CD-ROM or to a rarely used secondary drive. If you have any problems with the slimmed-down application, simply delete the duplicate and use the original again.


2.6 Desktop Interior Design

One of the tremendous benefits of the Mac has always been the degree of customization that you can apply to your environment. Icons, sounds, graphics, and color can make your computer truly your computer. The following hints let you exceed the standard tricks and create a unique operating environment.

2.6.1 Changing the Screen Behind the Login Window

Behind the initial login screen, the background image is blue with some white arcs running through it in a semicircular pattern. It's very attractive—the first 4,000 times you look at it.

If you'd like to express your creativity by replacing this background with something groovy and personal, try this technique:

Because you're altering the screen everyone sees before login, this change affects all account holders on the Mac.

  1. Choose an image you'd like to use.

    Any JPEG is fine, though there's no point in using an image that's larger than your display area.

  2. In the Finder, open the Library [image] Desktop Pictures folder.

    A list of the standard Apple desktop images appears. Aqua Blue.jpg is the file you want to replace. Drag it out of the folder to a safe place as a backup (or just rename it).

  3. Drag your own graphic into the Desktop Pictures folder. Rename your file Aqua Blue.jpg.

    This sleight-of-hand allows the system to find it during the startup process.

If you don't have a file in this folder called Aqua Blue.jpg, Mac OS X simply uses a solid blue background for the login screen.

  1. Log out to bring up the login panel.

    Presto! Your new image appears behind your login screen.

2.6.2 Screen Saver Photos as a Desktop Background

Apple supplies some great photos in its screen savers, especially those in the Beach and Cosmos packs. The problem is that the only obvious way to see the pics is to turn on the screen saver. You can, however, use any of those images as a desktop background—if you know the trick.

  1. Preview the images to find one that you like.

    To do that, open the System Preferences [image] Desktop & Screen Saver [image] Screen Saver tab. Find the screen saver that contains the photos you want.

The only built-in screen savers with useful pictures are Abstract, Beach, Cosmos, and Forest. Others (like Flurry) generate their images on the fly, so you can't use them as a desktop background.

  1. In the Finder, open the System [image] Library [image] Screen Savers folder.

    Inside are the actual screen saver modules, beginning with Abstract.slideSaver and Beach.slideSaver.

  2. Control-click the screen saver whose images you want. From the shortcut menu, choose Show Package Contents (Figure 2-26).

    A secret window opens, containing the components of the screen saver.

  3. Open the Contents [image] Resources folder.

    Inside are the actual JPEG files used by the screen saver. To preview them, use the Finder's column view preview pane (hint Section 2.1.6).

  4. Drag any (or all) of the images to your Home [image] Pictures folder (or any other folder in your Home folder).

    Because the System folder is always locked, Mac OS X automatically copies them instead of moving them.

    Figure 2-26. Here's how you raid a Mac OS X screen saver to swipe its photos.

    If you'd rather not take up the space needed for two separate copies of each image on your hard drive, you can simply create aliases in your Pictures folder (Section 2.3).

  5. Choose [image] [image] System Preferences. Click the Desktop & Screen Saver icon, and click the Desktop tab.

    Click Choose Folder, and find the folder where you just saved the images. There, you've just recycled the screen saver photos for use as your desktop wallpaper.

2.6.3 Extra-Large Desktop Icons

There's no good reason to use enormous desktop icons, as shown in Figure 2-27. But there's no good reason to bungee jump, either, and tons of people do it!

If you, too, hear the siren call of the hacker, here's how to proceed:

  1. Open TextEdit.

    TextEdit is a stripped-down word processor in your Applications folder.

  2. Choose File [image] Open.

    The Open File dialog box appears.

Figure 2-27. Mac OS X will usually allow you to create icons with a maximum size of 128 pixels square—that is, about 20 percent the height of an 800 600-pixel screen. With a simple tweak, though, you can create monsters like these—icons visible from outer space.

  1. Press Shift- [image] -H to jump to your Home folder. Then open Library [image] Preferences [image] com.apple.finder.plist.

    One of Mac OS X's secret preference files opens before you, looking like gibberish.

  2. Choose Edit [image] Find [image] Find. Type desktopview and click Next.

    TextEdit highlights part of a line that reads:

    <key>DesktopViewOptions</key>

    A few lines below that, two lines read something like:

    <key>IconSize</key>

<integer>64</integer>

    The second line might have a different number than 64.

    No matter what the number is, change it to reflect the icon pixel size you want to use.

    Numbers in even multiples of 16 (144, 160, 176...) produce the best results. Although there's no theoretical limit, you probably don't want to be the first person to find out what happens if you set the icon size to something greater than the width of your screen.

  3. Close and save the file, then restart the Finder.

    Gape at your new icons.

These giants will disappear if you open the Finder, select the desktop, choose View [image] Show View Options, and then even slightly move the "Icon size" slider.

2.6.4 Screen Saver Animations as the Finder Background

If you're really bored, you can display your screen saver as the Finder background—yes, an animated desktop (Figure 2-28). It's hours of fun for the entire family!

Figure 2-28. When you press Enter, the screen saver appears in your Finder, behind all your icons and windows.

Start by selecting a screen saver you like (using the Desktop & Screen Saver pane of System Preferences). Next, open Terminal (in your Applications [image] Utilities folder). At the prompt, type the following on one line (make sure there's no space between "Resources/" and "ScreenSaverEngine"):

/System/Library/Frameworks/ScreenSaver.framework/Resources/ ScreenSaverEngine.app/Contents/

MacOS/ScreenSaverEngine -background

Unfortunately, running a screen saver as a desktop positively devours processing power. To end the insanity, make the Terminal window active and then press Control-C.


Chapter 3. The Dock

The Dock, a central and critical component of Mac OS X, combines several important operating-system functions into a single row of icons across one edge of your screen. It's a program launcher, a program switcher, a document-storage site, an information hub, a floor wax, and a dessert topping!

Seriously, though, the Dock can help simplify your workflow, and you can personalize it to within an inch of its life. The hints in this chapter are designed to make your time with the Dock more productive. And if you can't stand the thing, the last hint explains how to vanquish the Dock completely.


3.1 The Dock Makeover

By now, you already know the basics of the Dock: any icon you drag onto it is installed there as a large, square button (Figure 3-1); and a single click, not a double-click, opens the corresponding icon. In other words, the Dock is an ideal parking lot for the icons of disks, folders, documents, and programs you frequently access.

Figure 3-1. Everything on the left side is an application—a program, in other words. Everything else goes on the right side—files, folders, minimized windows, and so on.

The other basic Dock information morsel is that folders and disks are hierarchical. That is, if you click a folder or disk icon on the right side of the Dock and hold down the mouse button, a list of the icon's contents sprouts out of it. This hierarchical structure lets you burrow into folders within folders. (See Figure 3-2 for an illustration.)

Figure 3-2. As long as you keep the mouse button pressed, you can burrow into folders within folders—either with the intention of opening a file or folder (by releasing the mouse button as you point), or just to see what's inside.

To make the pop-up menu appear instantly, just Control-click the Dock icon or right-click it (if you have a two-button mouse).

The coolest trick about these menus, though, is that you navigate them entirely from the keyboard. For example, if you've put the Applications folder in the Dock, you can Control-click it to make the menu of its contents appear, and then you can type uti to jump right to Utilities. From there, you can press the right arrow key to display the contents of the Utilities folder and type ter to jump to the Terminal. With a quick hit of the Space bar, you can open it.

3.1.1 Adding Icons

Nobody but you can put icons on the right side of the Dock. Program icons, however, appear on the left side of the Dock automatically whenever you open a program (even one that's not normally listed in the Dock). These icons remain there for as long as the program is running, and they give you a quick way to add a program's icon onto your Dock for good, as shown in Figure 3-3.

There's even a third way to add a program's icon—one that strikes many people by accident. If you drag an open program's Dock icon, even by the tiniest bit, it will become a permanent addition to the Dock. That's because you've just dragged the icon off of the Dock and then back onto it, and as you know, dragging any icon onto the Dock installs it there as a permanent fixture.

Figure 3-3. Once a program is running, Control-click its Dock icon. If you choose Keep in Dock from the shortcut menu, the program's icon stays in the Dock forever...or at least until you drag it out.

3.1.2 Removing Icons

To remove a program's icon that's already on the Dock, just drag it away from the Dock. (You're not erasing the program—only its Dock representation.) If the program isn't running, the program's icon vanishes in an exciting puff of smoke.

If the program is running when you remove its icon, the picture bounces back into the Dock. Ah, but your gesture hasn't been in vain; when you quit the program, the icon vanishes.

3.1.3 Resizing the Dock

If the Dock takes up too much room on your screen, or if you wish it was larger, Mac OS X offers two ways to change its size.

One way is to choose [image] [image] Dock [image] Dock Preferences. In the Dock preference pane that appears, drag the slider on the Dock Size bar and the Dock changes size.

The other, much more secret, way is to move your mouse over the Dock's divider bar. The cursor magically becomes a resize bar (Figure 3-4), so that you can drag either up or down to make the Dock grow or shrink. (Its expansion is limited by the edges of your screen, though. For instance, if you already have 436 icons installed, they may not have much room to grow.)

Figure 3-4. When you resize the Dock, the icons on it may look slightly distorted. This fuzziness occurs when the Dock must switch between two preset icon sizes in order to present an image at an in-between size. To correct the problem, Option-drag the Dock's divider bar. You've just forced the program to restrict icons to sizes that the icon designers have explicitly drawn.

3.1.4 Hiding the Dock

To retain maximum monitor acreage, you can keep the Dock hidden. Hiding the Dock is particularly useful if you use it primarily to switch programs and otherwise don't need to see it. It's also a good option to remember when the Dock intrudes upon the windows of Classic programs, which, because they predate Mac OS X, generally aren't smart enough to avoid the Dock.

Choose [image] [image] Dock [image] Turn Hiding On (or, if time is of the essence, press Option- [image] -D). Choose Turn Hiding Off, or press the same keystroke again, to make it reappear.

Of course, you may never need to force it to reappear. That's because even after it's been hidden, the Dock springs temporarily back into view whenever you move the mouse to its edge of the screen.

3.1.5 Moving the Dock to the Side

The bottom of the screen isn't necessarily the ideal location for the Dock. Because most screens are wider than they are tall, the Dock eats into your limited vertical screen space.

Fortunately, you can rotate it in either of two ways:

  • The indirect way. From the [image] [image] Dock submenu, choose "Position on Left," "Position on Right," or "Position on Bottom."

  • The direct way. While pressing Shift, drag the Dock's divider line, as though it's a handle, directly to the side of the screen you want.

You'll probably find that the right side of your screen works better than the left, since most Mac OS X programs position their document windows against the left edge of the screen, where the Dock and its labels might get in the way.

3.1.6 The Top-Mounted Dock

Apple provides three standard screen positions for the Dock: left, right, and bottom (see hint Section 3.1.5). But that leaves one possible spot unexplored: the top. If you're a Macintosh iconoclast—you know, the kind who uses Curlz MT as your everyday font—you might want to move the Dock to the north edge of your monitor just to be wacky.

Instead of trudging through the following steps, you can also put that Dock at the top by clicking a single button in TinkerTool, a free program that's available at www.bresink.com/osx/TinkerTool.html.

The same alternative applies to hints Section 3.1.7 through Section 3.2.1.

  1. Open Terminal.

  2. You'll find this program is in your Applications [image] Utilities folder.

  3. At the prompt, type <i>defaults write com.apple.Dock orientation -string top </i>(and then press Enter).

  4. You've just issued the magic command that positions the Dock at the top of the screen. (For more about the defaults command, see Section P.3.5.4.)

  5. Quit Terminal. Then, to make your change take effect, quit the Dock.

  6. One way to restart the Dock is simply to log out and then log in again. If you don't have that kind of patience, however, you can use Activity Monitor (a program in your Applications [image] Utilities folder). Sort the list by name (click the Process Name column) so you can scroll to Dock.

  7. Highlight Dock, and then click Quit Process. When asked how you want the Dock to quit, click Quit (not Force Quit). The Dock quits, restarts, and now resides at the top of your screen. If you ever tire of the effect, you can always move the Dock back to a standard location by Control-clicking its divider bar and choosing, for example, Position on Screen [image] Right from the shortcut menu.

If you keep the Dock hidden, move the mouse just to the bottom of the menu bar—not the very top of the screen—to make it slide back into view. If you don't like the Dock in general, hiding it at the top of the screen is an effective way to ensure that you hardly ever see it. That's because it's very hard to position the mouse so that the Dock springs into view.

3.1.7 Changing the Minimize Animation

When you minimize a window (hint Section 3.2.3), it flies to the Dock using a cute little animated effect. In fact, you have a choice of at least two animated effects: Genie, which looks like Barbara Eden funneling into a bottle; and Scale, which shows a cascade of shrinking boxes in a style reminiscent of Windows. (You can find these choices in [image] [image] Dock [image] Dock Preferences, or by Control-clicking the Dock's divider bar and choosing a method from the "Minimize using" menu.)

But because you're now an official Mac OS X power user, you're entitled to learn about the secret third animation, entitled Suck. It makes the window appear to get sucked into the Dock by one corner. It's not hugely different from Genie, but it's a tad faster.

To try it out, open the Terminal program (Section P.3.5.3) and type:

defaults write com.apple.dock mineffect suck

Press Enter, and then quit Terminal. To make your change stick, quit the Dock using Activity Monitor, as described in hint Section 3.1.6.

To return to one of the original animation styles, choose [image] [image] Dock [image] Dock Preferences and click the one you prefer.

3.1.8 Pinning the Dock to a Corner

You can place the Dock on any edge of the screen, but it's always centered on that edge. If you'd find it less intrusive in a corner, however (or if you like the Trash nestled in a corner), there is a way to "corner" the Dock. Figure 3-5 illustrates the three possible placements for the Dock and tells you how to move it accordingly.

Figure 3-5. Three placements for a vertical Dock. To move the Dock back to the middle, repeat the command described in this hint, but replace the word location with the word middle. Quit and restart the Dock.

Open Terminal (Section P.3.5.3). At the prompt, type:

defaults write com.apple.dock pinning location

but instead of the word location, type either start or end (to push the Dock against the left or right side of the screen, respectively). Press Enter, quit Terminal, and then quit the Dock using Activity Monitor, as described in hint Section 3.1.6. Presto! Your Dock is left- or right-justified.

If your Dock is oriented vertically, it will be either top- or bottom-justified.

3.1.9 Differentiating Hidden Programs

Pressing [image] -H (or choosing the Hide command from the menu that bears the frontmost program's name) is all well and good, as it renders all of the program's windows invisible to get them out of your way. Even when you do that, however, its Dock icon remains fully visible, oblivious to the fact that the program has now been hidden. The result for most people is confusion, since it's now harder to remember which programs you've hidden.

With a small settings tweak, however, you can have the Dock display hidden programs with a semi-transparent icon, as shown in Figure 3-6.

Figure 3-6. Every program that's open—hidden or not—displays a small black triangle underneath itself. However, hidden open programs have transparent icons, too.

Open Terminal (Section P.3.5.3). At the prompt, type:

defaults write com.apple.dock showhidden -bool yes

and then press Enter. (See Chapter 15 to learn more about the Terminal.)

To trigger your change, quit the Dock using Activity Monitor, as described in hint Section 3.1.6.

To return to the normal look for all icons, repeat the above command but replace yes with no. Then quit and restart the Dock.

3.1.10 Adding Quit to the Dock's Finder Icon

Hint Section 2.1.19 explains how to add a Quit menu command to the Finder. But why stop there? You can also add Quit to the Finder's Dock icon, providing yet another way to quit or relaunch the Finder in a jiffy.

Just like hint Section 1.4.2 suggests, you'll need to burrow inside Mac OS X's buried folders to accomplish this trick.

  1. In the Finder, open the System [image] Library [image] CoreServices folder.

    This folder contains programs that you work with every day, but that Apple doesn't want you to mess up—the Finder and the Dock, for example.

  2. Control-click the item named Dock, and select Show Package Contents from the shortcut menu.

    The Dock, like most Mac OS X programs, is a package.

  3. Within the Dock package, navigate to Contents [image] Resources. Select (but don't open) the English.lproj folder.

    If you speak another language, you can select a different folder instead.

  4. Choose File [image] Get Info. In the Info window, click the Ownership & Permissions triangle.

    Click the Details flippy triangle, too.

  5. Click the lock icon (so it's now unlocked), and select your user name from the Owner pop-up menu.

    This step lets Mac OS X know that, for now, you should be allowed security clearance for the English.lproj folder. If the Finder asks for your password, enter it.

  6. Open the English.lproj folder.

    This folder stores the Dock's permanent settings (as opposed to those in your Preferences folder, which change every time you add or remove an icon from the Dock).

  7. Make a backup copy of DockMenus.plist. Then open DockMenus.plist with TextEdit.

    If anything goes wrong, you can replace the modified plist file with your backup copy, thereby restoring the Dock to its original state.

  8. Choose Edit [image] Find [image] Find, and search for relaunch.

    You'll jump right to the middle of the file, where Mac OS X stores what to display in the Finder's Dock menu.

  9. Insert the following text in the file (the bold text is already there, so don't retype it):

        <string>Relaunch</string>

</dict>

<dict>

    <key>command</key>

    <integer>1003</integer>

    <key>dynamic</key>

    <integer>0</integer>

    <key>dynamic-break</key>

    <true/>

    <key>name</key>

    <string>Quit</string>

</dict>

<dict>

    <key>command</key>

    <integer>1024</integer>

    <key>dynamic</key>

    <integer>1</integer>

    <key>name</key>

    <string>Force Quit</string>

</dict>

</array>

  10. Close and save the file.

    Back in the Info window in the Finder, set the owner of the folder back to system.

  11. Log out and log back in to see your changes.

    Alternatively, you can restart the Dock.

From now on, the Finder's Dock menu will also have a Quit item.


3.2 Working with the Dock

Sure, anyone can work with the Dock by dragging stuff to and fro, Control-clicking various icons to use shortcut menus, and so on. However, much more power lurks in the heart of the Dock. (Use it only for the forces of good.)

3.2.1 Keyboard Combos

Most of the fun of the Dock comes from pressing modifier keys (Shift, Option, and so on) as you click. Here are the most winning combinations:

  • If you Option-click a program's Dock icon, that program opens, but the Dock instantly hides the one you were using previously, along with all of its windows.

  • If you Option- [image] -click a program's Dock icon, that program opens, and the Dock hides the windows of all other running applications. This trick is a fantastic way to leap into one program—the Finder is a frequent candidate—and instantly get everything else out of your hair.

  • When you use this method, already-minimized windows vanish from the Dock altogether. (When you unhide a program, its minimized window icons reappear.) It's ideal when, say, you're surfing the Web and you've minimized 20 windows to the Dock; now if you hide the browser, you don't have to look at all that screen clutter until you want it back.

  • If you [image] -click any icon on the Dock, you jump to the Finder, where a folder window opens highlighting whatever you clicked on. You might use this technique when you want to back up a document or folder whose icon is on the Dock, and you don't want to sift through the whole hard drive to find it.

  • If you Control-click the divider bar that separates the two sides of the Dock, a menu appears (Figure 3-7).

Figure 3-7. The Dock's very own shortcut menu. It allows fast Dock setting changes for things like position, magnification, and minimization effect.

  • If you [image] -drag an icon onto the Dock, the existing Dock icons freeze in place. This simple modifier makes it much easier to drag and file things into existing Dock folders or program icons. Without the [image] modifier, the existing folders scoot aside in an attempt to make room for the new icon, as seen in Figure 3-8.

Figure 3-8. Oops—you missed the folder! The Dock folders tried to move aside to avoid accepting the new icon.

  • If you Option- [image] -drag a document's icon from the Finder or Dock onto a program's Dock icon, you force that program to open the document. This technique can be very useful when opening a file with a program that "thinks" it doesn't know how.

  • Consider a text file that you created in Terminal. If you drag such a document onto the Dock icon of BBEdit (a favorite text editor of programmers and Web designers), you ordinarily have no luck. The BBEdit icon doesn't darken since BBEdit believes it can't open Terminal text files. But if you hold down [image] -Option and then drag the file onto the icon, BBEdit will accept and open the dropped file.

  • You can use this method to force any application to try to open any type of document. Of course, the results can be unpredictable, so don't be surprised if, say, Terminal can't open a QuickTime movie! Although, if you've saved a JPEG image from a Web site, and you want to edit it in Photoshop, this is a handy move.

  • If you Control-click any program's or folder's Dock icon—or click an icon without any keys pressed and wait a moment—a list appears, detailing all of that program's open windows or the folder's contents. Choose a window's name on the list to jump directly to it (Figure 3-9).

Figure 3-9. When you open a window by Control-clicking a program's Dock icon, the other open windows in the program don't come forward. That's very different from bringing the entire program forward by clicking its Dock icon or switching to the program by pressing [image] -Tab.

  • If you bring up a program's shortcut menu, as described above, and then press Option, the menu's Quit item changes to say Force Quit. (While the shortcut menu is open, you can press and release Option freely, changing Force Quit to Quit and back again until you get bored.)

  • Force Quit, of course, is a command of last resort when you can't get a frozen program to respond. (Granted, you lose any unsaved changes in that program, but at least you force it to close.)

  • You can switch programs without touching the mouse by pressing [image] -Tab—a glorious keystroke well worth committing to memory. (See hints Section 4.1.5 and Section 4.1.6 for details.)

  • In combination with the [image] -Tab trick, you can also hide or quit any open program from the keyboard alone. Use [image] -Tab to flip to the program you want out of your face. While still holding [image], press H to hide the program and all of its windows, or press Q to quit it. (If you hide a program whose windows you've minimized to the Dock, those window icons also become hidden in the Dock.)

  • You can actually drag files and folders directly from the Dock just by holding down [image] and then dragging the icon. You can then release [image] and use the usual Finder shortcut keys: hold the Option key to make a copy at the destination location, or hold [image] and Option to create an alias.

This trick is more useful than you might think. If you have a file stored on the right side of the Dock that you want to attach to a new message in Mail, you can just [image] -drag the icon right into the message window. Alternatively, if you want to open a file on the right side of the Dock with a program on the left side, just [image] -drag the file's icon onto the program's icon.

  • You can hide the Dock completely whenever it suits you, either by choosing [image] [image] Dock [image] Turn Hiding On or, more conveniently, pressing Option- [image] -D.

3.2.2 Switching Applications While Dragging Icons

If you want to drag something from one program and drop it into another, you're in luck. Mac OS X lets you press [image] -Tab while dragging stuff, even while the mouse button is down.

Just grab the item you want to drag, press [image] -Tab until your desired program comes to the foreground, and then drop.

What's more, you can use keystrokes to control the target program. For example, if you want to drop a JPEG image into a brand new Word document, drag the JPEG file, hit [image] -Tab until Word comes up, and then hit [image] -N for a new Word document. Drop the JPEG into the fresh document window.

Unless you're a human octopus, you can only use keystroke combos you can reach with one hand since the other will be holding down the mouse button.

The only semi-exception is if you've got a laptop set to use Drag Lock. This way, you can tap your trackpad, press any key combinations you want with both hands, and then continue dragging with the trackpad.

3.2.3 Single-Window Minimization

The yellow button in the top-left corner of a window is the Minimize button, although it probably should be called the minuscule button. It's just too small to hit with the tip of your mouse when you're in a hurry.

That's why it's usually faster to just double-click a window's title bar, which minimizes a window equally as well as clicking the little yellow button. (Of course, you may find the keyboard shortcut, [image] -M, even easier.)

If, for some reason, you want to eliminate this useful double-click-to-minimize trick, just turn off the "Minimize when double clicking a window title bar" box in the Appearance pane of System Preferences.

3.2.4 Minimizing All Windows

In the previous hint, you learned to ignore the itsy bitsy teeny weenie yellow polka dot minimize button. On the other hand, when you want to minimize all of a program's open windows at once, ignore the ignoring; instead, just Option-click the Minimize button.

You can also option-double-click a window's title bar to minimize all open windows.

This trick is finicky since it works in most, but not all, programs (Word, for example, disregards it).

To maximize all shrunken windows from any Cocoa application, simply Option-click any one of the windows in the Dock.

How can you tell if the application is Cocoa or not? Just try this hint and see if it works!

3.2.5 Closing Minimized Windows

If you're using certain Carbon applications, such as the Finder, you can close minimized windows without first maximizing them (which you must do if you're still running Mac OS X 10.2 or older). Just Control-click the minimized window and select Close from the pop-up menu. If you don't see Close, then the application you're using is likely written in Cocoa, which doesn't yet support this handy feature.

3.2.6 Recovering from a MicroDock

What is a MicroDock? It's what you get when you try to store 355 JPEG files by dragging them onto a folder in the Dock, but you just miss the folder (thanks to its tendency to scoot aside). As a result, you drop all of the graphics directly onto the Dock. You can see a small portion of the result of such a mistake in Figure 3-10.

Figure 3-10. A MicroDock. Actual size. Not pretty.

Now you're faced with a serious problem: how to get the Dock back to normal. Sure, you could drag the icons off the Dock one at a time, but you'd spend two presidential administrations doing it. Quitting the Dock won't help, either. Because the icons are documents, not programs, they'll still be on the Dock when you restart it. If you're a true power user, you might even consider editing the com.apple.dock.plist file to delete the inadvertent documents by hand. Unfortunately, that's tedious and time-consuming, too.

In the end, you may be better off just wiping the Dock clean, restoring it to its original, virginal, Apple-installed condition—and then recustomizing it.

The easiest way to return to a normal Dock is to delete the Dock preferences file from your Home [image] Library [image] Preferences folder. The file is named com.apple.dock.plist, and you can just drag it into the Trash.

To restart the Dock, use Activity Monitor, as described in hint Section 3.1.6. When it restarts, you have the standard Apple Dock back.

Incidentally, if the fear of MicroDock keeps you awake at night, it might be worth backing up your current Dock configuration, especially if you've spent a lot of time customizing it with folders and applications. Backing it up is easy enough: Just copy that com.apple.dock.plist file to another folder. Then, if you're struck by MicroDock in the future, it's easy to replace the contaminated preferences file with your clean backup.

3.2.7 An AppleScript to Restart the Dock

If you tweak your Dock settings often, or if you just have occasional garden-variety Dock problems (stuck icons, unresponsiveness, and so on), you might find it worthwhile to create a simple AppleScript that restarts the Dock. (Yes, restarts—the Dock is actually a regular old Mac OS X program.)

To create such a script, open the Script Editor program (in your Applications [image] AppleScript folder). Then type this:

tell application "Dock"

 quit

end tell

Choose File [image] Save, change the File Format pop-up menu to Application, type a name for the script, and then save it somewhere for easy acess. (The Script folder described in hint Section 4.3.13 is a great location for it.) Now whenever you want to restart the Dock, just run your AppleScript!


3.3 Random Acts of Coolness

Sure, the Dock is useful, boosts your productivity, and so on, but if productivity were the only point of using a computer, we'd all be using DOS. Using the following techniques, you can express your inner coolness.

3.3.1 The Colored Poof

Each time you drag an icon off the Dock, you're treated to a little animated puff of white smoke. (Never say Apple didn't benefit from its $500 million investment in the Newton.)

But if that's all you want out of life, you're no better than the other downtrodden masses using Mac OS X. Why not use a colored puff of smoke instead?

This modification requires a graphics program that can edit PNG files—Photoshop, Photoshop Elements, or GraphicConverter, for example. It also requires some Terminal editing.

The first order of business is to create the new graphic that will serve as the replacements for the existing white poof. In a graphics program, create a file that's 128 pixels wide, 640 pixels high, 72 dpi, and has a transparent background. You're going to use this image template to create five images, each in a 128 128 pixel square.

If you're using Photoshop Elements, for example, create a grid with 128-pixel spacing (Preferences [image] Grid) and then make sure it's visible (View [image] Grid). Create each individual image so that it's centered within its own square. This step ensures a smooth animation in your custom poof. You can see a very simple example of a finished image in Figure 3-11.

Figure 3-11. This disappearing Aqua-blue star (trust us, it's blue) is about to become the Dock's new poof animation. You can work with layers, transparency, and so on, as you normally would; just make sure that each of the five images is located in exactly the same portion of its 128 128 cell as the others.

Once you've completed your masterpiece, choose File [image] Save As, and change the file format to PNG (no interlacing). Save the file somewhere that's easy to find, like your desktop, and name it something obvious like "newpoof.png."

At last, you're ready to begin the operating-system surgery:

  1. Open Terminal (Section P.3.5.3). At the prompt, type the following commands, pressing Enter after each:

    cd /System/Library/CoreServices/Dock.app/Contents/Resources

sudo cp poof.png poof_original.png

    Along the way, you'll be asked for your administrator's password.

    Once you've provided it, Terminal backs up the original file, just in case. (The cp command means copy; the text that follows it specifies which file to copy and what name to give the duplicate.)

  2. Type sudo cp and then a space. Drag the icon of your new poof off the desktop and directly into the Terminal window.

    That's a shortcut that saves you the trouble of typing out its specific "address" on your hard drive.

  3. Type a space, type poof.png, and then press Enter.

    You've just given your custom poof the correct name and then copied it over the old poof. You're nearly done.

  4. To activate your change, quit the Dock using Activity Monitor, as described in hint Section 3.1.6.

Test your poof by dragging an item out of the Dock.

If the Dock isn't working as you'd expect, or if you just want to return to the original poof, open Terminal, type the first line shown in step 1, press Enter, and then type sudo cp poof_original.png poof.png. When you press Enter, Terminal replaces your modified file with your backup. After restarting the Dock again, the familiar poof returns.

3.3.2 The Customized Trash Can

But why stop at changing the animated puff of smoke? If your graphic instincts are running rampant, you can replace your Dock Trash can, too (Figure 3-12).

To do so, follow the same steps in hint Section 3.3.1. In this case, however, the Dock Trash cans are 128 128 pixel images instead of 128 x 640, and you should use two images—one of a full Trash, another of an empty Trash—called trashfull.png and trashempty.png, both located in the same folder as in the previous hint.

To access the folder from the Finder, choose Go [image] Go to Folder, and type /System/Library/CoreServices/Dock.app/Contents/Resources. You can replace the existing Trash can icons by just dragging your own (correctly named) ones into this folder.

Figure 3-12. If you don't like Apple's rendition of the Trash cans, replacing two PNG files in the Dock's resource folder solves the problem.

You don't need to quit the Dock to see the new Trash cans; just emptying (or filling) the Trash should do the trick.

If, after rebooting, you find the old Trash cans have returned, look in your hard drive's Library [image] Caches folder for com.apple.dock.iconcache.username, and throw it away. This file contains a cached version of the old image, and it can cause the Dock to ignore your new versions.

3.3.3 Supersizing Magnified Dock Icons

This hint is wildly impractical but visually interesting nonetheless. By making a simple modification, you create gigantic Dock icons—something you've probably wanted since you were a teenager (Figure 3-13).

  1. In the Dock pane of System Preferences, turn on Magnification and drag the slider near the middle.

    Behind the scenes, you've just inserted a largesize command into the Dock's preferences file. More on that in a moment.

  2. Open your Home [image] Library [image] Preferences folder. Drag the com.apple.dock.plist document onto the icon of TextEdit, the word processor in your Applications folder.

    See Section P.3.5.2 for more on opening plist files in TextEdit.

  3. Near the top of the file, look for the word "largesize."

    In fact, you should see a couple of lines that look like this:

    <key>largesize</key>

<real>92.26524233</real>

    (The number in the second row may not match what you see here.)

    If you don't see a "largesize" line, click at the end of the first <dict> line in the text file (about four lines into the file), press Return, and then type the two lines exactly as shown above, beginning with <key>largesize</key> and pressing Return after each line.

  4. To supersize the magnification, change the number after <real> to something larger. Try 256 as a starting point.

    Fun though it might be to try, don't exceed 512. The Dock won't run, and you might burst open the edges of your monitor.

  5. Close and Save the file.

    Return to the Finder.

  6. To trigger your change, quit the Dock as described in hint Section 3.1.6.

Figure 3-13. Because the system only "knows about" icons up to 128 pixels, it must take an educated guess regarding what they should look like at larger sizes. Therefore, the icons may appear a bit fuzzy.

If you use the Dock's preference pane to adjust the magnification value later, you lose your supersize icons. This, actually, is the easiest way to return to a normally magnified Dock.

3.3.4 Minimizing and Maximizing in Slow Motion

This hint does nothing whatsoever for your productivity—in fact, it detracts from it. But isn't that the real secret to happiness?

In any case, making windows shrink to Dock icons in super-slow motion is one of the favorite onstage demonstrations of Apple CEO Steve Jobs. And how does he do it? He presses Shift before clicking the yellow Minimize button in any window.

The same holds true for expanding a minimized window: hold Shift before you click the window icon in the Dock, and it comes back to life slower than a replay of Barry Bonds jacking a baseball into McCovey Cove. As a general rule, you can try using Shift with any window action in most applications; it'll usually result in some sort of slow motion effect. (Try it when activating a panel in System Preferences, for instance.)

For maximum "wow" factor, try this trick with a QuickTime movie while it's playing. Note with amazement that it keeps on rolling during slo-mo minimization. It also continues playing while minimized in the Dock, perfect for impressing your friends and making new ones.

3.3.5 Killing the Dock

So you're a Mac OS X fan who loves the system but hates the Dock. How can you rectify this situation? Easy...kill the Dock!

To perform this little software assassination, open Terminal (in your Applications [image] Utilities folder), and at the prompt, type the following (press Enter after each line):

cd /System/Library/CoreServices

sudo mv Dock.app ~/Documents/Dock.app

The first command switches Terminal's attention to the folder that contains the Dock, and the second moves it into your Documents folder as a backup.

The next time you log in, you'll find that the Dock is gone. (For best results, of course, use some other Dock-like program—maybe a shareware program like DragThing or LaunchBar—to help you open your favorite files and programs. After all, you'll no longer have the Dock to kick around.)

If you ever want the Dock back, open a Terminal and type sudo mv ~/Documents/Dock.app /System/Library/CoreServices/Dock.app followed by the Enter key. Lastly, log out and log in again. The Dock will now occupy its usual spot.


Chapter 4. Programs

For the longest time, the success of Mac OS X was up in the air. It all boiled down to one thing: programs. Without applications, no operating system can survive, and for most people, switching to Mac OS X meant having to buy all new, Mac OS X-compatible programs.

Fortunately, the tide has turned at last. All of the big-name programs have finally been made over in the Mac OS X mold, and thousands of smaller, lesser-known programs are sprouting up to make this operating system more interesting, useful, and fun.

All you need to do now is figure out how to use them.


4.1 Managing Programs

As you start using all your marvelous Mac OS X programs, you could find yourself spending more time sifting through open windows than breathing. The following hints can help you manage the window glut. (Also be sure to read the Exposé hints section of this chapter, where you'll learn to master the hidden tricks of Panther's new window management tool.)

4.1.1 Hide Others I

If there are a lot of open windows cluttering your screen, you can minimize them individually to the Dock as a housekeeping measure. Hiding them one by one, however, takes a lot of time that would be better spent playing Bugdom, for example.

It's easier to use the Hide Others command, which appears in each program's Application menu (the boldfaced menu that bears its name). Choosing Hide Others instantly hides the windows of all programs except the one you're currently using—an especially likeable trick if your program offers the semi-standard Option- [image] -H keyboard equivalent.

Hiding other programs isn't the same thing as quitting them (which takes time) or even minimizing their windows (which entails a good deal of clicking to bring them back later). It's simply an invisibility mode unto itself.

4.1.2 Hide Others II

Alas, not every program offers the Option- [image] -H keyboard shortcut, and in those situations, mousing up to the Hide Others command is a lot of trouble.

Fortunately, that shortcut has a shortcut of its own: rather than using the Hide Others command, you may find it faster simply to Option- [image] -click the Dock icon of the program you want to keep around. (Option- [image] -clicking the icon for the Finder is an especially useful tactic.) All other programs make themselves scarce.

Shareware launcher programs like DragThing (www.dragthing.com) can also perform this "other program hiding" service automatically every time you switch programs.

4.1.3 Hide Others III

If you're still not convinced of the benefits of hiding applications (see the previous two hints), consider this fact: hidden applications demand considerably less CPU power than visible applications. It's especially true for programs that perform a lot of window updating, such as iMovie (when it's rendering), Safari (when you're downloading), and iDVD (when it's showing motion menus).

However, there's a program you should nearly always hide: Software Update. When it has just downloaded an update and reached the "optimizing" stage, the Software Update window can use up to 50 percent of your computer's processor speed. The next time you install an update, then, try hiding the Software Update application—the entire installation process should go significantly faster.

4.1.4 Leave Your Programs Open

This tip may sound like heresy to old-time Mac mavens, but here it is: get into the habit of opening your most-used programs and leaving them open forever. Most open programs in Mac OS X don't occupy much memory or use up much of your processor's attention, especially when they're in the background. Sure, there are a few exceptionally memory-hungry programs (Microsoft Word comes to mind), but most sit just nicely in the background, awaiting your next command (see Figure 4-1).

If you plan to leave numerous programs open, it's best to make sure you've got more than the Apple-mandated 128 MB of RAM. See the sidebar on Sidebar 1.2 for details.

Figure 4-1. This Dock (shown here split to fit) depicts a workload of open applications, including some major programs like Photoshop Elements, Microsoft Word and Excel, iPhoto, and Keynote. In a lesser operating system, this scenario would be a recipe for crash soufflé; in Mac OS X, it just means you've learned to stop fearing system instability and are focused on getting your work done.

Learning to leave programs running is part of the adjustment that Mac OS 9 devotees make in adapting to Mac OS X. In the bad old days, many folks' Mac OS 9 workflow involved opening a program, doing what needed to be done, saving the file, and quitting the application.

No longer. In Mac OS X, individual programs do crash (rarely), but they don't sabotage your entire computer in the process. In fact, Apple's engineers are so proud of this improvement, they actually point it out when an application does crash (see Figure 4-2).

Figure 4-2. In Mac OS X, the system goes out of its way to tell you that, even though an application just crashed, your system is fine and there's no need to restart or worry about lost data in other applications.

4.1.5 Switching Programs

Although the Dock provides an easy way to switch among open programs (by clicking their icons), there are two reasons why you might use the keyboard combination [image] -Tab instead. First, the true efficiency expert grows to detest the time it takes to remove his hands from the keyboard to grab the mouse and click a Dock icon. Second, if you leave multiple programs running, it can be hard to find the Dock icon you want.

When you press [image] -Tab, an attractive semi-transparent application switcher pops onto the screen, as seen in Figure 4-3.

Figure 4-3. To switch programs without using the Dock, press [image] -Tab to display this handy application switcher. Keep [image] pressed, and then use Tab and ` (next to the 1 key) to cycle forward and backward through the list.

The switcher will stay onscreen as long as you hold down [image]. From here on, there are a number of actions you can take:

  • While still holding [image], press Tab and ` (next to the 1 key) to cycle forward and backward through the list of running programs. Release [image] when the program you wish to switch to is highlighted.

  • Move your mouse's scroll wheel up and down to scroll across the list of running programs. Release [image] when the program you wish to switch to is highlighted.

  • Move your mouse over the program you want to bring forward, and click the mouse button to activate it.

  • With any program highlighted, press H to hide all of its windows.

  • With any program highlighted, press Q to quit it.

You can also use the [image] -Tab application switcher with Exposé, Apple's new screen organization tool. (See Section 4.2 for the corresponding hints.)

4.1.6 Bouncing Between Two Programs

The best part of the [image] -Tab trick is that a single press of [image] -Tab takes you to the program you used most recently, and then another single press returns you to the program you started in. Imagine that, for example, you're often switching between two programs—your Web browser and your word processor, for example. Well, with the [image] -Tab method, if you have five other programs open, you won't be wasting your time [image] -Tabbing your way through all open programs just to "get back" to your Web browser.

4.1.7 Prevent Accidental Window Closure

If you use keyboard shortcuts a lot, chances are you've accidentally hit [image] -W for the wrong program a few times. For instance, if you browse the Web and use iChat at the same time, you may lose track of which window is active and accidentally close the wrong one.

Using Mac OS X 10.3's ability to create new keyboard shortcuts, though, you can easily prevent such unwanted window closures—and not just in iChat and Safari. To do so, you redefine the keyboard shortcut for the Close command to something you're less likely to hit accidentally. Assuming you're interested in changing the shortcut for iChat, here's what you do:

  1. Quit iChat if it's running.

    Although this step isn't strictly necessary, it's always a good idea to make sure a program you're modifying isn't running.

  2. Open System Preferences [image] Keyboard [image] & Mouse [image] > Keyboard Shortcuts tab.

    While you may know that this feature can be used to create new keyboard shortcuts, you may not know that it can also be used to redefine existing shortcuts. That's the trick you'll use to protect your iChat windows from accidental closure.

  3. Click the plus sign in the lower-left part of the window to add a new keyboard shortcut.

    Select iChat from the pop-up menu at the top of the dialog box.

    If you leave the All Applications setting instead, Mac OS X will redefine the keystroke for every program, not just iChat.

  4. Type "Close" in the Menu Title box. Then click in the Keyboard Shortcut box and press Shift- [image] -W to define your new keystroke.

    At this point, the dialog box should look like Figure 4-4. Click Add to save your changes.

When you launch iChat the next time, the File [image] Close menu item will display the Shift- [image] -W shortcut that you created. You can use this same trick with any application, as well as with nearly any menu item. (Just make sure you know the exact spelling of the menu item within the program—some may use Close Window instead of just Close.) For example, you could reassign [image] -Q (Quit) to Shift- [image] -Q in programs that you'd like to leave running all of the time. There, no more accidental quitting!

Unfortunately, not every program will accept customized shortcuts. The Keyboard Shortcuts pane, though, will alert you if you choose a non-customizable application (such as Photoshop Elements).

Figure 4-4. If you want the new Close shortcut to be [image] -Shift-W, this is what the dialog box should look like. You can set the shortcut to whatever you want, though—it doesn't need to include the [image] key. If you often find yourself choosing Font Styles in TextEdit, for example, you might want to assign the F8 key as its shortcut.


4.2 Exposé

Exposé is a window-management tool built-in to Mac OS X 10.3. With the press of a key (or the click of a mouse), your open windows magically arrange themselves onscreen, making it easy to find just the one you want. Or they fly off to the edges of the screen, making it easy to work with files on your desktop. Exposé is one of those technologies that, after you use it a few times, make you wonder how you got along without it. Here are some hints to help you maximize this powerful feature.

4.2.1 Fun with the Floating Desktop Blob

The standard method of activating Exposé is to use the keyboard: F9 to shrink all onscreen windows; F10 to show the current application's windows; and F11 to show the desktop. However, there's an alternative, hidden method of using at least two of Exposé's modes: the "Floating Exposé Blob." As shown in Figure 4-5, the floating blob is a translucent gelatinous globule that hovers over all your open windows.

Figure 4-5. Top: Most of the time, the Floating Exposé Blob is partially transparent, so you can see what's underneath it.

To activate the blob, you first must make a quick visit to Terminal, found in Applications [image] Utilities. Type the following line, then hit Enter:

defaults write com.apple.dock wvous-floater -bool true

For this change to take effect, you'll need to quit and restart the Dock. You can do so in the Terminal by typing killall dock. As soon as the Dock restarts, you should see The Blob. As explained in Figure 4-5, you can activate a couple of Exposé modes via the blob (and for real fun, add the Shift key to either sequence to watch the fun in slow motion).

You can drag the blob around onscreen, too. To make it vanish entirely, just repeat the above command in Terminal replacing "true" with "false."

4.2.2 Change Exposé's Show Desktop Behavior

When you use Exposé's Show Desktop key (F11), all open windows fly off to the edges of the screen, leaving only a thin border to let you know they're out there. But there's a hidden Show Desktop mode that shrinks your open windows in plain sight, as seen in Figure 4-6.

This hint has been reported, in a few cases, to cause a system crash. Additionally, the area used by the small window is unusable by any other application, even when you can't see the small window!

To turn on this hide-in-plain-sight mode, open Terminal (in Applications [image] Utilities) and type:

defaults write com.apple.dock wvous-olddesktop -bool false

Hit Enter when you're done typing, then type killall dock (and hit Enter again), to make the change take effect by restarting the Dock.

If you hit F11 now, all your windows minimize into the small window, as seen in Figure 4-6. You can drag and drop this window anywhere you like; click it to exit Exposé's Show Desktop mode.

Figure 4-6. When you put Exposé in its alternate Show Desktop mode, all of your windows are "hidden" in one small window on your desktop. You can freely move this window around anywhere you like. However, the space taken up by the small window is unusable by any application; mouse clicks won't register in this region, for instance.

4.2.3 See Exposé Effects in Slow Motion

To view any Exposé effect in slow motion, just press and hold the Shift key while pressing F9, F10, or F11. If you have a ton of open windows, a slow motion activation of All Windows mode (Shift-F9) is most impressive. For an even better demo, hold down Shift when you hit F9 again to watch the windows grow back to full size in slow motion.

4.2.4 Activate Exposé with a Multi-Button Mouse

If you have a multi-button mouse, you can make Exposé even easier to use by assigning its various modes to the extra buttons on your mouse. Start by visiting the Mouse section of the Exposé System Preferences panel. You'll only see this section if you have a multi-button mouse plugged into your Mac. As illustrated in Figure 4-7, you can use the pop-up menus to assign each Exposé action to a mouse button.

You may find, however, that setting these values has no effect on Exposé—it just ignores your button clicks. If that's the case, your mouse's driver software is probably overriding the settings in the Exposé preferences panel. To work around this dilemma, you'll need to use the program that came with your mouse to set the mouse buttons to imitate F9, F10, and F11.

You may have to set the Exposé keyboard shortcuts to something different (like Option-Shift-F9) before attempting to customize your mouse buttons. Then, once you've successfully customized your mouse buttons to imitate the original keyboard shortcuts (F9, F10, and F11), return to System Preferences and set the Exposé keyboard shortcuts back to their original values. This procedure prevents you from accidentally activating Exposé while trying to customize your mouse.

Figure 4-7. Use the Mouse section of the Exposé System Preferences panel to assign the Exposé activation keys to your extra mouse buttons.

4.2.5 Use Exposé in Two Different Modes

Did you know Exposé actually has two completely different modes of operation? The most-used mode is the "sticky mode," which is what you get when you press and release the Exposé activation keys (F9, F10, F11). In this mode, you press a key once to activate Exposé, and press it again to deactivate it.

On the other hand, if you press and hold a shortcut key, Exposé enters "temporary mode." In this mode, the Exposé effect goes away as soon as you release the key.

With this ploy, you can just press and hold F11 to get a glimpse at what's on your desktop, and then release F11 and return to what you were doing. In either of the window-shrinking modes, though, this trick demonstrates its real power: press and hold F9 or F10, then move your mouse to your desired window, and then release the key. Presto! Mac OS X immediately brings that window forward, switching programs if necessary.

This hint becomes even more useful if you use the Exposé mouse-button trick (see hint Section 4.2.4). That way, you can switch applications with just the mouse: press and hold the button you've assigned to F9, mouse over a window to make it active, then release the button to switch right to it. It's an amazingly efficient way to switch programs, with the added bonus of letting you choose any open window in the destination application.

4.2.6 Move Hidden Files into Hidden Windows

So you've been working very hard on a complex project all day, and you've got about 15 different Finder windows open, along with 20 other applications, each with two or three of its own windows. Then you realize that you need to move the Project Summary document you saved on your desktop into your Project Daedalus folder, which is somewhere among your open Finder windows. Before Exposé, this simple task would require quite a bit of clicking, dragging, and window positioning to make the icon and folder visible at the same time.

With Exposé, though, it's a much simpler process. Hit F11 to shove all the open windows off the edge of the screen and reveal the desktop. Click and hold the icon you want to move (Project Summary, in this example), and hit F9 to activate Exposé's "Show All Windows" mode—just don't let go of the mouse button yet!

Now drag your icon into the Finder window where you'd like to file the document, and (still holding the mouse button down) hit F9 again. This activates the chosen Finder window, zooming it back to full size. Release the file when it's in the right folder (or subfolder), and you're done—no window resizing or moving required. Here lies the real power of Exposé: the ability to manage open windows and documents without having to move or resize them.

4.2.7 Create Text Clippings via Exposé

Want an easy way to save a headline or text snippet from a Web browser or other program? Highlight the text and begin to drag it. As you do, hit F9 to reveal all windows, and then move the mouse over a Finder window. After a second or two, the window will flash and jump forward, just like a spring-loaded folder (Section 2.5.7). Drop the selection in the Finder window, and you have yourself a new text clipping.

Of course, you don't have to create text clippings; you can use this same technique to drag snippets of text into Word, Stickies, or any other program that accepts them.

4.2.8 Show One Window at a Time

Have you ever wanted to have just one window onscreen, with all the others hidden? Using Exposé's Show Desktop key (F11), this dream can become a reality. First, switch to the application with the window you'd like to isolate—Safari, for instance. In Safari, minimize the window to the Dock (hit [image] -M). Then hit F11 to send every onscreen window sliding off the edges of the screen. Finally, click the minimized window to bring it back to the foreground; the hidden windows remain hidden, lurking just off the edges of your desktop.

To get them back, either click another application in the Dock or just press F11 again. All other windows slide in neatly behind the current one.

4.2.9 Use Exposé and -Tab Together

You might think that once you've activated Exposé, there wouldn't be much use for [image] -Tab, the application-switching keystroke. Mixing these two techniques, however, is a powerful tool for window navigation.

In both All Windows (F9) and Application Windows (F10) Exposé modes, you can hit [image] -Tab to bring up the application switcher (hint Section 4.1.5). When you [image] -Tab to an application, it becomes active—but Exposé stays in Application Windows mode. In other words, you see all of that program's windows highlighted, yours for the clicking.

When you click a window, it becomes the active window, and all of that program's other windows slide into place behind it.

Here are some other tricks that combine Exposé and the application switcher:

  • If you press Tab instead of [image] -Tab after activating Exposé, you'll cycle through the applications but keep the typical onscreen switcher hidden. Shift-Tab cycles backwards in this mode.

  • If you'd rather keep your hands on the keyboard while using Exposé, you can select a window by using the arrow keys instead of the mouse.


4.3 General Productivity

Once you've tweaked your machine to suit your style, you can use these hints to increase your efficiency.

4.3.1 Open and Save Dialog Boxes

The Open and Save dialog boxes offer an ingenious column-view look at your entire hard drive, making it easy for you to choose a folder for opening or saving a document. Trouble is, the dialog box appears with all the majesty of a peanut floating in the middle of your screen. It's just too small—and there's no reason it should be that way.

Fortunately, Mac OS X lets you expand these dialog boxes and even remembers the size you like. Now the next time you open or save something in that program—even if you restart the program—the dialog box remains your preferred size.

Simply follow the directions in Figure 4-8.

4.3.2 Shortcuts in Open and Save Dialog Boxes

When you bring up an Open or Save dialog box in Mac OS X, you can click various columns, folders, and pop-up menus to navigate your system.

It's often much faster, though, if you tell the dialog box, "Look here!" and shove the icon you want under its nose, by dragging a file or folder directly into the dialog box, as shown in Figure 4-9.

To navigate directly to your desktop folder from an Open or Save dialog box, the Hide All Windows Exposé trick (hint Section 4.2.2) can be a handy timesaver. Once you reveal the desktop, just begin dragging the icon you want, press the keyboard shortcut to turn off Exposé, and drop the icon right into the dialog box.

Figure 4-8. Top: To make a program's Open and Save dialog boxes easier to use, click the lone triangle to the right of the Save As label.

4.3.3 Jump to Any Folder from the Save As Dialog Box

When using Save As, you can quickly jump to any folder on your system by hitting the / key. When your press this key, a "Go to the Folder" dialog box pops up, allowing you to type the path to your destination.

Why type when you can click the mouse? One word: speed! If you're several layers deep in your hard drive, hit /, type /Users/chris (where "chris" is your short user name) and hit Return. Instantly, you're back to your Home folder.

This technique also works for Open dialog boxes, but not for all Save boxes.

Figure 4-9. If you're looking for a buried icon, it's often easier to find it in the Finder than to navigate to it using this dialog box. Once you've found a file or folder you want, drag it off the desktop and into the main portion of the dialog box, thus making it the highlighted selection.

4.3.4 Folder-Jumping Keyboard Shortcuts in Save Dialog Boxes

Just like in the Finder, you can use keyboard shortcuts to jump to certain folders in Open and Save dialog boxes. In general, you hold down Shift- [image] and the first letter of the folder you want to jump to—Shift- [image] -A for Applications, Shift- [image] -D for Desktop, and so on. The only shortcut that doesn't work in dialog boxes but does work in the Finder's Go menu, in fact, is Shift- [image] -U for the Utilities folder.

4.3.5 Other Save and Open Keystrokes

Besides the keyboard shortcuts listed in hints Section 4.3.3 and Section 4.3.4, there are a few others that can improve your Save and Open dialog box efficiency:

  • Return or Enter "clicks" the blue, pulsing button (usually Save or Open).

  • The Esc key (or [image] -period) "clicks" Cancel to close the dialog box.

  • The [image] -[ and [image] -] combinations navigate you back and forward to items you've already seen, just as in Safari or the Finder.

  • -2 switches to list view, revealing additional data for each file—just like List view in the Finder.

  • -3 switches to column view, revealing a hierarchical list of a folder's parent folders. (This is the standard view for Open and Save dialog boxes.)

4.3.6 Jump to the Top or Bottom of Menus and Lists

If you're navigating via the keyboard, you probably already know you can type the first few letters of an item in a menu or pop-up list to jump directly to it. But what if you're viewing a really long menu and need to quickly reach the top or bottom? Simply hold Option and press the up or down arrow, and you'll instantly jump to the top or bottom end of the menu, respectively.

This little trick works nearly everywhere—in shortcut menu pop-ups, in Recent Item listings, in Web site pop-up menus, and in the menu bar, too.

4.3.7 Scroll Either Direction with One Mouse Click

If you think your mouse has a limited number of clicks in its lifetime, here's a nifty click-saving trick for whenever you're scrolling up and down in a document: simply click and hold the mouse button on one of the two vertical scroll arrows. As expected, the document will begin to scroll. Now move the mouse (while still holding the button down) onto the arrow for the opposite direction, and the document will start scrolling in the new direction.

This trick works best if you've used the Appearance pane in System Preferences to set the scroll arrows to appear together (in the "Place scroll arrows" section). Otherwise, you'll have to drag your mouse from one end of the scroll bar to the other.

This trick only works when moving within one scroll bar; you can't use it, for example, to move from the vertical to the horizontal scroll bar.

4.3.8 Speed Up the Display of Sheets

Sheets are a wonderful feature of Mac OS X that keep dialog boxes associated with their respective windows. The Save and Open sheets are the most familiar, but there are many more. The Add Bookmark command in Safari, for instance, is a sheet. So is the Don't Save/Cancel/Save dialog box that appears when you try to close a document with unsaved changes in TextEdit, as well as the Save As sheet in Word 2004. Basically, anytime you see a dialog box drop down from a window's title bar, you're looking at a sheet.

UP TO SPEED Peace of Sheet

In Mac OS X, the Save dialog box is actually often a save sheet—a panel that slides down from a file's title bar so you can name and choose a location for the file you're saving. Unlike the normal dialog box, a sheet remains attached to its document, even if you switch into other programs or other windows within the same program. That way, you never get confused about which document you're trying to save.

If you're like most people, much of your work entails creating documents, so you're likely to encounter sheets over and over again. Fortunately, all the tricks that work in a normal, non-sheet Save dialog box also work in a Save sheet. The same goes for Save As and Open sheets, too.

As you may have noticed, sheets are displayed with a nice smooth scrolling animation as they drop into place. As you also may have noticed, the animation is quite slow.

Luckily for you and your productivity, there's a hidden preference that controls the speed of sheet animation. Open Terminal (in Applications [image] Utilities) and type:

defaults write NSGlobalDomain NSWindowResizeTime 0.001

This nerdy-looking command is the Unix method of setting preferences. In this particular case, you're setting a preference (the "defaults write" bit) for all applications (the "NSGlobalDomain" piece). The particular preference you're setting is called "NSWindowResizeTime," to which you're assigning a value of .001. So what does it do?

The NSWindowResizeTime controls the speed with which sheets animate into existence. This value starts out set to 0.2, which represents two-tenths of a second for each 150 pixels of resizing. You've just set it to one one-thousandth of a second per 150 pixels, which is exactly 200 times faster than usual.

To see the change take effect, you'll have to quit and relaunch any applications that were running when you executed the command. To witness the dramatic impact you've just made, launch TextEdit and type a few letters in the blank document that appears, then select File [image] Save As. Instead of leisurely rolling into existence, the Save As sheet now simply appears—and disappears when you're done with it.

If you enjoy torturing yourself and wish to return to the original behavior, open the Terminal again and type:

defaults delete NSGlobalDomain NSWindowResizeTime

This code deletes the preference you created, and all applications (after relaunching, of course) will return to the original 0.2 second sheet speed.

If you're ever in need of an April Fools' Day prank, try customizing this setting on a friend's computer—but make the resize setting 20 instead of 0.2. Then watch him writhe in his seat as he agonizingly waits minutes for sheets to slowly crawl out.

4.3.9 Is that Document Saved?

The Close button (the red upper-left button of every window) is more than a button—it's also an indicator. When you save the document you're working on, it's solid red, as shown in Figure 4-10 at left. If you make changes but haven't yet chosen the File [image] Save command, the button sprouts a small dot at its center (Figure 4-10, right). That's a handy reminder that your document needs saving.

This indicator works in most programs, but not all. AppleWorks is a notable exception.

Figure 4-10. Left: A button with no dot in the center indicates all changes have been saved.

4.3.10 Creating PDF Files

No doubt you've had the unnerving experience of receiving an email from a friend with a note saying, "You're the one person on the planet who would really appreciate the attached." And then the file opens revealing 43 pages of gibberish.

This sort of annoyance could have been avoided if your friend had sent you the document as a Portable Document Format (PDF) file, which you can read using the free Acrobat Reader program (Figure 4-11) or Mac OS X's Preview program.

Figure 4-11. This trick once required the $250 Adobe Acrobat Distiller program. You can now create a PDF file from any document in almost any program.

PDF files have a number of advantages over standard document files. For example, when you distribute PDF files to other people, they see precisely the same fonts, colors, page design, and other elements that you included in your original document, even if they don't have the fonts or the software you used to create the document. In fact, print shops like Kinko's often require you to submit PDFs since they may not have all 263 fonts you used on your band's latest flyer.

Many a software manual, Read Me file, and downloadable "white paper" comes in this format. But PDF files are also one of Mac OS X's common forms of currency. In fact, you can turn any document (in any program with a Print command) into a PDF file. With the file open, just choose File [image] Print, and then click Save as PDF.

PDF files are particularly useful for saving information on Web sites. If you find a Web page you'd like to keep, simply save it as a PDF file. You'll have a permanent record of the text and images on the page, making it a convenient way to preserve online shopping receipts and travel confirmations. (The links on the page, however, won't work.)

4.3.11 Creating a Software Library

If you download and use lots of demos, freeware, and shareware from the Web, consider creating a software installation library: a collection of folders that makes it easier to reinstall things you've downloaded without having to download them again. Then, if you get a new computer, install a new hard drive, or need to reinstall Mac OS X, you'll have an easy way of finding the programs.

Create a folder on a hard drive or partition with lots of space. Then create alphabetic subfolders within the main folder, as shown in Figure 4-12. When you download an update or installer, drag it into the proper alphabetic folder.

You may wish to create a special Apple folder to hold system updates and Apple-supplied applications.

This arrangement is even better with the help of folder actions (hint Section 2.5.12). Under this scenario, you can drop a file into the main folder and have it automatically filed into the appropriate subfolder.

Figure 4-12. By establishing a folder of alphabetic subfolders, you can keep downloaded installers easily accessible at any time. If you've ever downloaded a 100-megabyte demo more than one time, you'll quickly appreciate having a library of installers readily available.

4.3.12 Dragging and Dropping Text

The ability to drag and drop text has been around in the Mac OS for years largely because it's a terrific way to rearrange words, sentences, or paragraphs without having to copy and paste. But many Mac fans panic when they discover that it no longer seems to work in Mac OS X.

The truth is, text drag-and-drop is still available in Mac OS X—but in many programs, there's a trick to it. How you drag and drop text depends on which kind of program you're using at the time: Carbon or Cocoa (Sidebar 4.2).

  • Carbon programs. In Carbon applications, drag-and-drop works as it always has: after selecting some text, position your cursor within the highlighted area and then drag it to a new spot in the word processing document (or even another word processing document).

  • Cocoa programs. You must keep the mouse pressed within the highlighted text for nearly a full second before you can drag it. If you don't wait long enough, the drag won't work.

4.3.13 The Script Menu

AppleScript is a simple language that lets you devise mini-programs to perform certain tasks. For instance, you could write an AppleScript to tell iTunes to play "I Love Rock 'n Roll" at 8:03 every morning. Or you could use an AppleScript to send an email every three hours to your co-workers telling them how many shopping days are left until Christmas. (There are plenty of frivolous uses for AppleScript, too.)

Mac OS X comes with a handful of ready-made AppleScripts, including one that checks the current temperature in your area code and one that lets you count messages in all your mailboxes.

Most Mac fans never even know they exist, however, since they're buried in the Application [image] AppleScript [image] Example Scripts folder. Fortunately, they're also listed in something called the Script Menu—an icon on your menu bar that puts AppleScripts at your fingertips. To make it appear, open your Applications [image] AppleScript folder and double-click the Install Script Menu icon (see Figure 4-13).

Some of the scripts in the Script menu operate on familiar components of the Mac OS, like the Finder, while others show off applications or features that are new in Mac OS X. Below is a listing of some of the most useful scripts.

4.3.13.1 Address Book scripts

Import Addresses lets you transport your old address book from a program like Claris Emailer or Outlook Express into the new, shiny Mac OS X Address Book (Section 11.1). The Helper Scripts are run automatically, so you never have to click them yourself.

4.3.13.2 Finder scripts

As the name would suggest, all of these scripts work with the Finder—manipulating files and windows, for example. Several are designed to change file or folder names en masse, which can be a huge timesaver. Here are some especially useful scripts:

  • Add to File Names, Add to Folder Names effectively tacks on a prefix or suffix to the name of every icon in the frontmost Finder window (or, if no windows are open, on the desktop). You could use this script to add the word draft or final or old to all of the files in a certain folder, for example.

Figure 4-13. After double-clicking Install Script Menu, a new icon appears in your menu bar. You've just revealed the Script Menu, which lists dozens of useful AppleScript mini-programs.

  • Change Case of Item Names offers to capitalize, or uncapitalize, all the letters of the file names in the window before you.

  • Finder Windows - Hide All minimizes all open Finder windows to the Dock. Finder Windows - Show All, of course, brings them back from the Dock.

  • Replace Text in Item Names lets you conduct a search-and-replace of text bits inside file names, folder names, or both. When one publisher rejects your 45-chapter book proposal, you can use this script to change all 45 chapter files from, say, "A History of Mouse Pads—A Proposal for Random House, Chapter 1" to "A History of Mouse Pads—A Proposal for Simon & Schuster, Chapter 1."

  • Switch to Finder brings the Finder to the front and hides all of the other running applications. (For the record, the same thing can be accomplished by Option- [image] -clicking the Finder's icon in the Dock.)

4.3.13.3 Folder actions

You can read about folder actions in hint Section 2.5.12.

4.3.13.4 Info scripts

  • Current Date & Time displays (you guessed it!) the current date and time in a dialog box, along with a Clipboard button that copies the information, ready for pasting.

  • Font Sampler is designed to show you what all your fonts look like (see Figure 4-14).

Figure 4-14. The Font Sampler script launches TextEdit, opens a new document, and fills it with dozens of copies of the classic "What does this font look like?" test sentence: The quick brown fox jumped over the lazy dog. Then, as you watch, it formats each line with a different font, creating a page to print out and keep as a reference.

4.3.13.5 Internet services

  • Stock Quote and Current Temperature by Zip Code fetch those respective bits of information, displaying the results in a dialog box without you having to use a Web browser.

Don't rely on the stock quotes provided by this script. Although the quotes are usually accurate, they are generally delayed 15-20 minutes.

4.3.13.6 Mail scripts

This collection of scripts communicates with Mail (see Chapter 7).

  • Count Messages in All Mailboxes counts all messages and unread messages in all of your mailboxes and displays the result.

  • Crazy Message Text is Apple at its wackiest. When you run it, a dialog box asks what message you want to send ("Happy Birthday," for example). Mail then creates a colorful, zany, outgoing message in which each letter has a random typeface, style, color, and size. It's ideal for making people think you spent a long time with your Format menu solely for their entertainment.

  • Create New Message walks you through the creation of a new message including the recipient, sender, attachments, subject, and so on. This script saves you a step if the Mail program isn't already open and active.

4.3.13.7 Sherlock scripts

The sole script here, Search Internet, prompts you for a search string (the words you want to search the Web for). When you click Search, the script opens Sherlock and runs your search. It may save you a few mouse clicks, but this script was likely designed primarily to serve as a study model by scripting hopefuls.

It's worth noting, too, that the Script menu is nothing more than a reflection of what's in these two special folders:

  • Library [image] Scripts. Here's where you'll find all of Apple's starter scripts as described above. If you feel inspired to rename any of the commands or subcommands in the Script menu, these are the files whose names you want to edit.

  • Home [image] Library [image] Scripts. (If you don't have this folder, open your Home [image] Library folder and create it yourself.) If you become an AppleScript fan and write little programs of your own, you can drop them into this folder to make them appear in the Script menu.

  • In fact, if you create a folder within the Scripts folder, you get a submenu in the Script menu, just like the ones Apple put there. (Scripts and folders in the Library [image] Scripts folder appear at the top of the menu; scripts in your Home [image] Library [image] Scripts folder appear beneath them.)

Although it might seem strange, you can also put non-scripts in these folders. If you put a file or alias in either one, it will also appear in the Script Menu. Using this trick, you can turn the Script Menu into a mini-launcher for applications and files, right in the menu bar.

4.3.14 Capturing Screenshots

Screenshots are "snapshots" of a frozen moment in Macintosh time, a graphic image of the screen. Screenshots are very useful for showing somebody else an error message you've received, flaunting a neat desktop you've created, or illustrating a book of Macintosh hints.

Here's how to capture:

  • The whole screen. Press Shift- [image] -3 to create a picture file on your desktop, in PDF format (hint Section 4.3.10), of your entire screen. A satisfying camera-shutter sound tells you that you were successful. You'll find the resulting file on your desktop, with the name Picture 1.

  • Each time you press Shift- [image] -3, you get another file, called Picture 2, Picture 3, and so on.

UP TO SPEED Three Kinds of Programs: Cocoa, Carbon, Classic

Mac OS X was supposed to make life simpler. It was supposed to eliminate the confusion and complexity that the old Mac OS had accumulated over the years and replace it with a smooth, simple, solid system.

Five years from now, that's exactly what Mac OS X will be. For the moment, however, you're stuck with running three different kinds of programs, each with their own characteristics: Cocoa, Carbon, and Classic.

The explanation involves a little bit of history and a little bit of logic. To take full advantage of Mac OS X's considerable technical benefits, software companies must write new programs for it from scratch. So what should Apple do? Send an email to the authors of the 18,000 existing Mac programs suggesting that they discard their programs and rewrite them from the bottom up?

At big companies like Microsoft and Adobe, such a suggestion would wind up on the Joke of the Week bulletin board.

Instead, Apple gave software companies a break. It wrote Mac OS X to let software companies choose precisely how much work they wanted to devote to compatibility. The various levels include:

Write new programs from scratch (Cocoa). As Mac OS X becomes a bigger and bigger hit, more and more programmers and software companies create new programs exclusively for it. The geeks call such programs Cocoa applications. Many of the programs that come with Mac OS X are true Cocoa applications, including iChat, iPhoto, GarageBand, TextEdit, Stickies, Mail, Address Book, and so on.

Update the existing programs (Carbon). If software companies and programmers are willing to put a modicum of effort into understanding the Mac OS X program, they can simply adapt, or update, their existing software so that it works with Mac OS X. The resulting software looks and feels almost every bit like a true Mac OS X program. You get the crash protection, the good looks, the cool-looking graphics, the Save sheets, and so on, but behind the scenes, the bulk of the computer programming is the same as it was in Mac OS 9. These are what Apple calls Carbonized programs, named for the technology (Carbon) that permits them to run on Mac OS X.

Carbonized programs include Microsoft Office, AppleWorks, iTunes, Photoshop, FileMaker, Internet Explorer, and, believe it or not, the Finder itself. Many can run both in Mac OS X and Mac OS 9.

Do nothing (Classic). Software companies go out of business, unprofitable product lines are dropped, and shareware authors go off to law school. All of them leave behind orphaned programs that run only on the old Mac OS.

Your Mac OS X machine can still run this entire library of older, Mac OS 9-compatible software. When you try to open one of these older programs, Mac OS X launches a Mac OS 9 simulator called the Classic environment (which comes with hints of its own, described at the end of this chapter). Suddenly your screen is overtaken by the ghost of Mac OS 9. Sure, you leave behind all the trappings and benefits of Mac OS X—its new look, the Dock, crash protection, and so on—but at least you're still running your favorite programs.

  • One section of the screen. You can capture just a rectangular region of the screen by pressing Shift- [image] -4. The cursor will turn in to a crosshair (see Figure 4-15, top), and when you drag and release the mouse, you hear the camera-click sound. The Picture 1 file then appears on your desktop as usual.

  • One menu, window, icon, or dialog box. See Figure 4-15, bottom, for the sneaky feature that lets you neatly crop a single window or icon without having to edit out the background in Photoshop afterward.

Figure 4-15. Top: If you're interested in capturing only part of the screen, press Shift- [image] -4 to turn your cursor into a tiny + symbol. Now drag diagonally across the screen to capture only a rectangular chunk of it, as illustrated here.

  • The Dock. The business of pressing Shift- [image] -4 and then the Space bar also lets you capture the Dock in one quick snap. Once you've got the camera cursor, just click any spot on the Dock (between icons). The Dock background will fill with color when you're in the right spot; if you're not, just an icon on the Dock will be colored.

If you hold down the Control key as you click or drag (using any of the techniques described above), you copy the screenshot to your clipboard, rather than saving it as a new graphics file on your desktop. It's now ready for pasting (in PICT format).

Mac OS X also offers another way to create screenshots: the utility program Grab (found in Applications [image] Utilities) offers a timer option that lets you set up the screen before it takes the shot.

If snapping pictures of the screen is part of your job, however, you should probably opt for the $29 shareware program SnapzPro X (www.ambrosiasw.com) instead. Simple to install and easy to use, SnapzPro has enough options to satisfy even the most advanced screenshot professional (Figure 4-16).

Figure 4-16. In SnapzPro, you can easily control the format, file name, destination, scaling, thumbnail creation, color changes, and border of your screenshots. You can also use the $69 version to capture movies, which is a critical feature for anyone in a training or support role.

4.3.15 Reassigning Documents to New Parents

Every operating system needs a mechanism to associate documents with the applications that created them. When you double-click a Microsoft Word document icon, for example, Mac OS X needs to know that you want Microsoft Word to launch and open the document.

Mac OS X recognizes two different systems for making these associations:

  • The Mac OS 9 way. A Macintosh document's invisible, behind-the-scenes, four-letter creator code identifies the program that will open it: MSWD for Microsoft Word, MSIE for Internet Explorer, and so on.

  • Each Mac OS 9 document also bears a second four-letter code: the type code. This code specifies the document's file format. Photoshop, for example, can create graphics in a multitude of different formats: GIF, JPEG, TIFF, and so on. If you inspect your Photoshop documents, you'll discover that they all share the same creator code but have a wide variety of type codes.

  • The Windows way. In Windows, every document bears a three-letter file name suffix. If you double-click something called memo.doc, it opens in Microsoft Word. If you double-click memo.wri, it opens in Microsoft Write, and so on.

The bottom line is that Mac OS X offers two different mechanisms that associate documents with the programs that created them. Mac OS X looks for type/creator codes first. Where they're absent, the file name suffix scheme kicks in.

4.3.15.1 Reassigning a certain document—once

Double-clicking a graphics file generally opens it in Preview, the graphics viewer included with Mac OS X. But Preview can only display graphics. What if you decide to edit a graphics file? You'd want it to open, just this once, into a different program—GraphicConverter, for example.

To do so, use the Open With command. You can find it in two places:

  • Highlight the icon, and then choose File Open With.

  • Control-click the file's icon. From the shortcut menu, choose Open With.

In any case, study the submenu for a moment (Figure 4-17, top). The program whose name says "(default)" indicates which program usually opens this kind of document. From this pop-up menu, choose the name of the program that you'd rather have open this particular file, just this once.

4.3.15.2 Reassigning a certain document—permanently

After opening a TIFF file in, say, GraphicConverter for editing, you haven't really made any changes in the fabric of your Mac universe. The very next time you double-click that file, it will open once again in Preview.

If you want this particular file to always open in GraphicConverter, the steps are slightly different. In fact, there are three different ways:

  • Extend the one-shot reassignment method illustrated in Figure 4-17. In the Choose an Application dialog box, turn on Always Open With (Figure 4-17, bottom).

  • Begin with one of the techniques described above (highlight the icon, and then choose File [image] Open With, or Control-click the file's icon and choose Open With). After you see the menu, press and hold the Option key. Before your very eyes, the Open With command changes to say Always Open With.

  • Highlight the icon, and then choose File [image] Get Info. Reveal the "Open with" pane, and choose a new "parent" program name from the pop-up menu.

You can use the Get Info method to reassign the parenthood of a bunch of selected icons at once, too.

Figure 4-17. Top: The Open With menu offers a list of programs capable of opening an icon. The "(default)" icon displays the currently scheduled parent program.

4.3.15.3 Reassigning all documents of this type

If you want all documents of a certain type to open in a certain program—all PDFs in Acrobat Reader, all graphics in Photoshop, all HTML documents in BBEdit, or whatever—use the Get Info method described earlier. (You can't do it using File [image] Open With or by Control-clicking the icon.)

If you want to make all PDFs open with Acrobat, start by highlighting any PDF file. Choose File [image] Get Info, and reveal the "Open with" pane.

From its pop-up menu, choose the program you want to open this kind of document from now on (in this case, Adobe Acrobat). If the one you prefer isn't listed, use the Other option, which opens the Choose Application dialog box so you can navigate to the one you want. Find, then double-click, the program.

This time, follow up by clicking Change All beneath the pop-up menu. Mac OS X asks you to confirm by clicking Continue or pressing Enter.

From now on, double-clicking any similar kind of document opens it in the newly selected program.

4.3.16 Text-Box Selection Tricks

Want to select all the text in a field, like the address bar in Safari or the search box in TextEdit, as quickly as possible? How's this for quick: click the mouse with the cursor tip just below the top border of the box. One click selects all the text in the box.

When does this maneuver work? The best answer is "Most of the time." In almost any other case, you can triple- or quadruple-click inside a box to select all its text.

4.3.17 Speak Selected Text in Any Application

Spoken text is, of course, a lifesaver for those with visual impairments, but it can be useful even if your vision is 20/20! For instance, when listening to a document, any typos become immediately apparent.

In Mac OS X, Cocoa applications have always had the ability to easily speak a selection of text. Simply highlight some text, then choose Application menu [image] Services [image] Speech [image] Start Speaking Text. Unfortunately, there was never an easy way to get spoken text out of some non-Cocoa applications, including Microsoft Word.

Thanks to advances in Mac OS X 10.3's Speech preference pane, however, you can now hear spoken text from any Mac OS X program, including Carbon and even Java-based applications. To do so, open the Speech pane in System Preferences, and click the Spoken User Interface tab. In the "Other spoken items" section, turn on "Selected text when the key is pressed."

The dialog box that now appears is where you can define your own hot key to speak the selection. To prevent conflicts with existing shortcuts, use something relatively obscure, such as Shift-Option- [image] -S. If you ever want to change this shortcut, just press Set Key.

While you have the Speech preferences panel open, you may wish to click the Default Voice tab and select another voice. Vicki and Victoria are the easiest to understand.

Once you've set it up, you'll be able to highlight text in any application, hit your defined key combination, and listen to a spoken version of the selected text.

If you had any programs running when you turned on text to speech, you may have to quit and restart them in order for the change to take effect.


4.4 Printing, Fonts, and Text

For a company whose core audience includes graphic designers and photographers, the printing features of Mac OS X got off to a shaky start. With each new version of Mac OS X, however, the situation (especially regarding printer drivers) improves. In the meantime, you've got these helpful tips.

4.4.1 Custom Print Settings

It could happen to you: you have to print a document over and over in draft mode, then your hand becomes tired from changing the settings in the Print dialog box every time you need such a printout.

Fortunately (although few Mac fans realize it), the Print dialog box lets you save combinations of settings. To create custom print settings and then save them for future use, follow the directions in Figure 4-18.

Figure 4-18. To preserve printing settings, choose File Print to summon the Print dialog box. Make the settings you'd like to preserve. Before you click Print, choose Save As from the Presets pop-up menu, and give this setting combination a name. You can recall the whole shebang in the future by simply selecting this name from the pop-up menu.

To delete a custom setting from the Presets pop-up menu, choose it in the menu, and then choose Delete from the same menu.

4.4.2 View a Minimalist Font Panel

In Cocoa applications, you open the font panel by hitting [image] -T. This panel is relatively large as it consists of a preview area, columns for Collections, Family, Typeface, and Size, in addition to several formatting settings.

It doesn't have to be so large, though. To work with a much smaller font panel, just drag up and left from the resize handle on the lower-right corner of the window. As you shrink the panel, sections will disappear or change into different forms until you're left with a truly tiny font panel, as seen in Figure 4-19.

Figure 4-19. When you shrink the font panel by tugging on the resize widget, it eventually shrinks to downright tiny proportions—just three pop-up menus, as seen here. If you're working with limited screen real estate, this trick can free up some precious pixels.

To return things to normal, just reverse the process and pull the resize handle down and to the right.

4.4.3 Set Relative Font Scaling in Cocoa Programs

Have you ever created a document, consisting of many fonts at varying sizes, and thought, "Geez, wouldn't this look better if everything were just a bit bigger?" The traditional solution would be to modify each section you've created, pick a new size for each font, and then hope it all looks about right when you're done.

If you use a Cocoa application for word processing, though—such as TextEdit or Objectpark's Letter Star (www.objectpark.net/letterstar.html)—you can greatly simplify this task. Cocoa applications support a feature known as relative font scaling. In laymen's terms, instead of entering a certain type size for each section of text, you can select all your text and enter a multiplier or divisor, as seen in Figure 4-20.

By entering a mathematical formula instead of a font size, any text that is currently selected will be adjusted by the results of the formula. So entering "+2" will add two points to all existing font sizes, and entering "/2" will shrink all font sizes by 50 percent.

To make all selected fonts the same size, enter instead. All selected text will shrink to match the smallest selected size.

4.4.4 Install Windows Fonts Without Conversion

If you've been emailed a document that requires a Windows TrueType font, you're in luck. It turns out that Mac OS X and Windows can both use precisely the same kind of font, without any conversion whatsoever. Just drag the font file in question from the Windows source (which could be a network folder, a CD-ROM, or an email attachment) into your Home [image] Library [image] Fonts folder, and you're good to go.

Figure 4-20. In Cocoa applications, you can enter mathematic expressions in the font panel instead of absolute sizes. Here, the existing font sizes will be increased by 15 percent due to the *1.15 multiplier. (You can also use division, addition, and subtraction.) Whatever you enter is applied to all selected text, giving you an easy way to change the font sizes across your document while maintaining the relative sizing between various fonts.

4.4.5 Unicode Characters

You may have heard of Unicode, but the odds are pretty good that you don't know how to use it. It's definitely worth learning about, though, as it's one of Mac OS X's most powerful text tools. This hint will get you started.

Traditional operating systems use a scheme for storing text (known as ASCII text) that has room for only 256 letters, numbers, and other characters. That's adequate for making shopping lists and typing letters to your mom, but horribly suited for, say, writing a dissertation on the geometric attributes of Korean characters.

Enlightened modern operating systems, therefore, recognize something called the Unicode alphabet—a computer representation of over 32,000 characters, covering a wide range of languages, punctuation marks, and drawing symbols. Characters are each identified by a four-digit number, like 2318 (which happens to be the code for the Command-key symbol [image]). With a bit of setup work, you can insert them into almost any Mac OS X program.

Open System Preferences [image] International [image] Input Menu tab, then check both Character Palette and "Show input menu in menu bar." A small flag icon should now appear in your menu bar. Click the flag, and you'll see that both Unicode Hex Input and Show Character Palette are now valid options.

To input Unicode characters, launch any Cocoa application that accepts text input, such as TextEdit. Click the flag icon in the menu bar and select Show Character Palette. If it isn't chosen already, select Unicode from the View pop-up menu at the top of the palette. Now, you can use one of the Character Palette's three modes to select a symbol to insert:

  • Unicode Blocks lets you search for characters by category: Arrows, Mathematical Operators, General Punctuation, and so on. The pane on the right changes to display all the characters in the selected category.

  • Unicode Table lists characters by their Unicode number (2318 for the Command symbol, for example). Just add the row and column numbers (2310 + 8, in this case) to decipher the Unicode number for the symbol you want. Figure 4-21 shows this in action.

Figure 4-21. The Unicode menu on the Character Palette displays all the Unicode characters that Mac OS X is aware of. In Unicode Table mode, the numbers on the side and top identify each particular character; here, boxes are shown to point out the Command key symbol at position 2318.

Unicode uses what's known as the hexadecimal (or "hex") system for counting. So, besides the normal digits 0-9, a number may also include the letters A-F.

  • Favorites, as the name would suggest, lists all your favorite characters. You can add new characters to this listing by clicking "Add to Favorites" in either Unicode Blocks or Unicode Table mode. You can also drag-and-drop to rearrange the characters within the Favorites listing.

Once you've selected a character in the palette, you can either drag-and-drop it into a document or press Insert.

For a complete listing of every Unicode character in existence, visit www.unicode.org/charts.

4.4.6 Narrowing Down the Character Palette

Unicode is ideal when you need to type characters from other alphabets, but sometimes you just want to quickly find a symbol: the paragraph mark, degrees sign, or Euro symbol, for example.

In older versions of the operating system, you'd have to use the Key Caps program, playing around with key combinations until you found the one that produced the symbol you wanted. Nowadays, you can use the Character Palette instead, sparing you the trouble of launching a separate program.

Open the Character Palette (as explained in hint Section 4.4.5), but choose Roman instead of Unicode from the View pop-up menu. (The Roman character set includes most common characters from Western languages.)

As shown in Figure 4-22, the "by Category" tab lets you easily browse listings of letters, numbers, and symbols. When you've found your desired symbol, click Insert; to save it for future use, just click "Add to Favorites."

Figure 4-22. After you've chosen Roman from the pop-up View menu, click "by Category" to display a list of different character groups: Arrows, Digits, Punctuation, and so on.

4.4.7 Capture Colors Anywhere Onscreen

If you're a Web designer, graphic artist, or just someone who enjoys collecting color swatches, you're in luck. Mac OS X includes a couple of different tools that make it simple to capture any color you see onscreen.

The first is the ubiquitous color picker, which can be found in almost every Cocoa application (including TextEdit, Mail, and iChat). Hit Shift- [image] -C, and the color picker magically appears onscreen. To select a color you see onscreen, click the small magnifying glass icon next to the color box. After you do so, the cursor will change into a larger magnifying glass, as seen in Figure 4-23.

Figure 4-23. When you activate the color picker in any Cocoa application (via Shift- [image] -C) and click the small magnifying glass icon, your cursor turns into a super-sleuthing magnifying glass. Click anywhere on your screen and the color under the glass will be captured to the color picker.

Once you've activated the secret magnifying glass, click anywhere on your screen and the color under the glass will become the chosen color in the color picker. Now you can use this color like any other—for text, drawing, or future use (see hint Section 4.4.8).

If you're a Web designer, though, you'll probably lament the color picker's lack of hex values for the color you sample. (To a Web designer, yellow isn't yellow, but #FFFF00—the code used in HTML files.) If you need hex color codes, then, you'll want to look at the second option for snagging onscreen colors: the Digital Color Meter application, hiding in your Applications [image] Utilities folder.

Launch the program and select "RGB as Hex Value, 8-bit" from the pop-up menu. Start moving the mouse around the screen, and hover over a color of interest. The R, G, and B boxes show the hex code. Now hit [image] -L to lock them in so you can keep moving the mouse without losing the code.

Use the Aperture Size slider if you'd like to take the average hex values of several surrounding pixels, instead of just the value of one.

4.4.8 Create a Customized Color Palette

If you're working with the color picker (see previous hints), you may know that you can use the boxes below the color wheel to store often-used colors. But there are probably a couple tricks you didn't know regarding these boxes. First, you can add more rows by dragging down on the small dot below the boxes (see Figure 4-24). You now have room to store literally hundreds of color swatches, depending on the size of your monitor. (You can also use the resize handle at the bottom right of the color picker to expand it horizontally and vertically.)

After you've added a couple hundred of your favorite colors for future use, you'll soon realize that there must be a better way to store them. It's hard to find the precise color you want, since there's no discernible order to your swatches.

That's where custom color palettes factor in. If you work with a number of clients who each demand that you use certain colors, custom palettes are the best way to meet their needs. In short, you can create a specific palette for each client, containing only his approved colors. Confusion eliminated, just like that! As an example, Figure 4-24 offers a custom palette for a Web design firm's client.

Figure 4-24. Using custom color palettes, you can easily create a customized set of colors for each client (or project). That way, you can't cross-contaminate colors that belong on different Web pages, documents, and images.

Open the color picker from TextEdit or another Cocoa application and click the third icon from the left in the top row—the one with three small overlapping boxes. Click the List pop-up menu, and choose New. This will create an Unnamed-1 color set; click the pop-up again and choose Rename to give it a more meaningful name.

You're now ready to start adding colors to your custom palette. You can do so by using the other color selection tools (the icons at the top of the dialog box) or by dragging them from your collection of favorite colors (the boxes at the bottom of the dialog box). When a color is dragged in, though, it may be given a generic, unhelpful name. To name it something more appropriate, click the Color pop-up and select Rename.

Your custom palettes are stored in your Home [image] Library [image] Colors folder. If the need arises, you can also give these files to co-workers, who can add them to their palette by using the Open item in the List pop-up menu (or by dropping them in their own Library [image] Colors folder). If you need to insure that corporate color standards are upheld, distributing a custom palette is a good first step!

4.4.9 New Spelling Words

The nightmare: a word processor, spreadsheet, presentation program, and email program, each with its own spell checker and spelling dictionary.

The fantasy: a computer with a single, centralized spelling dictionary that works with every program you use.

Clearly, that's what Apple had in mind when it created the master Mac OS X spell checker. So far, Cocoa programs (Mail, TextEdit, iPhoto, and so on) are generally the only ones to capitalize on this feature, but the list will grow.

In any case, here's how it works: as you type, a red dotted underline appears beneath any words the Mac considers incorrectly spelled. Instead of editing the word when you see the red underline, Control-click it. A menu containing recommended substitutions appears (Figure 4-25), as well as an option to teach the word to the Mac so it won't flag it the next time around. If you use a lot of unusual words, use the Learn function to prevent the spell checker from underlining them in red in the future.

Figure 4-25. When you Control-click a misspelled word in Cocoa (and some Carbon) programs, you can choose a different spelling or add the word to your dictionary. Once added, the word is no longer marked as incorrect when you use it the next time.

4.4.10 Changing the Spell Check Language

In Cocoa programs, you can control which language the spell checker uses. Control-click any blank section of a document. From the shortcut menu, choose Edit Spelling [image] Spelling. Inside the Dictionary area of the resulting dialog box is a pop-up menu that lets you specify the dictionary's language—Español, Italiano, or British English, for example. (Here's your opportunity, Brits, to make the Mac quit flagging colour as a spelling error.)

If you choose Multilingual, the Mac tolerates words from all languages it knows.


4.5 Classic

As described in the sidebar on Sidebar 4.2, Mac OS X is like the renaissance operating system: it's a polyglot, capable of running three different kinds of software: Cocoa (written from scratch for Mac OS X), Carbon (an older program that's been updated for Mac OS X), and Classic (Mac OS 9 programs that are still Mac OS 9 programs).

Although somewhat unknown to those who are new to the Mac with OS X, Classic programs (older, Mac OS 9-compatible ones) are likely to be part of most longtime Mac fans' lives for a while yet to come. Therefore, it's well worth familiarizing yourself with Classic, the Mac OS 9 simulator that opens up automatically whenever you try to launch a Mac OS 9 program.

4.5.1 Printing on Unsupported Mac OS X Printers

Do you have an aging printer that works great in Classic programs but doesn't work in Mac OS X programs?

Your first resort should be to contact the printer company or, at the very least, to search the Web to see if some enterprising programmer has adapted a printer driver to work with your Mac. That should include a stop at http://gimp-print.sourceforge.net, where you'll find Gimp-Print, a collection of hundreds of Mac OS X printer drivers for older printers. Although Gimp-Print is included in Mac OS X 10.3, it's still worth a visit to their site to see if any updated drivers have been released.

If you're still having no luck, and you need to print on that old printer only occasionally, here's a method of last resort. In a Mac OS X program, save the document as a PDF file (File [image] Print [image] Save as PDF). Next, open the document in a Classic program that can read PDF files, like Adobe Acrobat—look in your Applications (Mac OS 9) folder for the Classic version. Now print away.

4.5.2 Opening Mac OS 9's Menu and Control Panels

If you're accustomed to the old Mac OS 9 days—where you'd use the [image] menu to launch control panels and programs—you might not know how to access your control panels from Mac OS X. You could, of course, switch to a Mac OS 9 program every time you need to bring up the old [image] menu, but that's a huge waste of time.

Luckily, there's a much quicker way. Open the System Folder, which is the folder that contains your copy of Mac OS 9. (Don't confuse it with the folder called simply System—the one that bears an X—which is the Mac OS X operating system.)

Once this window is open, drag the Control Panels folder and the Apple Menu Items folder onto the right side of your Dock. From now on, you can access these programs without switching to Mac OS 9 first (Figure 4-26).

Figure 4-26. Once you've installed the Mac OS 9 Control Panels and Apple Menu Items folders on your Dock, Control-click them (or click and hold on them) for direct access to their contents. To make the folders stand out, feel free to paste custom icons on them (see hint Section 2.1.16).

If you'd still like to visit the Mac OS 9 [image] menu from the Mac OS X menu bar, turn on the Classic menulet: open System Preferences [image] Classic and turn on "Show Classic status in menu bar." Now you can just visit Classic menulet [image] Apple Menu Items to see a replica of your Mac OS 9 [image] menu without ever launching Mac OS 9.

4.5.3 Sharing Settings between Classic and Mac OS X Programs

If you regularly use both the Classic and Mac OS X versions of Internet Explorer, you've probably encountered—and despised—the efficiency-defying task of synchronizing the browsers' bookmarks by hand. Fortunately, it's possible to trick your system into updating both sets of bookmarks automatically, along with your browsers' history files and whatever Web sites you've captured on the Scrapbook panel of Internet Explorer. Here's how:

  1. Rescue your Favorites from Mac OS 9.

    Before you create one set of files for both operating systems, save anything important from your Mac OS 9 Internet Explorer setup, as you'll be replacing these files.

    In the Mac OS X version of Internet Explorer, choose File [image] Open File. Navigate to the System Folder [image] Preferences [image] Explorer folder.

    Open the document inside called Favorites.html (see Figure 4-27).

    Figure 4-27. This sneaky little file contains a concise list of all your Mac OS 9 Favorites (bookmarks). It's inside your System Folder [image] Preferences [image] Explorer folder.

    Once you've opened this list, [image] -click one of your links inside it to open the corresponding Web page in a new window. Press [image] -D to add it to your Mac OS X bookmarks file and then press [image] -W to close that Web site window. Repeat with the next link in the old Favorites file. Continue until you're certain you've saved all your critical bookmarks in the Mac OS X version of Internet Explorer. (Behind the scenes, they're being saved in Mac OS X's own Explorer folder.)

  2. Rescue your Scrapbooked Web sites from Mac OS 9.

    If you've never captured a snapshot of a Web page by using the Scrapbook tab at the left side of the Internet Explorer window, then skip this step.

    Otherwise, switch to the Finder and open two side-by-side windows. In [image] the first, open System Folder [image] Preferences [image] [image] > Explorer [image] Internet Scrapbook. In the second, open your Home [image] Library [image] Preferences [image] Explorer [image] Internet Scrapbook folder. You should now see a list of everything you've added to Internet Explorer's Scrapbook panel in both Mac OS 9 (the first window) and Mac OS X (the second window). Copy any Web pages that you want to save from the Mac OS 9 folder to the Mac OS X folder. (Leave the windows open.)

  3. Now that you've saved your critical bookmarks and Internet Scrapbook items, it's time to make sure you'll never have to do it again.

    In the two Finder windows you've already opened, move up one level in both (that is, click inside each window and press [image] -up arrow) so that you're in the Explorer folder in each window.

  4. In the Mac OS 9 Explorer folder, move Downloads.html, Favorites.html, and the Internet Scrapbook folder to your desktop (or somewhere else) for safekeeping. Leave the windows open.

    Technically, you could delete these files now. But putting them on the desktop insures that if anything goes wrong, you'll be able to move them back and return the Classic version of Internet Explorer to its original state.

  5. In the Mac OS X Explorer folder, select Favorites.html, History.html, and Downloads.html. (The best way to select them all at once is to [image] -click each.)

    While holding [image] -Option, drag the highlighted icons into the Mac OS 9 Explorer folder, as shown in Figure 4-28.

Figure 4-28. -Option-dragging icons creates aliases of them. In this case, aliases are created in the Mac OS 9 Explorer folder. When you drag, the cursor becomes a shortcut arrow, as seen here, indicating that you're creating aliases, not copies.

That's all there is to it. If you open the Classic version of Internet Explorer, you'll find that your bookmarks, history, and scrapbook now match their Mac OS X counterparts.

Even better, any changes you make in the Classic version of Internet Explorer also appear in the Mac OS X version. (Once you're confident that everything works, simply delete the files you moved in step 4.)

Best of all, this technique works with many other programs that have both Classic and Mac OS X incarnations (Eudora, GraphicConverter, and so on). You may have to decipher which files they can share, though; Web sites like (www.macintouch.com) are good places to find such information.

4.5.4 Speeding the Opening of Classic

Mac OS X duplicates many of the functions of the Classic System Folder—and in a far superior way. Turning off as many Mac OS 9 extensions as possible, therefore, turns your Classic environment into a much smoother and more stable experience and dramatically accelerates its startup process.

The key to controlling which extensions load is to press and hold the Space bar just after the Classic progress bar begins filling up, as shown in Figure 4-29. Release the Space bar only after the Extensions Manager window appears.

Figure 4-29. Pressing the Space bar while Classic is starting up opens Extensions Manager, just like when you press Space while starting up a Mac OS 9 computer. (If you've bought Conflict Catcher—a commercial replacement for Extensions Manager with many more features—you'll see its screen appear here instead.)

To set up your winnowed-down extension set, click Duplicate Set in the lower-right corner of the window. In the dialog box that appears, type a name for the set you're about to create (such as Classic Speedy Startup), and then click OK.

Now you're ready to start paring down the extensions and control panels that delay Classic's startup process and make it so prone to crashes. Depending on what functions you need to use in Classic, you might consider turning off the extensions and control panels in these function categories (by clicking their checkboxes so the X no longer appears):

  • Control Panels. Many of Mac OS 9's control panel functions are superseded by new panels in Mac OS X's System Preferences. Changing your mouse speed using Mac OS 9's Mouse control panel, for example, doesn't have much meaning if you've already set your mouse speed in Mac OS X.

  • Therefore, you should turn off the following control panels immediately since they don't work in Classic: Control Strip, Energy Saver, File Sharing, Infrared, Location Manager, Modem, Monitors, Mouse, Multiple Users, Password Security, PowerBook SCSI Disk Mode, Remote Access, Software Update, TCP/IP, Trackpad, and Web Sharing.

The following Mac OS 9 control panels work, albeit with limited functions, within Classic: Appearance, AppleTalk, Date & Time (for menu bar clock control only), General Controls (some commands, like Show Desktop, are dimmed), Keyboard (duplicated functions are dimmed), Memory (Disk Cache only), Monitors, and Sound (for alert sounds only).

  • Internet. If you do all your Internet dialing from within Mac OS X, you likely have little need for the equivalent functions in the Classic environment. If that's the case, you can safely turn off DialAssist, Internet, Location Manager Extension, Apple Modem Tool, Internet V.90 Modem (and other modem names, such as PowerBook Modem), the LDAP extensions, NBP Plugin, NetSprocketLib, Remote Only, and ShareWay IP Personal Bgnd, in addition to the control panels listed above. You may as well turn off the Software Update extensions, too, since they rely on Internet access.

  • Networking, Multiuser features. If you won't be connecting to other computers on your network from within Classic, turn off AppleTalk, the AirPort extensions, Keychain Access, IrDA Tool and IrDALib, Apple Enet, Apple Enet DLPI Support, AppleShare, EnetShimLib, File Sharing Extension, File Sharing Library, Multi-User Startup, OpenTpt Remote Access, Network Setup Extension, and SLPPlugin.

  • Printing. If you don't plan to print from within Classic programs, you can turn off anything containing the words Print, Printer, Printing, or ColorSync, as well as the extensions bearing specific printer names (Color SW 1500, Color SW 2500, LaserWriter, and so on).

  • DVD. The old, Mac OS 9-style DVD Player program doesn't even work in Classic. Turn off everything containing "DVD" in its name.

  • CD burning. Here again, Mac OS X does a far better job of burning CDs than Mac OS 9. For example, Mac OS X can even burn data DVDs, which hold a delightful 4.7 GB per disc. By all means, turn off the Disc Burner Extension.

  • Video games. A few video games require the OpenGL, QuickDraw 3D, NVIDIA, and ATI extensions. If you're a gamer, you'll experience the best game play by restarting your Mac in Mac OS 9, rather than trying to play Mac OS 9 games in the Classic mode. If you agree, turn off all extensions that contain the words QuickDraw 3D, OpenGL, NVIDIA, and ATI.

  • FireWire. Even if you have a digital camcorder for use with iMovie, you may as well turn off the FireWire extensions, as the Mac OS X version of iMovie is better than the Mac OS 9 version. Leave the FireWire extensions on only if you have FireWire gadgets like external hard drives that you want to access from within Mac OS 9.

Once your pruning session is complete, click Continue. You should find that the Classic mode now starts up dramatically faster than before.

These are only suggestions. If, after turning off some of these extensions and control panels, you find that certain familiar Mac OS 9 functions are no longer available, exit Classic, restart it with the Space bar pressed, and experiment with restoring some of the things you turned off. And if you don't have time to fiddle with individual extension settings, you can always turn on the entire Apple-authorized original set again. To do so, just choose Mac OS 9 All (or Mac OS 9.2.2 All, or whatever) from the Selected Set pop-up menu.

Similarly, note that the commercial program Conflict Catcher can switch extension sets automatically, depending on whether the System Folder is being used for Classic mode or an actual restart.

4.5.4.1 Extensions to leave on

You can't go totally hog-wild turning off System Folder elements. Classic expects to find certain System Folder items when it launches. If you turn them off, an error message will explain that "Some Classic-specific resources need to be added to or updated in your System Folder on [Disk Name]." If you click OK, Mac OS X copies them into the Mac OS 9 System Folder. Here's a list, current as of Mac OS 9.2.2:

  • Control Panels: General, Startup Disk

  • Extensions: Apple Guide, CarbonLib, Classic RAVE, Open Transport, Open Transport ASLM Modules

  • Loose in the System Folder: Classic Support, Classic Support UI, ProxyApp

4.5.5 Speeding Your System with Two Mac OS 9 Folders

The Classic simulation mode is a perfectly satisfactory substitute for a true Mac OS 9 computer—most of the time. Occasionally, though, some people encounter tasks that don't work except on a true, Mac OS 9-booted computer—as opposed to a sissified Mac OS 9 simulator. Certain older scanners, for example, work only on a machine that is actually running Mac OS 9; ditto with certain Mac games.

If you find yourself in that situation, consider creating two copies of Mac OS 9:

  • A Classic copy. Use this System Folder only as the basis for running the Classic simulator. In this one, turn off a huge number of the extensions, control panels, and drivers that typically clog the arteries of the System Folder. The result is a much faster Classic startup and a much more stable Classic emulator.

  • A full copy. Use the second System Folder for starting up the machine when necessary.

This trick, alas, comes with two very specific hardware requirements:

  • A pre-2003 Macintosh that can be restarted in Mac OS 9. (Mac models introduced in 2003 and later can only start up in Mac OS X.)

  • A second hard drive (an iPod, for example) or hard drive partition.

You can create a Classic-only version of Mac OS 9 by copying your hard drive's System Folder to the new drive or partition. When you need to use your "real" version of Mac OS 9, just choose it in the Classic panel of System Preferences, and then restart the Mac.

Here are some general guidelines to streamline a Classic-only System Folder:

  • To create a Classic-only version that will load quickly and run solidly, trash items like shareware and freeware extensions and control panels that provide features you don't absolutely need. You can toss, for example, things that modify sounds, create themes, and install items in your menu bar.

  • Turn off all of the extensions and control panels for features that Mac OS X already handles, as described in the previous hint.

  • To conserve disk space, empty the Preferences folder in the System Folder that you'll use for Classic purposes.

  1. Then, open the System Folder you'll use for restarting the computer. Open its Preferences folder, press [image] -A to highlight all the files inside, and then [image] -Option-drag them to the Classic-only System Folder [image] Preferences folder.

  2. In short, you've just eliminated the need to maintain duplicate sets of preferences. You really only have one set of preference files, but thanks to the aliases, they're mirrored automatically in the second System Folder.

Once you have two Mac OS 9 folders, you can now tell the Mac what to do with them. Here's how:

  • Choose the System Folder for Classic use. Open System Preferences [image] Classic. On the Start/Stop tab, click the icon for the System Folder that will represent your Classic copy. You'll only have to do this step once.

  • Designate the System Folder for startup purposes. You'll perform this step only when you want to restart the Mac in Mac OS 9 (Figure 4-30).

  • This time, open System Preferences [image] Startup Disk. Click the icon for the System Folder that you want to act as the "start me up" operating system. Then restart the Mac.

4.5.6 Running Classic from a Disk Image

As companies write more programs for Mac OS X and Mac OS 9 fades in utility, you may wonder if you need the older system lingering around, taking up hard drive space. Well, you don't. Instead, you can run Classic from a simulated drive known as a disk image, much like the .dmg files that often serve as "digital wrappers" for software you download from the Web.

Figure 4-30. When you want to restart your machine in Mac OS 9, you'll need to select your "full" copy of Classic as the boot disk, as seen here.

Why encapsulate your Classic System Folder in a disk image? Let us count the ways:

  • It's hidden from view until you need it.

  • It's preserved in its virginal, perfectly operational condition. You can't accidentally delete something from, or save something into, your System Folder.

  • You can compress it to save disk space.

  • You can copy it from Mac to Mac, confident that all copies will be identical.

If you want to forge ahead, bear in mind that you need at least 500 MB of drive space to hold the disk image. You also need a tolerance for Terminal (Section P.3.5.3).

  1. Make sure that Classic is not running. Then open Disk Copy (in Applications Utilities), and choose Images New Blank Image.

    Disk Copy asks you to name the disk image you're about to create.

  2. Set up the name, size, and characteristics of the disk image.

    Name it whatever you like—something like "Classic Disk Image" would suffice.

    Set the size to 500 MB. Or, if you have an existing Mac OS 9 folder that you intend to drag to the new disk image, you can use Get Info to find its size (highlight its icon and then press [image] -I); then set the size in Disk Copy to something slightly larger than that.

    Make sure the format is "read/write disk image."

  3. Click OK.

    Disk Copy creates the new image, which is basically a file on your hard drive of the size you specified. This process takes a few minutes. After it's done, quit Disk Utility.

  4. Once your disk image has been created, Mac OS X should automatically mount it.

    Mounting a disk means bringing its icon onto the desktop, as shown in Figure 4-31. If, for some reason, your disk image was not mounted, just double-click its icon on the desktop to fix the situation.

    Figure 4-31. When you double-click a .dmg file (in this case, Classic Image.dmg, at bottom), the system eventually spits out an icon that looks like a regular disk (in this case, Classic Drive, middle). You can treat such images as you would a recordable CD.

  5. Put Mac OS 9 onto the new disk image.

    You can either install Mac OS 9 from your original CDs onto the simulated disk, or drag your existing Mac OS 9 System Folder onto the image.

    If you drag, you create a copy of Mac OS 9 as you've customized it. If you install from the CDs, you create a factory-fresh copy.

    The customized version will probably be more useful to you, but the factory version will be much smaller and cleaner. It'll also be free from the various bits that accumulate in the System Folder over the years.

  6. Open Terminal.

    It's in your Applications [image] Utilities folder. Position its window so that you can see it and the Finder window that contains the new Mac OS 9 folder you just created.

  7. At the prompt in Terminal, type sudo bless -folder and then press the Space bar to leave a space at the end of the line.

    The "bless" command tells the Mac that the folder you're about to specify is a legitimate, working Mac OS 9 System Folder. (Type man bless and then press Enter if you'd like more information on the command.)

  8. In the Finder, drag the newly created System Folder from the disk image directly into the Terminal window.

    That's a shortcut for telling Terminal which file you intend to operate on. You see something like this:

    sudo bless -folder /Volumes/Classic/System\ Folder

  9. Type -folder9 and another space. Drag the exact same System Folder icon from the Finder into Terminal again.

    You've just built a command that looks like this:

    sudo bless -folder /Volumes/Classic/System\ Folder -folder9 /Volumes/Classic/System\

 Folder

  10. Type -bootBlocks.

    Make sure you make the second B uppercase.

    The entire command should now look like this (with just one space instead of the line break shown here):

    sudo bless -folder /Volumes/Classic/System\ Folder -folder9

/Volumes/Classic/System\ Folder -bootBlocks

    The name of the disk image you created takes the place of "Classic" in the example above, but the remainder of the command should look the same. If everything seems right, press Enter. Enter your administrator password if asked.

    If you did everything right, Terminal executes your command without complaint. Quit Terminal.

  11. Open System Preferences [image] Startup Disk.

    You're going to use this application to trick the Classic preference panel into searching for working Mac OS 9 System Folders again.

  12. Select the Classic folder you just created.

    Figure 4-32 shows the effect.

  13. Quit System Preferences.

    You must quit and reopen System Preferences to make it recognize the new Startup Disk.

  14. Open System Preferences again. Click Classic, then the Start/Stop tab.

    The search indicator spins as Mac OS X looks for new disks containing Mac OS 9 System Folders.

    Figure 4-32. Select the Mac OS 9 system that's on the Classic disk image you just created. You won't actually restart your computer by booting from the disk image (it wouldn't work, anyway). By selecting it as the startup disk, however, you force the Classic preferences panel to search for new Classic disks the next time you launch it.

  15. Find your new Mac OS 9 System Folder (the one on the disk image) in the list, and select it.

    Now Mac OS X will use your new folder for Classic mode.

  16. Still in System Preferences, click Startup Disk. Click the icon of the System Folder that you want to start up the Mac the next time it starts.

    That would probably be Mac OS X.

  17. Return to the Classic preference panel and click Start.

    If you installed Mac OS 9 using the original CDs, a dialog box opens asking if you wish to add the necessary resources for Classic to run; click Yes. (If you made a copy by dragging your existing folder, there's no warning.)

  18. Use your old Mac OS 9 programs in Classic as usual.

    When you're done, stop Classic from its System Preferences panel first, and then click the Show All icon (or switch to any other preference panel) to avoid a warning about your disk selection.

    Once Classic has stopped, you can drag the Classic disk image icon to the Trash to remove it from sight, or just press the Eject key on your keyboard.

The next time you need to run a Classic program—SimpleText, say—just double-click the SimpleText icon as usual. The Finder will mount your disk image (that is, turn it into a virtual disk on the screen) and then start Classic from it, all without your intervention.

Classic takes a bit longer to open this way than it does when launched directly from your hard drive. But look on the bright side: you now have a Classic that's completely gone when you're not using it. Meanwhile, you can boast to your friends that you "run Classic off a disk image, just like VirtualPC." They'll either be awed or disturbed by your geek prowess.


4.6 Troubleshooting

Although Mac OS X is nice and stable, you may still experience problems from time to time. When you do, here are some simple steps to resolve the trouble.

4.6.1 Trashing Preferences

Corrupted preference files can cause all kinds of strange behavior in certain programs: a program that used to work perfectly suddenly starts quitting at random, Mail stops working altogether, and so on. Eliminating the preference folder for a misbehaving program can often restore it to working order. Although you lose your preference settings when you use this technique, it's occasionally a necessary evil of troubleshooting.

Mac OS X maintains a separate preference file for each person who has an account. You can find your personal collection in the Home [image] Library [image] Preferences folder. Look for a file with the name of your misbehaving program and drag it to the Trash—com.apple.dock.plist is the Dock preference file, for example. If this action fixes the problem, you're done troubleshooting! (If not, gnash your teeth and try the next hint.)

In the case of the aforementioned Mail malfunction, a bad Address Book entry could be at fault since Mail reads the Address Book each time it opens. If that's at the root of your woes, you can revitalize Mail just by trashing the Address Book's database.

4.6.2 A Separate Account for Troubleshooting

One of Mac OS X's most useful troubleshooting features is its multiuser capabilities. If you're experiencing trouble with some element of the system, and the previous hint didn't resolve it, the next step is to create a new "troubleshooting only" account.

Open System Preferences, click Accounts, and click the plus sign at the bottom left to add a new user. Fill in the form that appears, and assign the account a useful name like "Test Account" or "Save My Bacon." On the Security tab, turn on "Allow user to administer this computer" to make sure your test account has full system-management powers. Now log out of your normal account and log in as the test user (or click the Login Options button to turn on Fast User Switching, which lets you log in as the new user without logging out of your current account). Try to recreate the problem you were experiencing before. If you can't duplicate it, then you've narrowed the problem down to something within your normal account. More than likely, you can solve it by troubleshooting preferences as explained in the previous hint. If, on the other hand, the problem persists, you know you've got a system-level problem, and it may be time to call in the experts (Apple Support, your favorite troubleshooting Web site, or an ultrageeky friend).

Don't use your test account for normal computing, and don't install any hacks or nonstandard system modifications on that account. You want to keep it as close as possible to the original factory setup.

4.6.3 The System Build and Serial Numbers

Every release of Mac OS X has an associated build number—a special number that represents what Apple called this version of the software internally before it was released publicly. You may need to know it if, for instance, you call Apple's tech support line. The correct build number will also help you identify the appropriate version of certain articles on Apple's support Web site, and come in handy when discussing your Mac online with other geeks. To find out your Mac OS X build number, follow the directions in Figure 4-33.

Figure 4-33. Choose [image] [image] About This Mac. In the resulting dialog box, click Version. The first click reveals the build number; a second click reveals your system's serial number. (A click on More Info opens Apple System Profiler for you.)


Chapter 5. System Preferences

System Preferences is like your brain's cortex in that it coordinates fine-motor skills. It's the program to use if you want to change the characteristics of your machine (like the speed of your mouse) or system-wide functions (like the color used for highlighting text). If you're an old Mac or Windows hand, note that System Preferences has replaced the Control Panels of yore.

UP TO SPEED 50 Ways to System Preferences

There's more than one way to skin a cat, and there's certainly more than one way to open System Preferences.

Most people get there by clicking the little light-switch icon on the Dock. If you don't see it there, somebody may have dragged it off. Fortunately, there's a backdoor: you can also choose [image] [image] System Preferences.

If you want to jump quickly to the Sound or Displays pane, there are a couple of special keystrokes that take you there in a flash. Press Option and the Mute key on the keyboard

(usually at the top of the numerical keypad), and the Sound pane of System Preferences pops open right before your eyes. To get to the Displays panel just as quickly, press Option along with one of the Brightness control keys (usually at the top of a laptop keyboard).

The third method, well, it's hardly a shortcut: open your Applications folder and double-click the System Preferences icon.


5.1 System Preferences

This section just contains hints on using the System Preferences program—not the specific panes within it.

5.1.1 Adding New Preference Panes

In versions of Mac OS X prior to 10.3, adding your own System Preference panes, such as those provided by TinkerTool, required either a bit of knowledge about the system or a friendly installer provided by the software developer.

With Mac OS X 10.3, most preference panes no longer work this way. Instead, just double-click on the preference pane in the Finder (usually ending in ".prefPane"), and Mac OS X will take care of the rest, as seen in Figure 5-1.

Figure 5-1. In Mac OS X 10.3, you can install most System Preference panes with a double-click on their Finder icons. The system will then present you with two options for installing, as seen here.

This technique works for most simple preference panes. However, if the pane has other required software pieces, you may need to use the provided installer instead. (Microsoft's Mouse pane, for instance, requires an installer because it also installs the custom mouse driver extension in the System folder.)

5.1.2 Removing Preference Panes

Just as adding third-party preference panes got easier in Mac OS X 10.3 (see the previous hint), so did removing them. Simply control-click the custom preference pane's name in System Preferences and select Remove from the pop-up menu.

UP TO SPEED Why Some System Preference Panes Are Dimmed

Only a system administrator (see Sidebar 1.1) can change settings that affect everyone who shares a certain machine. Examples include Internet settings, Energy Saver settings, and so on. These panes may be dimmed for nonadministrators.

The padlock icon in the lower-left corner of a pane is the telltale sign that you're not allowed to tweak it. If you, a nonadministrator, would like to edit some settings, call an administrator over to your Mac and ask her to click the lock, input her password, and supervise your tweaks.

Just like installing panes, this technique will only handle the removal of simple preference panes. Programs that install pieces in multiple locations must be uninstalled using a provided uninstaller.

5.1.3 Alphabetizing Preference Panes

Apple may find the category sorting in System Preferences logical, but it strikes most Mac fans as pretty arbitrary. As shown in Figure 5-2, searching through all the categories just to find a pane can be confusing.

Figure 5-2. Quick—without looking—which category contains Date & Time? Is it the Personal, Hardware, Internet & Network, or System row?

Luckily, there's a much easier way: change System Preferences to eliminate the category rows and instead display all of the preference icons in alphabetical order. Now you'll know exactly where to find Date & Time.

To bring about this arrangement, choose View [image] Organize Alphabetically. If you decide you prefer the old view, just select View [image] Organize By Categories.

5.1.4 System Preferences from the Dock

Most people make system adjustments by opening the System Preferences program, looking for the pane they want, and then clicking it. Instead, you, Speed Racer, can choose any pane directly from a Dock pop-up menu. Just click and hold (or Control-click) on System Preferences' Dock icon, and you'll get a handy pop-up menu that allows you to instantly select any of the individual panes.

What's the secret? There really isn't one, other than the fact that this technique only works when System Preferences is running. Since the application quits when you close its main window, you can make this trick always work by simply not closing the System Preferences window. If it takes up too much of your screen, you still shouldn't quit it—just use the Hide command ( [image] -H) to banish it to the land of invisibility. The pop-up menu in the Dock will still work, even when the program is hidden.

5.1.5 Customizing the Toolbar

At the top of the System Preferences window is a toolbar. It turns out that it's customizable, too—just like the Finder or the Mail toolbar. If you load this toolbar with the icons for the preference panes you use most often, you save a couple of clicks each time you change a setting.

To add a button, just drag it from the main window onto the toolbar; you can also drag the toolbar icons to rearrange them.

5.1.6 Resizing Toolbar Icons

It's not as exciting as 57 varieties, but System Preferences lets you choose from six different icon sizes in the toolbar, as shown in Figure 5-3. The more you [image] -click the pill-shaped toolbar button, the more you condense the display of the toolbar.

At the largest icon size, you have room for about seven or eight icons in the toolbar. In the smallest icon-only view, you can fit at least 12 to 15 icons in the same horizontal space. (It almost defeats the purpose of putting them in the toolbar in the first place, but it looks really neat.)

This [image] -click-the-toolbar-button-to-resize-its-icons trick is common to almost all Cocoa programs. You can use the same technique in Mail or Preview, for example.

5.1.7 Adding Separators and Spaces to the Toolbar

Considering Apple lets you drag icons onto your System Preferences toolbar, you'd think they'd give you an easy way to add separators and spaces to create logical groupings, too. Unfortunately, they don't. But no matter: here's a workaround that looks pretty decent (Figure 5-4).

  1. Add all the icons you want onto the System Preferences toolbar and then quit the program.

    It's very important that you quit before the next step, as the program remembers any additions to the toolbar only after you quit.

    Figure 5-3. -click the oblong widget at the top right of the window to cycle between the six styles of toolbar. With each click, the icons get smaller, the text labels get smaller, and finally the icons disappear altogether, leaving only a row of tiny text.

    Figure 5-4. Add divider bars and white space to help organize your System Preferences toolbar.

  2. In the Finder, open your Home [image] Library [image] Preferences folder. Drag and drop the file called com.apple.systempreferences.plist onto the TextEdit icon.

    See Section P.3.5.2 for details on using TextEdit to tweak preference files.

    When the document opens, look for two lines that read:

    <key>TB Item Identifiers</key>

<array>

    This area lists the icons shown on the toolbar. Immediately below these lines is the code for the Show All icon (com.apple.prefpane.showall), followed by everything else you've placed on the toolbar.

  3. To add a separator to the toolbar, insert the following line between the two items you wish to separate:

    <string>NSToolbarSeparatorItem</string>

    Alternatively, you can type the following line to create a space between icons (the space's width depends on how many items you add to the toolbar):

    <string>NSToolbarFlexibleSpaceItem</string>

    Place it between any two items you want to separate.

    You can add as many separators and spaces as you want to the toolbar..

  4. Once you've added your desired separators and spaces, save and close the preferences file.

  5. Open the System Preferences program and admire your fancy new toolbar. (If the changes don't appear, quit System Preferences and reopen it.)

You can rearrange the separators and spaces you added by [image] -dragging them horizontally.

5.1.8 Eliminating the Toolbar

Mac OS X toolbars are cute, but they definitely don't maximize your screen real estate. In fact, they add another inch to every window.

If you'd rather reclaim that space in System Preferences, click the upper-right, white toolbar button to hide the toolbar entirely. At that point, you can still switch from one System Preferences pane to another in any of these ways:

  • Fast: Press [image] -L, the keyboard shortcut for the Show All Preferences command. Then click the icon of the new pane you want.

  • Faster: Choose any pane's name from the View menu. (You never even noticed that menu up there, did you?)

  • Equally faster: Choose the name of the exact pane you want from the System Preferences' pop-up menu in the Dock (hint Section 5.1.4).

  • Fastest: Once you open the View menu, you can choose any preference pane by simply typing the first few characters in its name—Sh highlights Sharing, Ne highlights Network, and so on. Once highlighted, press the Space bar to activate the chosen pane.

5.1.9 Renaming the System Preference Categories

Have you ever felt that you could do a better job of naming the System Preferences category than did Apple? If so, then this hint's for you! Although this modification has no effect on speed, productivity, or stability, you might prefer some special names—particularly if you've installed non-Apple preference panes, like TinkerTool or SharePoints, that get lumped into the Other category. You could change Other to Custom Panels, for example, as shown in Figure 5-5.

Figure 5-5. If "Other" doesn't strike you as particularly informative, an easy edit will let you rename the bottom System Preferences category label (and others, too).

  1. Quit System Preferences, open Terminal (Section P.3.5.3), and type the following (pressing Enter after each line):

    cd "/Applications/System Preferences.app/Contents/Resources/English.lproj"

sudo cp NSPrefPaneGroups.strings NSPrefPaneGroups.bak

sudo cp NSPrefPaneGroups.strings ~/Desktop/MyPrefs.strings

    The cd command opens the System Preferences software bundle and directs Terminal's attention to the folder that contains the file you want to modify.

    When you enter the second command, Terminal asks for your Administrator account password. The first sudo line creates a backup of the preference pane groups file, just in case something goes wrong. The second line copies the file to your desktop, so you can edit it from the Finder.

    Why edit the file from the Finder, you ask? Well, the NSPrefPaneGroups.strings file is in Unicode format (hint Section 4.4.5), which you can't easily open using any of Mac OS X's Unix text editors (like pico or emacs). You can, however, open the file in programs like TextEdit, BBEdit, or Property List Editor.

  2. Drag the MyPrefs.strings icon from the desktop onto the TextEdit icon (located in your Applications folder).

    Your goal is to change the words on the right side of the file, not the left. To be perfectly clear, don't touch "addons," "DigitalHub," and so on.

  3. Rename the Other category so that it's something more pleasing.

    Highlight the text next to "addons"—leaving the quotation marks in place—and type the new name for this category.

    Change any of the other category names you want and then save the file. When you try to save, you'll receive a warning informing you that the file is read-only and offering the choice of Overwrite or Don't Overwrite. Utilizing your superpowers (actually, just your administrative powers), click the Overwrite button to force Mac OS X to save your changes.

  4. Return to the same Terminal window.

    Type this (and then press Enter):

    sudo cp ~/Desktop/MyPrefs.strings NSPrefPaneGroups.strings

    This industrious command copies the file from your desktop back onto the System Preferences program bundle, renames it, and hands its ownership back to Mac OS X.

  5. Open System Preferences and marvel at your new category names.

    If System Preferences is misbehaving, quit it and return to Terminal. Make sure Terminal is focused on the correct folder by repeating the very first cd command in step 2, and then type this (followed by Enter):

    sudo cp NSPrefPaneGroups.bak NSPrefPaneGroups.strings

    This command overwrites the bad file with your good backup and also leaves the backup in place in case you have any future editing problems.

Once everything's working, delete MyPrefs.strings from the desktop.


5.2 Accounts

As described on Sidebar 1.1, Mac OS X is a true multiuser system. That is, if you set up accounts for each person who uses your machine, Mac OS X can separate and protect everyone's preferences, files, emails, and so on.

Although it may come as a surprise, this feature benefits even solo operators. For one thing, it lets you create a new account strictly for troubleshooting (hint Section 4.6.2).

5.2.1 Limiting Account Privileges

When you've got a machine with more than one account on it—for you, your spouse, your son, and your Turkish exchange student—you may wish to limit peoples' ability to perform certain functions. Things like removing stuff from the Dock, changing the machine-wide System Preferences, burning CDs or DVDs, and running certain programs can all be controlled by you. And let's not kid ourselves: besides protecting Mac rookies from accidentally messing up their accounts, the act of limiting other people's computer powers also provides a cheap thrill.

First, open System Preferences [image] Accounts pane. Select the name of an account holder on the left, and click the Limitations tab.

You can only restrict someone's rights if the "Allow user to administer this computer" checkbox in the Security tab is turned off.

Click the Some Limits button. From here, you can make any of the following changes to the account.

5.2.1.1 Limit the programs

At the bottom of the dialog box shown in Figure 5-6, there's a list of all the programs in your Applications, Utilities, and Mac OS 9 Applications folders (an interesting read in its own right). After you turn on "This user can only use these applications," go make a cup of chai while your Mac scans its hard drive for information on all the programs you've got installed. Once you return, check the box next to each program you'd like to let the individual run, as seen in Figure 5-6. If you're setting up an account for use in the classroom, say, you might well want to turn off access to programs like Disk Utility, iChat, and Tomb Raider.

5.2.1.2 Limit the features

When you first create a Normal account, all of the checkboxes above the master list of programs are turned on. Normal account holders are now free to burn CDs or DVDs, change the icons on the Dock, change their passwords, and view the settings of all System Preferences panes (although they can't necessarily change all of these settings).

Depending on your situation, you may find it useful to turn off some of these options. In a school lab, for example, you might want to turn off the Mac's ability to burn discs (to block kids from making hip-hop CDs while they're supposed to be learning about the periodic table, for example). If you're setting up a Mac for a technophobe, you might want to turn off the ability to change the Dock (so your colleague won't accidentally lose access to his own programs and work).

5.2.1.3 Limit the interface (Simple Finder)

If you're truly concerned about somebody's ability to survive the Mac—or the Mac's ability to survive them—click the Simple Finder tab and turn on the checkboxes that correspond with the programs they're allowed to use.

Figure 5-6. From the Limitations tab of the Accounts window, you can control the capabilities of anyone who uses your system—even down to the level of which specific programs someone may launch.

Suppose you're the lucky Mac fan who's been given a Simple Finder account. When you log in, you'll discover the barren world shown in Figure 5-7. There are only three menus ( [image], Finder, and File), no hard drive icon, and a bare-bones Dock. The only folders you can open, in fact, are in the Dock. They include My Applications (aliases of the applications the administrator approved that are presented on strange, fixed icon view "pages"); Documents (your Home [image] Documents folder); Shared (a folder provided so that you and other account holders can exchange documents); and the Trash.

The [image] menu is really bare-bones: you can only Force-quit, Log Out, and go to Sleep. That's it.

If you're using a Simple Finder account and you'd like to turn it into a Normal one, just choose Finder [image] Run Full Finder. Once you enter your administrator password, the Finder becomes whole again.

Figure 5-7. The Simple Finder doesn't feel like home unless you've got one of those spartan, space-age, Dr. Evil-style pads. But it can be just the ticket for less-skilled Mac people with few options and a basic one-click interface. Remember, every program in your My Applications folder is actually an alias to the real program, which is safely ensconced in the off-limits Applications folder.


5.3 CDs & DVDs

This preference pane controls what happens when you insert various formats of CDs and DVDs.

5.3.1 Make Things Happen at Login

Ever wanted your extra-special copy of Monty Python's Life of Brian to start playing every time you log in? Sure, you could try to create an AppleScript to launch it at login, but that's a lot of work. Like most things, there's an easy way out.

If you hold down the Option key prior to selecting any of the pop-up menus on this pane, you'll get an extra Options menu item at the bottom of the menu, as seen in Figure 5-8. Select it, and you'll see a checkbox for "Perform action at login." Check the box, click OK, and now your logins will conclude with the launching of your favorite DVD (or audio CD or picture CD).


5.4 Date & Time

Your Mac's conception of the current date and time is more important than you think—and much more customizable.

5.4.1 Setting the Time

Your Mac can set its own clock by checking in with an atomic clock on the Internet. However, if you're one of those people who sets your clocks five minutes fast in a thinly veiled attempt to prevent yourself from being continually late, you can set the time manually. (To learn if your Mac is already set up to synchronize its clock with the Internet, choose System Preferences [image] Date & Time [image] Date & Time tab. If Set Date & Time Automatically is on, your Mac will automatically update itself over the Internet.)

Figure 5-8. By holding down the Option key when selecting any pop-up, you'll see the super-secret Options menu item. Really, it should just be labeled Option, as the only choice is to perform the selected action at login.

To manually set the time, open System Preferences [image] Date & Time [image] Date & Time tab, and click to highlight the numbers above the clock. Hit the up or down arrows as needed for hours, minutes, and seconds.

A more entertaining but less precise method of setting the clock is to simply drag the hands on the clock face.

You're only allowed to manually set the time if your Mac is not set to configure its time over the Internet.

5.4.2 Exiting Military Time

If you're frustrated by the Mac displaying 24-hour "military time" on your menu bar (that is, 17:30 instead of 5:30 PM), click the Clock tab and turn off "Use a 24-hour clock."

Note, however, that this setting affects only the menu bar clock, not any other dates (like the ones that indicate when your files were modified in the Finder's list view). To change that universal setting, go to System Preferences [image] International [image] Formats tab, and then click Customize in the Times section. There you'll see the computer-wide "24-Hour clock" and "12-Hour clock" options.

5.4.3 The Menu Bar Calendar

Most of the time, your menu bar clock always shows the current time. When you want today's date, though, just click the time. A menu drops down revealing the complete date. (The menu also lets you switch between digital and analog clock types and provides a shortcut to the Date & Time preference pane.)


5.5 Desktop & Screen Saver

The desktop is the canvas on which you paint the image that expresses your feelings of the moment. It's an emotional mural for your inner child. It's...

OK, enough of that. Basically, the desktop is a wonderful place to slap a favorite photo.

5.5.1 The Desktop Picture

Here's a secret: in the Desktop pane, you can drag almost any graphics file—even a PDF or Photoshop file—directly onto the well (the preview square at the top of the pane, as seen in Figure 5-9). When you release the image, it becomes the new desktop background.

Figure 5-9. The Desktop preference pane lets you use almost any image type as your desktop background. So if you want a reminder why you're working so hard, go ahead and use a PDF of your 2002 tax return as your desktop picture.


5.6 Keyboard

Long-time Mac keyboard advocates have reason to rejoice—Mac OS X is by far the keyboard-friendliest Mac OS ever released. Not only do you have access to the Terminal (Chapter 15), which is about as keyboard-centric as you can get, but the graphic world of Mac OS X now sports a number of features designed to make it easier to manipulate from the keyboard.

5.6.1 Full Keyboard Navigation of Your Mac

Granted, the mouse is a significant invention, but at heart, it's still a rodent. And rodents are pests. In short, the mouse slows you down. So if you'd like to exterminate your mouse and strictly use the keyboard for selecting buttons, navigating lists, and handling other onscreen elements, this hint is for you.

Open System Preferences [image] Keyboard & Mouse [image] Keyboard Shortcuts tab, and activate "Turn on full keyboard access." From now on, pressing Tab will jump you through every screen element that will accept your interaction (as shown by the highlight surrounding each element when you Tab to it). Hitting the Space bar once a screen element is selected is the equivalent of clicking on it with the mouse.

Once you're in a menu, simply type the first few letters of a menu item to jump right to it. Then hit Enter to select it.


5.7 Software Update

Software Update is Apple's way of cleaning up after itself. A window like the one shown in Figure 5-10. appears from time to time, offering to install patches and updates that Apple has recently released.

You can manually check for new updates by opening System Preferences [image] Software Update [image] Update Software tab and clicking Check Now. This pane is also where you can specify how often Mac OS X should check for new updates on its own.

5.7.1 Stifling Irrelevant Software Updates

You may not be interested in installing every update that Software Update proposes, especially if you use a dial-up modem. Maybe you just don't care about a 23-megabyte DVD-burning enhancement or an update to the Dutch language profiles. Yet every time you run Software Update, it will display the updates you declined. Then, when you try to bypass the update screen, it'll ask if you're sure you don't want to install it.

The easy but secret solution to this problem is to highlight the update you aren't interested in, and then choose Update [image] Ignore Update (or just hit its shortcut, [image] -Delete). Mac OS X promptly removes the update from your list.

If you ever change your mind—maybe you decide to learn Dutch after all—you can return the declined item to the list by [image] choosing Software Update [image] > Reset Ignored Updates.

Figure 5-10. Apple's Software Update can help keep your machine's software up to date, which is especially important with the security updates for Mac OS X.

If, for some reason, you'd like a comprehensive list of every update you've installed on your machine, [image] open System Preferences [image] > Software Update [image] Installed Updates tab.

5.7.2 Storing Apple Software Updates

Software Update has another annoyance, too. If you ever reinstall Mac OS X from its original CD or DVD (when you put in a new hard drive or move to a new computer, for example), you'll have to download and install all relevant updates again. With this hint, you can't skip the reinstallation process completely, but you can skip the download step.

Preserving updates on your hard drive is easy enough. Each time Software Update finds updates to install, turn on the ones you wish to install and then choose Update [image] Install and Keep Package, as shown in Figure 5-11. (If you prefer, you could also use Update [image] Download Only, and install the update later at your convenience.)

Later, you can reinstall your downloaded updates by just double-clicking each installer. (The downside: when there are multiple updates that require restarting your Mac, you must restart after each one you install. On its own, Software Update would save up its one restart until all of the updates were installed.)

Figure 5-11. When you download Software Updates from Apple, use this menu command to save a copy of each update onto your hard drive. If you've created a folder for downloads (hint Section 4.3.11), move them there.


5.8 Speech

Ever get tired of typing? Sick of the mouse, too? Want to yell at your computer... and have it respond? If you answered yes to any of these questions, then Mac OS X's speech features are worth a look.

5.8.1 Minimizing the Speech Feedback Window

When you turn on speech recognition (in System Preferences [image] Speech [image] [image] Speech Recognition tab [image] On/Off tab), a small speech feedback window appears and floats over all your programs (Figure 5-12). Like a gnat, this window can get awfully annoying after a while.

Swat it away by double-clicking anywhere above the triangle on the bottom; you just minimized it to the Dock. Once minimized, however, the icon continues to display the volume level it hears.

Figure 5-12. The speech bubble hovers over all other windows, just like the Exposé blob described in hint Section 4.2.1.

5.8.2 Prefix-Free Spoken Alerts

For added fun, you can have your computer announce certain events out loud. Unfortunately, it won't say stuff like, "The American Idol runners-up tour is coming to town!" But it can, for example, tell you when your email program can't connect or when it can't complete a copying operation.

This feature is useful if you like to set your system to do stuff while you're in another room. It's also good when you have more than one machine hooked up to one monitor, and you want to know what's going on with a machine that's running but isn't up on your screen. To turn on spoken alerts, see Figure 5-13.

Figure 5-13. To make your Mac alert you when something's gone awry, choose System Preferences [image] Speech [image] Spoken User Interface tab, and turn on "Speak the alert text," as shown here.

A downside of spoken alerts, though, is that the computer clears its throat by saying something like, "Alert from Terminal" before it reads out the actual error message. (It does so even if you've turned off the "Speak the phrase" checkbox shown at top in Figure 5-13.)

If you'd rather just hear the alert without the prefix, however, you can outsmart the system. Turn on "Speak the phrase," and then click its pop-up menu and select Edit Phrase List. The Alert Phrases dialog box opens; click Add, and in the blank box that appears, type a single space. Click OK, and then select your new blank alert from the pop-up menu (the blank row below "Pardon me!"). Now your Mac's voice is prefix-free.


5.9 Universal Access

The Universal Access pane of System Preferences is, in principle, designed to make the Mac easier to use for people with sight, sound, or motor control challenges. Still, it harbors enough handiness for just about anyone.

5.9.1 Zooming In on the Screen

Sure, the Zoom feature (in the Universal Access preference pane) is helpful to the visually impaired, but its usefulness extends far beyond that one application. Its ability to magnify the screen is ideal for graphic designers trying to see how a certain icon or font is built (pixel by pixel), or for anyone who encounters a Web page with tiny type, or even for people who want to watch online movies. (Enlarged movies are nicely smoothed when you zoom in.)

Open System Preferences [image] Universal Access [image] Seeing tab, and click the enormous Turn On Zoom button at the top. You can now zoom in and out of the screen using the [image] -Option-equals (=) and [image] -Option-minus (-) keystrokes. The magnification focuses on the cursor, and if you move the mouse, the zoom slides over.

Ah, but surely you knew all that. Here's the fancy part: you can make zooming more useful by using the keyboard shortcut to zoom into a specified magnification and then back out to normal. This trick is also useful for magnifying Web pages with tiny, unchangeable fonts.

To turn it on, click Zoom Options and then move the Maximum Zoom slider to some point along the scale. From now on, whenever you press [image] -Option-equals, the screen immediately zooms to the level you set; when you press [image] -Option-minus, it returns to the normal view.

You can use zooms to take close-up screen captures, too. Just zoom in and then use the normal Shift- [image] -3 or Shift- [image] -4 commands to create a screenshot of the zoomed-in image. (See hint Section 4.3.14 for more on screenshots.)

5.9.2 Tappy-Type Sounds

Miss the glorious days of the electric typewriter? Then turn on Mac OS X's Selectric simulator!

In System Preferences, click Sound and turn on "Play user interface sound effects." Then switch to the Universal Access pane.

In the Keyboard tab, turn on Slow Keys, and move its Acceptance delay slider all the way to the right (Short). Confirm that "Use key click sounds" is turned on. Click Show All to activate the changes.

Now start typing and enjoy this sonic blast from the past. (Much to your chagrin, there's enough of a delay to drive you crazy, if you're a reasonably fast typist.)

5.9.3 Modifier-Key Ghost Reminders

The Sticky Keys feature is designed to help people with small or stiff hands press multiple-key shortcuts (involving keys like Shift, Option, Control, and [image]) one at a time instead of all together.

But whenever you press one of these keys, it appears as a symbol on the screen (see Figure 5-14), which can be a handy reminder to almost anyone that the Mac thinks you've pressed one of these keys. On some keyboards, for example, the [image] or Control key may have a habit of sticking down, resulting in all kinds of loopy behavior. With this visual reminder, however, you'll know what's going on.

To make Sticky Keys work, proceed as shown in Figure 5-14.

Figure 5-14. Open System Preferences, click Universal Access, then click the Keyboard tab. Now turn on the master Sticky Keys switch at the top of the dialog box.

Then go to work on the Mac, triggering keyboard commands and enjoying the symbols that appear. (If they obstruct something you're working on, you can even drag them around the screen!)

If you press a modifier key twice, you lock it down. (Its onscreen symbol brightens to let you know.) When a key is locked, you can use it for several commands in a row. For example, if a folder icon is highlighted, you could double-press [image] to lock it down—and then type O (to open the folder), followed by W (to close the window). Press the [image] key a third time to unlock it.

If you'd like to use Sticky Keys only occasionally, turn on "Press the Shift key five times to turn Sticky Keys on or off." Now you can activate and deactivate it at will, without returning to System Preferences.


Chapter 6. Networking

In today's computing environment, no machine is an island. In many homes, having two or more computers is the norm, and it's virtually impossible to find a business of any size that doesn't rely on a network—or at least the Internet—every day. Luckily for you, Mac OS X is the most connectable version of the operating system that Apple has ever produced. You can easily connect your Mac to a wide variety of networks, from simple two-machine hookups to the largest Windows Server environments.

While networking can seldom be described as simple, Mac OS X makes it about as painless as possible. These hints will demonstrate how to be even more productive when networking your machine.


6.1 Making Connections

When it comes to making connections to other individual computers (as opposed to, say, Web sites), Mac OS X offers two different connection methods: a humble little rectangle in the Connect to Server dialog box and the Network icon in the Finder's sidebar. For beginners, having two different connecting options can make networking twice as confusing.

In previous Mac OS X releases, the Connect to Server dialog box was the only connection method, but the Network icon in the sidebar of all Finder windows has now taken over most of those duties. Selecting this globe-like icon reveals the icons and names of all other available computers—Windows PCs, Macs, and so on. Double-click one to bring its login window to your screen. After logging in, the server's icon appears on your machine ready for opening, transferring files, and so on.

If you know a server's address, though, the quickest way is still the Connect to Server dialog box (hit [image] -K in the Finder). This box even lets you save a list of servers you visit most often.

In other words, the Network icon is the best choice if you want to find a computer on your network, but the Connect to Server dialog box is the best choice if you already know the address of the computer you want to connect to.

6.1.1 Speed Up Network Volume Browsing

Do you use column view mode in the Finder? If so, you may be afflicted by a long delay when looking through a folder with hundreds of files in it over a network. While you can't eliminate the delay entirely, this tip will certainly help reduce it.

Make sure you've got the Network browser open in the [image] Finder, then select View [image] > Show View Options and uncheck Show Icon and Show Preview Column. Now, since the Finder doesn't have to show you any unnecessary information for each file, it's much quicker when it's asked to display a list of them—especially over a network.

Unfortunately, you can't set these options on a window-by-window basis, so all column views in your entire Finder will now be icon- and preview-free. If you spend a lot of time working on network servers (especially over slow connections), though, you may find the speed gain is worth the loss of detail.

6.1.2 Location Files for Quick Remote Mac Connections

If you frequently connect to the same Macs on the network, you're probably sick of clicking the Network icon, waiting for the list of servers to appear, clicking the name of the machine you want, and then entering the account name and password. Who needs that kind of hassle?

Thankfully, you can bypass all of these steps by using a location file, which is something like the network version of an alias. It's an icon that, when double-clicked, automatically connects to a particular network machine. Almost any Cocoa program can create location files, and a number of enlightened Carbon programs (like Internet Explorer, AppleWorks, BBEdit, and Entourage) can, too.

Here's how to create one:

  1. Open TextEdit. Type the special connection address into a new document window.

    The connection address is based on this formula:

    afp://username:password@hostname_or_address/volume_name

    Under this scenario, suppose that your account name is sallym and your password is cre8ive, and you want to connect to your iBook. You've determined the IP address of your iBook—that is, its unique network address—by consulting the "Other Macintosh users can access your computer at" line at the bottom of the System Preferences [image] Sharing pane. (It's everything after the "afp://" part.)

    Suppose that you discover that the IP address for the iBook is 192.168.1.140. Finally, let's say you want to connect to your Photos disk. In that case, the complete formula would be this:

    afp://sallym:cre8ive@192.168.1.140/Photos

  2. After typing the network address, highlight the whole thing. Position your cursor within the highlighting, hold down the mouse button for a moment, and then drag the entire blob of text completely out of the window and onto the desktop.

    The result should look something like Figure 6-1 at top—a location file.

    Figure 6-1. If your file doesn't look anything like the icon at top, and instead claims to be a "clipping file" or just raw text (bottom), then the program from which you dragged the text cannot create location files.

    As you can see in the figure, the password is listed right in the name of the location file—not such a great security move. So the very first thing you should do is rename the file; "My iBook," for example, would be an ingenious name. Keep in mind that these shortcuts are very insecure. Someone can uncover your password [image] simply by choosing File [image] > Get Info on the icon in the Finder, and they can easily connect (posing as you) to any server for which you've created an icon. Of course, one of the first rules of security is that once someone has physical access to your machine, there's no such thing as security!

  3. Store the location file somewhere convenient.

    When double-clicked, this location file will automatically connect you to the shared disk or folder in question. So put it somewhere that's especially convenient: on your Dock or on your Finder toolbar, for example. In fact, if you connect to that other computer on a daily basis, you might want to drag it into the System Preferences [image] Login Items list, so it will connect automatically when you log in to your Mac.


6.2 .Mac and iDisk

For $100 per year, Apple's .Mac ("dot mac") service provides a number of benefits, including an "@mac.com" email address, virus protection, backup software, and 100 MB of Internet based storage space called an iDisk.

An iDisk is like a 100 MB hard drive that's accessible from almost any modern computer, anywhere. The iDisk is well integrated with Mac OS X, too. You can see an example of this integration in the Internet System Preferences pane, whose iDisk tab provides information on how much of your 100 MB you've used.

6.2.1 Connecting to the iDisk from Windows

In the old days, you could only access your iDisk from a Macintosh. These days, you can bring your iDisk onto the screen of any computer, even one running Windows or Linux.

The procedure varies by operating system, but the general idea is the same: creating a new "network place" that uses the address http://idisk.mac.com/yourname, where yourname is your .Mac account name.

The easiest method in Windows XP is to download Apple's iDisk Utility for (who would have guessed) Windows XP. You can find this download on the .Mac iDisk page (http://www.mac.com/1/idiskutility_download.html). Once installed, follow the onscreen instructions to access your iDisk.

In Windows 2000, Me, or XP, choose File [image] Open from within Internet Explorer. Turn on the "Open as Web Folder" checkbox, and then type your iDisk's address (http://idisk.mac.com/yourname, where yourname is your .Mac account name). Enter your name and password when asked. When it's all over, your iDisk window appears onscreen exactly as though it's a very slow hard drive.

Now you can summon your iDisk merely by double-clicking its icon in the Network Places folder.

  • Windows XP: Choose Tools [image] Map Network Drive in any desktop window.

  • Windows 2000: Choose Tools [image] Map Network Drive. Click "Web folder or FTP site."

  • Windows Me: Open My Computer. Double-click the Web Folders icon, then double-click Add Web Folder.

In each case, you should now type in this address as the location to add: http://idisk.mac.com/yourname, as shown in Figure 6-2. When you're asked for a name and password, type in your usual .Mac name and password.

After a minute or two, you'll find the icon for your iDisk in the My Network Drives window, sitting there like it's a hard drive attached to the PC. (In Windows XP, for example, it's in the My Computer Network Drives category, called something like "Frank23 on `idisk.mac.com.'")

Figure 6-2. The iDisk is an equal-opportunity file cabinet. You can get to it from almost any kind of computer in the world: Mac OS 9, Mac OS X, Windows (shown here), Linux, and so on.

6.2.2 Use .Mac Slideshow Images as Desktop Backgrounds

One of the cooler features of the .Mac service is the ability to create a public slideshow directly from iPhoto—just select an album and click the .Mac Slides button. After iPhoto finishes uploading your images, you can tell anyone who has Mac OS X 10.2 or newer your .Mac name. Subsequently, they can use your slideshow as their screen saver by selecting .Mac in System Preferences (in the Desktop & Screen Savers pane in 10.3 or the Screen Effects pane in 10.2), as seen in Figure 6-3.

One of the challenges of this feature, though, is trying to find public slideshows to use with it; unless all your friends and relatives are fellow .Mac types, you may find the selection to be quite limited. This is where http://dotmac.info comes in, since it has a section devoted to nothing but public .Mac slideshows (click Browse Slide Shows). Look through the collections, then enter the associated .Mac user name into System Preferences for those you'd like to use.

Viewing .Mac screen savers can be quite relaxing, but your machine must be idle for you to enjoy their benefits. Wouldn't it be nice if you could use some of the images for your desktop background, too? Well, it turns out that you can do just that. Switch to System Preferences [image] Desktop & Screen Saver [image] Desktop tab and click Choose Folder from the list of screen savers. In the resulting dialog box, navigate to your Home [image] Library [image] Caches [image] com.apple.iToolsSlideSubscriptions folder.

Figure 6-3. When you click the Options button in the Screen Saver tab, you can use a public .Mac slideshow as your screen saver by simply entering the associated .Mac user name in the .Mac Membership Name box.

This folder holds all of the public slideshows that you're currently subscribed to, organized by the .Mac user name. Select the name of the user whose slideshow you'd like to see on your desktop, click the Public Slide Show folder, then click Choose. Finally, turn on the Change Picture checkbox. You can now enjoy the public slideshow as an ever-changing desktop image that you can see, even while you work.

Note that you can also copy the images out of the Caches folder to keep them for future use—but be aware of copyright issues. The copyright on the images is owned by the .Mac user who published them, so you can't simply copy their work and use it as you wish. If you want to do anything beyond using it on your own machine, you'll need permission from the original .Mac publisher first!


6.3 Remote Connections

If you've ever turned on file sharing within a small office network, you know the convenience of copying, distributing, and opening files that aren't actually on your machine—all without ever budging from your chair. Now just imagine the convenience of accessing those same files from thousands of miles away via the Internet.

As long as both machines are connected to the Internet at the time, you can do exactly that. File sharing can be a lifesaver when, say, you've left an important quarterly report on your home computer 35 miles away, and you have to present it to your CEO in five minutes.

6.3.1 Long-Distance File Sharing

Here's how to tap into your home-base Mac from another Mac miles away. In this example, the home-base Mac (the one you'll be connecting to) is a Power Mac, and you're on the road with your PowerBook.

  1. Before you leave for your trip, on the Power Mac at home, open System Preferences and click the Sharing icon. On the Services tab, turn on Personal File Sharing.

    Also while you're on this machine, make note of its IP address—its unique Internet address, identified by a string of numbers separated by periods. (You can find your IP address by opening System Preferences [image] Sharing. The IP address appears below the list of checkboxes, where it says, "Other Macintosh users can access your computer at.")

    If your home computer is connected to the Internet through a router, you may have to set the router to send incoming connections specifically to your computer (see the manual that came with it for instructions). Then, instead of noting the IP address of your computer, note the IP address of the router.

    This scheme works much better, of course, if the home-base Mac has a full-time Internet connection to a cable modem or DSL box, for example. If it connects to the Internet via dial-up modem, you'll have to call somebody at home to put it online before you can connect from the road.

  2. Go on your trip. When you need to connect, press [image] -K on the PowerBook.

    The Connect to Server dialog box opens.

  3. In the Address line, type afp://123.456.78.9/ and press Enter.

    Of course, you'll want to substitute the IP address you wrote down in step 1 for the four-number sequence shown here. In any case, the name and password dialog box opens.

  4. Fill in your account name and password, and then press Enter.

    A list appears, showing available disks and partitions.

  5. Double-click the name of the disk whose icon you want to access.

    After a moment, its icon appears on your screen, exactly as though it were sitting a few feet away in your home office. You can open this icon, copy files back and forth, and so on—knowing that things might go pretty slowly.

UP TO SPEED IP Addresses and You

Every computer connected to the Internet, even temporarily, has its own exclusive IP address (IP stands for Internet Protocol). What's yours? Open the Sharing pane of System Preferences to find out. As you'll see, an IP address is always made up of four-number sequences separated by periods.

Some Macs with broadband Internet connections have a permanent, unchanging address called a fixed or static IP address. Clearly, connecting to your home-base Mac from the road is simpler if you have a fixed IP address because you'll always know where to find it.

Other Macs get assigned a new address each time they connect (a dynamic IP address). That's virtually always the case, for example, when you connect using a dial-up modem. (If you can't figure out whether your Mac has a static or fixed address, ask your Internet service provider.)

You might suppose that Mac fans with dynamic addresses can't use any of the remote-connection technologies described in this chapter. After all, your Mac's Web address changes every so often, making it difficult to provide a single, permanent address to your friends and co-workers.

The answer is a dynamic DNS service that gives your Mac a name, not a number. Whenever you go online, these free services automatically update the IP address associated with the name you've chosen (such as macmania.dyndns.org), so that your friends and colleagues can memorize a single address for your machine.

To sign up for one of these services, just visit one of their Web sites: www.dyndns.org,www.dhs.org, www.dtdns.com, www.hn.org, or www.no-ip.com, for example.

You'll also need to download and run a utility called an update client, which contacts your DNS service and keeps it up to date with your latest IP address, regularly and automatically. Check your DNS service's Web site for a list of compatible update clients.

Once you've got a fixed DNS name associated with your Mac, you'll be able to access it from elsewhere (provided it's online at the time) via File Sharing, the screen-sharing program called Timbuktu, or any of several other methods.

If you have a fixed address, you can also pay a few dollars a year to register your own domain name, a bona fide address like www.lowcarbtuna.com. To register one (or to find out if the name you want is already taken), visit a site like www.networksolutions.com.

6.3.2 Secure Shell for Remote Connections

The trouble with Finder-based file sharing, as described in the previous hint, is that the data you send and receive over the connection is not encrypted. In theory, at least, a hacker lurking on the Internet could see the data you're transferring. Finder-based file sharing also requires that you use another Mac to reach your home-base machine.

There is another way, however. A Unix utility called secure shell (ssh) encrypts your data while it's in transit. ssh also allows you to connect to your Mac from any computer that has secure shell—it doesn't have to be another Mac. (For pre-Mac OS X Macs, for example, you can connect using programs like MacSSH or NiftyTelnet ssh, which you can download from www.missingmanuals.com. To find ssh programs for Windows, visit www.versiontracker.com, click the Windows tab, and search for ssh.)

Once you're connected, you can take complete control of the distant Mac. You can copy files, run commands, rearrange folders, or even shut it down, all by remote control.

Securing this level of control is easy. Before you leave on your trip, sit down at the home-base machine. Turn on ssh by opening System Preferences, clicking the Sharing icon, and on the Services tab, turning on Remote Login.

Then, once you're on the road, you can tap into the home-base Mac in either of two ways.

6.3.2.1 The Terminal way

Most people operate ssh from within a program like Terminal by typing Unix commands, as described in Chapter 15.

When you're ready to connect to the machine back home, open up Terminal (in Applications [image] Utilities). At the prompt, type ssh -l username hostname and then press Enter. The program asks for your password and then (after you supply the password) connects to your home machine's Home folder.

You can now do anything you would do while sitting 10 inches away from the machine itself, using Unix commands.

A related program is scp (secure copy). It's very useful because it lets you copy files to and from remote machines using ssh encryption without first initiating an ssh session.

For instance, if you had a file on your home machine's desktop named "hacker_honey.jpg," you could copy it to the Documents folder on your laptop machine with this command, run from your laptop:

scp username@home_mac:/Users/username/Desktop/hacker_honey.jpg ~/Documents/

Replace username with your account name on the home machine, and home_mac with the home machine's IP address (or name).

6.3.2.2 The easy way

If typing cryptic Unix commands isn't your thing, the $29 shareware program Rbrowser (www.rbrowser.com) neatly obliterates that roadblock. It adds a tidy, Finder-like column view so that copying files back and forth is as easy as dragging their icons. There are also freeware alternatives, such as Fugu (http:// rsug.itd.umich.edu/software/fugu) that provide similar services; try them both (or search versiontracker.com for SCP to find other solutions) and use the one that best meets your needs.

6.3.3 Password-Free Secure Remote Connections

When you use the ssh and scp commands, as described in the previous hint, the system prompts you for a password each time you connect. This measure is good for security, but it's not so good for things like backup scripts that need to run unattended.

ssh, fortunately, works with a computer-to-computer recognition system known as public key cryptography. Using a pair of special codes called keys—one on the local computer and another on the remote computer—you can connect the two machines without entering a password.

This method has two disadvantages, though. While the data transfer is every bit as secure as a connection that requires a password, the setup is less so, since a person with physical access to one of the machines can still connect to the other. Therefore, you'll need to decide if the potential risk is worth the convenience of connecting without passwords.

The second disadvantage is that the procedure is somewhat technical, requiring a certain comfort level in Terminal.

This hint explains how to create a password-free ssh connection between a computer at work and one at home. (Of course, the two machines could be anywhere, provided both are connected to the Internet.)

  1. On the work machine, open Terminal (Section P.3.5.3). At the prompt, type ssh-keygen -t rsa and then press Enter. When prompted for a save location, simply press Enter.

    The program asks you to supply a passphrase; if you do so, you'll be asked to provide that passphrase each time you connect. Since that would defeat the purpose of this exercise, just press Enter twice (the second one confirms the blank passphrase).

    The program then generates some gunk like this:

    Your identification has been saved in /Users/username/.ssh/id_rsa.

Your public key has been saved in /Users/username/.ssh/id_rsa.pub.

The key fingerprint is:

b4:3f:0a:52:d3:4f:52:ba:f2:d6:54:d6:32:b1:12:54 user@localhost.

    You now need the public key that was saved in .ssh/id_rsa.pub.

  2. Type cat ~/.ssh/id_rsa.pub (and then press Enter) to make Terminal display the public key, and then use the mouse to select the text of the entire key as it's displayed onscreen. Press [image] -C.

    You've just copied the key to the clipboard.

  3. Connect to your home Mac using the ssh command described in the previous hint, and then type cd ~/.ssh (followed by Enter) to switch to the ssh directory.

    That's the directory (folder) that holds the key files that ssh uses to authenticate when you connect remotely.

    Before proceeding, make sure you're in the .ssh directory by typing pwd. (It'll display the directory you are currently in.)

  4. Type the following line, pressing [image] -V between the single quote marks, in order to paste in the public key you copied in the previous step:

    echo '[

-V]' > authorized_keys2

    This command will overwrite the authorized_keys2 file if it already exists. Type ls autho* to see if you have such a file before executing the above command. If you have an existing file, replace the ">" with ">>" in order to append, not overwrite, the new key.

    Press Enter.

    Terminal creates a text file named authorized_keys2 (if necessary), which holds the public keys of the machine from which you will be connecting.

  5. Type exit to disconnect from your home Mac, and then try your ssh command again.

    This time the system doesn't prompt you for a password. Similarly, it allows you to use scp without a password.

    Just remember that anyone with physical access to the local machine will also be able to gain access to the remote machine. (For some security, you can set up the Mac's screen saver to require a password so that intruders can't get into it when you're away from your desk.)


6.4 File Sharing

The Mac's file sharing feature revolutionized computer-to-computer networking. It gave Mac fans the power to create folders that were visible to other people on the network with a few simple mouse clicks and without a computer science degree. Mac OS X continues the tradition of easy Mac-to-Mac networking.

6.4.1 Monitoring File-Sharing Activity

If you suspect a hacker is infiltrating your machine, or if you've established an FTP server and you're just curious about who's using it, you might want to track file-sharing activity. This hint tells you how to turn on Mac OS X's secret activity monitor.

Open the Terminal, and type cd /Library/Preferences. Changes made here in the global Preferences folder affect the entire system, so you'll need to use sudo to make the required changes.

Type sudo pico com.apple.AppleFileServer.plist to launch the pico text editor and open the file sharing server's preferences file—once you enter your administrator password. Just below the first <dict> tag, you'll see these lines:

<key>activityLog</key>

<false/>

Using the arrow keys on the keyboard, move down to the end of the <false/> line and use the Delete key to erase the word false. Type true, so that the final line reads <true/>, and then hit Control-O to save your changes. When the file name prompt appears, hit Return, and then hit Control-X to exit pico. You've just flipped the master switch to turn the activity monitor on.

Now open System Preferences [image] Sharing [image] Services tab and turn off Personal File Sharing (if it was already running). Then turn it back on.

You now have a tool that tracks file-sharing activity as it occurs by writing it out in little text files known as logs. You can find the logs by opening the Library [image] Logs [image] AppleFileService folder; inside is the text file called AppleFileServiceAccess.log.

You can, of course, read these logs using a word processor or simple text editor such as Text Edit. However, one of the most convenient ways to read them is through a program called Console (in Applications [image] Utilities). Once you've opened this program, choose File [image] Open Quickly, and then navigate through the submenus to /Library/Logs AppleFileService [image] AppleFileServiceAccess.log. A window opens that lets you watch in real time as the system tracks activity on your file server, as seen in Figure 6-4.

Figure 6-4. Once you've turned on AppleShare logging, it's easy to use the Console application to see exactly who is doing what to your machine while they're connected.

To disable logging, just re-edit the com.apple.AppleFileServer.plist file and change the true back to false. Save your changes and restart File Sharing to disable logging.

6.4.2 Sharing Folders with Other Mac Users

File sharing in Mac OS X is notable for its reliability and security—but not for its flexibility. The File Sharing switch in Mac OS X is an all-or-nothing master switch that permits Administrator account holders access to your entire machine, and Normal account holders access only to the Public folders of each home folder. Consequently, there's no simple way to designate, say, the Fourth-Quarter Results folder on your desktop as available to all account holders on the network.

The simplest solution is a little donationware program called SharePoints, available at www.hornware.com/sharepoints. It's a must-have networking application if you frequently share your Mac with other people on the network, as it lets you make any folder available on the network and offers you complete control over who's allowed to access it.

SharePoints can run either as a standalone program or as a new pane in System Preferences. Either way, once you've opened it, click the Normal Shares tab. Next, fill in Share Name (short for shared folder name); set permissions for the Owner, Group, and Everyone; and choose a folder to share. Figure 6-5 illustrates a typical shared-folder setup.

Figure 6-5. This MP3 collection has been set up as "music2" (the name that other Macs will be able to see), pointing to the folder /Volumes [image] mp3land [image] iTunes. It's got read and write permissions for the Owner and the Group (most of the time, just you), and read access for everyone else.

Permissions settings allow you to govern exactly what each person is allowed to do with this folder—whether they can add files to it, for example. The settings apply only to the selected folder, though—not to any folders inside it.

Make sure to set either (or both) AppleFileServer (AFS) Sharing or Windows (SMB) Sharing to Enabled. That way, both Macs and PCs can access your new shared folder. After everything's set up right, click Create New Share to both create the share and make it instantly accessible on the network. If you want to make sure the sharing worked, go to another machine on your network, connect as a guest to the first machine, and look for the new shared folder.

SharePoints also allows you to create "file sharing only" accounts. These are special user accounts that don't actually have a Home folder and can't connect to your Mac remotely. On the flip side, they're terrific when you want to let somebody into a folder without going to the trouble of creating a full account. You can also use SharePoints to more easily perform tasks like turning on file-sharing logs (hint Section 6.4.1) and disallowing sharing in your Public folder (hint Section 6.4.3). See the documentation that comes with SharePoints for more information.

6.4.3 Unsharing Your Public Folder

Every Mac OS X account comes with a Public folder—a folder that's available to anybody on the network, making it an ideal place to distribute files to your co-workers. While public folders don't really present much of a security risk, you can nevertheless prevent others from reaching your Public folder if you like your machine sealed tight (see Figure 6-6).

Figure 6-6. Left: When you choose No Access, nobody on the network can access your Public folder. This setup was designed for the private type who doesn't like to share.

To do so, highlight the Public folder (in your Home folder) and then choose File [image] Get Info ( [image] -I). When the Get Info box appears, click to expand the flippy triangle next to Ownership & Permissions.

In the Group section, change the Access menu to No Access. Do the same for the Others menu, as shown in Figure 6-6. Your Public folder is now private.

6.4.4 Finding Your Ethernet Address

Sometimes when you contact tech support or when you set up a networkconnected gadget, you're supposed to reveal your Ethernet address. (It's also referred to as your MAC address—not to be confused with your Mac's address, which is probably where you sit all day.) And unlike your street or email address, it's probably not on the tip of your tongue.

Ethernet addresses consist of six, two-character pairs, which aren't typically easy to find or memorize. But Apple, in its infinite wisdom, makes finding and copying them a snap.

Open System Preferences [image] Network. Select Built-in Ethernet from the "Show" pop-up menu, and then click the Ethernet tab. Your Ethernet address is labeled Ethernet ID near the top of the window. See Figure 6-7 for instructions on copying it.

This MAC address applies only to your Ethernet connection, though; your AirPort card (if you have one) has a separate and distinct address. To locate it, just choose AirPort from the "Show" pop-up menu in the Network pane of System Preferences and select the AirPort tab. The address is right next to "AirPort ID."

Figure 6-7. If you need to use your MAC address in an email, say, triple-click to highlight the address (yes, triple-click!), Control-click the selection, and use the shortcut menu to copy it onto the clipboard, as shown here. -V pastes it into a document.


Chapter 7. Mail

For your communications pleasure, Mac OS X comes with a free email program bearing the rather unoriginal name Mail. It has a number of subtle behaviors and hidden features that will make you squirm with delight—once you know about them. Read this chapter to get better acquainted with the program.


7.1 The Mail Window

Unlike most email programs, Mail lets you keep open as many viewing windows as you like. While it seems odd at first, you'll soon grow to appreciate having a "search" view, "just my important stuff" view, and "normal" view of your mailboxes simultaneously. Read the rest of the hints for more inside info.

7.1.1 Moving the Mailbox Drawer

The Mail drawer is a sliding panel that holds the various folders into which you file your messages (see Figure 7-1).

Figure 7-1. If you can't see the Mail drawer (indicated at right by the cursor), make your window smaller and verify that the drawer is not hidden. Shift- [image] -M hides and unhides it.

On most Mac OS X machines, the drawer sits on the right side of the window since that's where it starts out. But there's no reason to leave it there if you prefer it on the opposite side.

To make it swap sides, center the window on the screen (drag it by the title bar). Then—here comes the weird part—drag any email message toward the opposite side of the Mail window. The drawer switches sides as you near the opposite edge (if there's room on the screen for it). Lastly, release the mouse before you file the message in another mailbox.

7.1.2 Customizing the Columns

When you set up your Mail program, don't miss the View [image] Columns menu. It lets you choose which columns the program displays, including some useful ones that start out hidden.

For instance, you might want to see whether a message has any attachments—and, if so, how big they are. If you turn on the corresponding columns, as shown in Figure 7-2, you'll see all this information before you even open the message.

Figure 7-2. By adding the Attachments and Size columns to your Mail views, you can see at a glance that, indeed, it was Uncle Ed sending you yet another 5 MB attachment that slowed the downloading of your mail.

7.1.3 The Drawer's Shortcut Menu

If you select a folder or mailbox and then Control-click the drawer, a menu appears with a bunch of useful options (Figure 7-3). All of these commands are duplicated in the main menus, but you can reach them much more directly through the shortcut menu.

You can also access this menu from the gear-shaped button at the bottom of the drawer.

Figure 7-3. If you turn on Use Small Mailbox Icons, you can save some valuable vertical space. This menu also provides a quick way to empty deleted messages from the Trash.

7.1.4 Mousing to the Activity Viewer

Want to watch the progress of a large download or upload? Mail has a little-known progress dialog box called the Activity Viewer. The unwashed peons open it by choosing Window [image] Show Activity Viewer ( [image] -0). But you, the power user, can open it with one secret click. Figure 7-4 explains how.

Figure 7-4. If you click near the right end of the bar, just below the toolbar, the Activity Viewer appears in the foreground. Click the same spot again to leave it open and return to the Mail window. Click a third time to close the Activity Viewer.

7.1.5 Intelligent Searches

Mail's Search function lets you track a certain message in either the currently selected folder or in all of your folders at once. Searching is easy if you're looking for a one-word term like "anniversary" or "platypus." But what if you want to find a reference to "dog food"?

If you type that phrase in the search box without any quotation marks or other characters, Mail finds all messages that contain either "dog" or "food." You receive a slew of messages about appointments with the vet and restaurants you've tried, but you may not spot the one recommending a particularly nutritious kibble.

To force Mail to search for the entire phrase, put quotes around it. Hence, if you type "dog food" the program will look only for messages that contain that exact phrase.

You can get even fancier and use keywords like and, or, and not to limit searches. If you search for golf and (par or birdie), for example, Mail looks for messages that contain the word "golf" and either "par" or "birdie." Similarly, if you search for lunch not (free or cheap), Mail returns only messages that discuss expensive lunches.

For more information on advanced searches, check out Mail's Help files.

7.1.6 Speedy Searches

If you don't require the full power of advanced searches as explained in the previous hint, try this quick timesaver: select a message that matches your criterion before starting your search. When you have a message selected in the main window, the Search box will automatically fill itself in appropriately.

Activate the Search pop-up menu by clicking on the magnifying glass and then select From, To, or Subject from the pop-up (in either the current folder or across all messages). If you select a message entitled "Schadenfreude" before selecting Subject from the pop-up menu, the Search field will automatically fill itself in with your email's strange headline.

7.1.7 Apple's Mail Development Team

If you spend 23 hours a day in front of Mail, you may be pleased to learn that your machine holds pictures of the members of Apple's Mail development team. Or, if you don't, you may consider this secret akin to a virus. It's your call, but this hint explains how to find them.

In the Finder, open your Applications folder. Inside, Control-click the Mail program's icon. From the shortcut menu, choose Show Package Contents; in the resulting window, open the Contents [image] Resources folder. Inside you'll see an extremely rare example of a Mac OS X Easter egg: a collection of eight pictures—the individual cuties behind Mail—that open up in Preview or your favorite graphics program. Just double-click senders.tiff to see their images.

These pictures aren't mere egocentric fluff, however. If you ever happen to receive an email from one of the team members, his or her photo automatically appears in the message window.

7.1.8 Rewriting Mail, the Program

When you're feeling overwhelmed by work (or so underwhelmed that you're looking for something to do), you might enjoy hacking the underlying files that comprise the Mail program. Using these simple techniques, you can change the text that appears on buttons, dialog boxes, and error messages.

As with any hint that modifies a program, you'd be well advised to make a backup of Mail (Option-drag it out of your Applications folder) before you crawl under the hood. Note, too, that these hacks require an Administrator account (Sidebar 1.1).

  1. In the Applications folder, Control-click the Mail program's icon. From the shortcut menu, choose Show Package Contents. In the new window that opens, open the Contents [image] Resources [image] [image] English.lproj folder.

    You find yourself facing a list of technical-looking files that only a programmer could love. (See Section P.3.5.1 for details on Mac OS X's unusual packaging system.)

  2. Use TextEdit to open the file called Compose.strings.

    That is, drag the Compose.strings icon onto the icon of TextEdit (see Section P.3.5.2 for details).

    As you scroll through this file, you'll see each entry described in plain English via a phrase between these marks: /* */. These comments let you know what you're about to change—"/* Message of alert sheet shown when the user tries to close a compose window that hasn't been sent or saved */," for example.

  3. Edit the little blobs of text between the quotation marks to suit your sense of humor.

    When making modifications, be careful not to change the left side of any command (to the left of the = sign); modify only the right (see Figure 7-5).

    For example, to modify the message that appears when you change an email from rich text (that is, formatted text) to plain text, change this line:

    "MAKE_TEXT_PLAIN" = "Make Plain Text";

    ...to look like this line:

    "MAKE_TEXT_PLAIN" = "Use Boring Text";

  4. Close the window and save your changes. Use TextEdit to open the file called Localizable.strings and edit it, too.

    The icon called Localizable.strings is in the same folder as the Compose.strings file. This file, too, has handy comment lines, but it contains even more onscreen goodies you can modify.

  5. Once you've made all your edits, save the files, and then open Mail to review your changes.

    If anything went wrong, replace your Mail program with the backup you made at the beginning of this hint.

Figure 7-5. Read the alert message carefully (top). If you find the normal Mail messages boring, you can easily make them much more entertaining. Open the Compose.strings file (lower right), sharpen your wit, and create your own customized Mail masterpiece!


7.2 Reading Mail

Mail is...well, a mail program. You'll probably spend most of your time reading, filing, replying to, and deleting mail.

7.2.1 Leaving Messages Marked as Unread

Mail marks new, unread emails with a blue dot to make them stand out from others in your Inbox. However, as soon as you click a marked message, its blue dot vanishes. Then if you accidentally click the message without reading it, it can get lost in the Inbox underbrush.

Making a message return to its unread state, though, is easy enough. Just control-click it and, from the shortcut menu, choose Mark as Unread.

Conversely, if you'd rather teach Mail to quit marking messages as read until you've really, truly read them, you must sacrifice the preview pane (the lower window area that displays the text of a selected message). To do that, drag the horizontal divider bar off to the bottom of the main window until the preview pane disappears (see Figure 7-6).

Figure 7-6. The preview pane is the lower half of this screenshot—it lets you read your mail messages without opening a new window. However, it also has the side effect of marking any unread messages as read when you click them in the upper half of the window. If you'd rather not have that happen, double-click the divider bar that separates the preview pane from the message list so the preview pane disappears.

Messages now retain their little blue dot until you double-click them to open them in a new window.

7.2.2 A Little Privacy, Please

Whenever you delete a message, the highlight bar automatically moves to the next message, thereby revealing its contents in the preview pane.

If your co-worker or cat is spying on you, though, and you'd rather not reveal the next message, press Option-Delete instead of the Delete key alone. This makes the current message head to the Trash, but the highlight line disappears to leave you with a blank preview pane.

7.2.3 Remove Junk Mail Without Viewing It

If you use Mail in its typical setup, you've got a list of messages at the top of the window and a preview pane below that. The preview pane lets you see the contents of the message without having to open it in a new window, which is very convenient.

What's not so convenient is when you click that "Sizzling Hot Webcams!" piece of spam. Even if you're only clicking it so you can then click the Junk Mail button, as soon as you click once, you're immediately subjected to whatever written and visual niceties the spammer decided to include, courtesy of the preview pane.

Instead, the next time you see an obvious piece of junk mail, don't click it—just drag the message to your Junk folder. If you then open the Junk folder, you'll notice that the message still has its unread status. The next time you empty the Junk Mail folder, Mail will update its spam-sniffing algorithms and future like-minded messages should be automatically junked.

For this hint to work, you must set the spam filter to automatic mode (in Preferences [image] Junk Mail, set "When Junk Mail arrives" to "Move it to the Junk mailbox").

7.2.4 Force Messages into Plain Text Mode

When email was still a fresh, new thing (you know, about 15 years ago), all messages were sent in "plain text" mode. A plain text message contains no graphics, sounds, different font faces, colored backgrounds, or any other distractions—just the message, typically displayed in a typewriter-looking monospaced font such as Monaco. Only as email matured would it gain the aforementioned distractions (marketers call them "enhancements").

If you prefer your email the way the Net intended, you've probably searched Mail's preferences high and low for a plain text-only setting but come up empty-handed. The closest you can come is to turn off the "Display images and embedded objects in HTML messages" setting in the Viewing section of Mail's preferences. (This setting is also an effective way to make sure that spammers can't use embedded images to collect information about your Mail viewing habits. Embedded images can be used to verify that you have opened their message, thereby insuring a continued flow of spam into your inbox.)

It turns out, though, that you can force nearly all your inbound messages into plain text mode. Make sure Mail isn't running, then launch the Terminal (Section P.3.5.3) and type:

defaults write com.apple.mail PreferPlainText -bool true

When you launch Mail again, you'll find that most of your messages are now displayed in glorious plain text. The only exceptions will be messages that are sent with only HTML content. When you think about it, since there's no plain text alternative, there's no way Mail can force a plain text display.

If you ever feel like rejoining the modern era, quit Mail, launch the Terminal, and repeat the above command, but replace true with false.

7.2.5 Messages in Other Formats

HTML messages are those that have been sent to you—most often by junk emailers, but occasionally by misguided ordinary individuals or companies—with formatting (funky fonts, underlining, background graphics, and so on) rather than just plain text.

If you receive an HTML-coded message that you find unreadable as a result (Figure 7-7), click its name once in the list. Then choose View [image] Message [image] Plain Text Alternative ( [image] -Option-P).

Mail instantly strips out the HTML formatting, leaving only the text of the message (Figure 7-7, middle). Well, at least it does this most of the time. Some people don't send their messages with plain text alternatives, so Mail has nothing to display instead.

If you're a sleuth, you may want to try the related View [image] Message [image] Raw Source command ( [image] -Option-U). See Figure 7-7 at bottom for further detail.

Figure 7-7. Top: An HTML message with an obnoxious font.

When using these commands, you're not permanently scarring the message. The view you specify hangs around only as long as you leave the message selected. If you click out and then back into the message, it reverts to its original HTML format.

7.2.6 Copy a Portion of a Hyperlink

Mail automatically parses Web site addresses (URLs, short for Uniform Resource Locators), such as http://www.apple.com, into clickable links. Most of the time, that's exactly the behavior you'd hope for, since now while reading an email, you can just click a link to visit the referenced site.

Sometimes, though, you might want to copy a portion of the URL instead of the entire thing. For instance, if someone sends you the URL for a specific page within Apple's Web site, you might just want to copy and paste the "www.apple.com" portion for use in another document. One solution is to click the link, let it open in your browser, and then copy and paste the piece you want from the browser's address bar. An inelegant solution, and it takes far too long.

A much better way is to just hold down the [image] key. Although the cursor will still turn into a pointing finger when you mouse over a URL, you'll be able to click-and-drag to select just the portion you want. Once you've done so, simply hit [image] -C to copy it to the clipboard, and paste it into the program of your choice.

7.2.7 Pop-Open Folders

If your Mail drawer houses many folders and subfolders, your list of mailboxes can stretch out of the drawer, forcing you to scroll down when you want to file something at the bottom.

To eliminate the scrolling, just leave the folders closed all the time. Then, whenever you want to file a message, drag it directly onto one of your main folders without releasing the mouse. The inner folders suddenly pop open, as shown in Figure 7-8. Once you release the mouse, the subfolders clam back up.

Figure 7-8. Subfolders present a wonderful way to organize your mail, but they can quickly grow beyond the size of your Mail window. Luckily, Mail offers a form of spring-loaded folders, so go ahead and leave your subfolders closed. When you need to file an email, just drag it over a closed folder (left) to make the subfolders open, allowing you to file the message in the folder of your choice (right).

7.2.8 Quickly View an Email Reply

Want a quick way to see what you sent when you replied to an email? In the main Mail window, messages that you have replied to are shown with a light gray rounded arrow in a left-side column. If you mouse over one of these gray arrows, it will highlight to indicate that it's actually a clickable button, as seen in Figure 7-9.

Figure 7-9. The light gray arrows next to certain messages indicate that you've sent a reply to that message. To quickly see what you sent, just mouse over the arrow and click; your reply will appear in a new window.

7.2.9 Mail from Multiple Mailboxes

The little Mail folders designed for housing your messages are absolutely perfect for organization. The only trouble is that once your Mail is scattered to the four winds (or the 40 folders), hunting down a certain message takes much longer since you have that many more places to look.

Fortunately, a little-known secret easily overcomes this challenge so you can view the contents of several folders simultaneously. The trick is to [image] -click the folders you want to open. The full contents of all the folders now appear in the main window in a glorious, merged list, as seen in Figure 7-10.

This technique is particularly useful when you can't remember where you filed a message. Once you've [image] -clicked a few candidate folders, you can use the Search box to look through only those folders.

If you get lost in this combined view, use the View [image] Columns [image] Mailbox option to display the name of each message's home mailbox.

7.2.10 View Complete Conversation Threads

Threading is a new Mail feature that makes it easy to follow an entire email conversation. Here's how it works: the original email will appear as the first item in a list with all replies shown in order below, regardless of any unrelated emails that may have arrived in the interim. For instance, if you subscribe to multiple mailing lists, threading is a great way to watch the conversation flow. Turn on threaded views by choosing View [image] Organize by Thread.

Threading can be a useful tool even if you're not a big mailing list subscriber, especially if you use the multiple-mailbox trick explained in hint Section 7.2.9. Select your main mailbox, then [image] -click your Sent Items folder. As explained in the last hint, you'll now see all messages from both mailboxes. Furthermore, with threaded viewing, you can see not only messages from your contacts, but also your replies to their messages grouped together.

Figure 7-10. The selected folder names have unread mail in them. OK, but how are you supposed to view all of the new messages at once—click one folder at a time? Instead, select all the folders by [image] -clicking them.

Obviously, this trick isn't restricted to just your main mailbox and Sent messages; [image] -select any number of mailboxes where you know you have related messages stored, and the threading feature in Mail will pull them together into a sequential list for you.

7.2.11 View Messages by Thread Without Using Thread View

Even if you don't turn on threaded mail views (see previous hint), you can still take advantage of threading when browsing your mailboxes. For instance, if your inbox contains 10 messages from your uncle Fred, all part of the same conversation, you can easily view just those messages. How, you might ask?

It's simple: Hold down [image] and Option, then use the up and down arrows to move among the messages in a thread. (Mail will beep if you try to go past the first or last message in the conversation.) That way, even if your messages aren't organized by thread, you can still navigate as if they were.

7.2.12 Delete Messages on any Schedule

In the Accounts section of Mail's preferences, the Special Mailboxes tab lets you specify how often you'd like to empty the Sent, Junk, and Trash mailboxes for each account. Unfortunately, there aren't many choices: once a day, once a week, once a month, never, or when quitting Mail. But what if you'd prefer different intervals, such as two weeks for trashed messages and three weeks for sent messages? With a bit of editing work, you can easily create your own customized deletion settings.

Make sure Mail is not running and launch TextEdit (or your favorite text editor). Open your Home [image] Library [image] Preferences [image] com.apple.mail.plist file, hit [image] -F to open the Find window, and search for EmailAddresses. This will jump you to your first Mail account's settings. Now scroll down a few lines and you should see something like Figure 7-11.

Figure 7-11. This section of your Mail preferences file controls how long each account retains items in its Junk, Sent Messages, and Trash mailboxes. The numbers represent the number of days to retain the messages. Here, junk mail will vanish after 1 day, sent messages will vanish after 21 days, and trashed messages are kept around for 14 days.

Set the values for NumberOfDaysToKeepJunk, NumberOfDaysToKeepSentMessages, and NumberOfDaysToKeepTrash (in days) to whatever time period you'd like to use. If you have only one email account, save your work when you're done and quit the editor. If you have multiple accounts, search again for EmailAddresses to find your next account and repeat the process. Change all the accounts you want, then save your work and quit the editor.

When you next launch Mail, your new settings will be in effect, even though they won't show up properly in the preferences panel. In fact, if you change the settings in the Special Mailboxes tab of the preferences for just one setting, you'll lose your customized timing on all of your accounts.

7.2.13 Deleting Messages in a Completely Unexpected Manner

Mail has a number of ways to delete a message: hit Delete or [image] -Delete, use the Edit Delete menu item, or click the Delete button on the toolbar. Oh, here's one more you probably didn't think of: just pick the message up and drag it to the Trash on the Dock!

One downside to this method is that you may, depending on your Dock's location, move your mail drawer from one side to the other while dragging to the Trash. See hint Section 7.1.1 for the solution.

7.2.14 Preserving Your Junk Mail Brains

Over time, clicking the Junk or Not Junk buttons for the hundreds of messages that enliven your life teaches Mail quite a bit about what's spam and what's not, in your opinion. Fine, but what are you supposed to do if you upgrade to a new Mac or add a laptop to your arsenal? Leave all of that manually input intelligence behind?

All you have to do is open your Home [image] Library [image] Mail folder and rescue the LSMMap2 file inside it. That single icon represents all of the training you've ever given Mail about spam.

On the new machine, open Mail, set up your accounts, and choose Mail [image] Junk Mail [image] [image] Automatic. Then quit the program, copy your LSMMap2 file into your Home Library Mail folder, and make sure you've replaced the LSMMap2 file that's already there. Brain transplant complete!

7.2.15 Change Mail's Sounds

Mail allows you to specify which sound you'd like to hear when you receive new mail, including the option of using your own sounds, as explained in the next hint. But what about the sounds you hear at other times: when you send mail, when there's no new mail, and when mail encounters an error? In the General pane of Mail's preferences, you can turn these sounds on and off (with "Play sounds for other mail actions"), but you can't just change them. Or so you might think...

These other Mail sounds are stored within the Mail application bundle. Before you can replace them, though, you need to have some suitable replacements at hand. You can record these yourself or find public domain samples on the Internet. Mail uses AIFF files for these sounds, so you'll need your replacements in AIFF format as well.

Once you've collected your replacement sounds, make a copy of the Mail application in your Applications folder—just in case something goes wrong.

Control-click the original Mail's icon in the Finder and select Show Package Contents. In the new window that opens, open the Contents Resources folder. There you'll see a whole bunch of files, although you're only interested in (at most) three of them—Mail Fetch Error.aiff, Mail Sent.aiff, and No Mail.aiff. To replace these sounds, open a new Finder window showing your new sounds, and rename each appropriately; if you have a new No Mail sound, name it No Mail.aiff, for example.

The final step is to copy your renamed custom sounds into the Contents folder and let the Finder replace the existing files when asked. Launch Mail, then when one of the three conditions is met, you should hear your newly assigned sounds.

If there's a problem, delete Mail and replace it with the backup you made at the beginning of this hint.

7.2.16 "You've Got Mail, O Wise One"

Want to add a bit of interest and excitement to the arrival of new mail messages? How about listening to a British-accented voice tell you, "O master of the universe, new mail has arrived that requires your attention." Thanks to the power of Mail's rules and the AT&T Natural Voices Web site, you can create an infinite variety of customized voice alerts.

Start by visiting www.naturalvoices.att.com/demos, and proceed as shown at top in Figure 7-12.

Figure 7-12. Top: By using AT&T's Natural Voices demo Web site, you can create customized spoken prompts to use when new Mail arrives. Select a language and voice, set the format to AIFF for your Mac, ignore the sample rate, and type the text you'd like converted into the input box.

When you've typed the text you'd like to use, click the Go button. After a slight pause, a new page opens revealing the QuickTime controller. You'll now hear your announcement read aloud.

If it sounds OK, choose File [image] Save As from your browser's menu to save the sound file onto your hard drive (the desktop is a good place). Create as many samples as you want. You might even consider creating a different announcement for each of the people who regularly send you email.

Now, in Mail, choose Mail [image] Preferences [image] Rules. Click Add Rule to open the rule dialog box and enter a name for your new rule (like Announce) in the Description box. To create a rule that acts on every new message you receive, choose Every Message from the From pop-up menu.

If you're creating a rule for just a specific person, enter the email address (or name) in the box next to the Contains pop-up without selecting Every Message first.

At the bottom of the dialog box, choose Play Sound from the Transfer Message pop-up menu and then, from the pop-up menu to its right, choose Add/Remove. A new dialog box opens with Add, Remove, and Done buttons.

Click Add and navigate to the spot where you saved your samples. Double-click the sound you'd like to use for this rule and then click Done.

Now your downloaded sound appears in the pop-up menu (next to the Play Sound pop-up menu). Choose it from the list. The dialog box should now resemble the bottom of Figure 7-12.

Click OK to return to the Rules dialog box. If you've created other rules, drag this new rule below any of those that handle junk mail. This way, your rule will only take effect after spam has been dealt with. After all, with the amount of spam that probably floods your inbox each day, you'd quickly tire of hearing an announcement for each and every special offer direct from the Nigerian embassy.

In any case, your talking Mail program is ready to roll. Each time a new message rolls in, the Mac will speak your specified attention-getting phrase. Adjust the volume to taste, so you'll hear it when you're watching TV, making dinner, or sleeping.


7.3 Sending Mail

Here are some hints to make your time as an email composer much more efficient.

7.3.1 Quoting Portions of Emails in Replies

You may have noticed that when you reply to a piece of mail, Mail automatically quotes the original message in its entirety, as shown in Figure 7-13. It's better email etiquette, however, to quote back only the relevant portion of the message—especially when you're dealing with some long-winded gasbag.

To do that, highlight the relevant section of the message before you click Reply.

If this tip doesn't seem to work for you, choose Mail [image] Preferences. Click the Composing icon and verify that "Include the selected text, if any, otherwise include all" is turned on at the bottom of the dialog box.

Figure 7-13. Your correspondents will be much happier if your replies don't include every single word they originally sent to you. The easiest way to do that is to just select the relevant portion of the original email and then click Reply. Mail will include only your selected text in the reply window (indicated here by the vertical line at left).

7.3.2 Send a Message to an Address Book Group

If you'd like to send an email to a defined group of people from the Address Book, it's about as easy as you think it might be. Just type the group's name into the To field in a new Mail message, and Mail will autocomplete the name as soon as it finds a match. Type the message, hit Send, and you're done...right?

Right, as long as all group members have a valid email address, that is. If one of them doesn't have an email address, though, Mail will post a warning dialog box like that shown in Figure 7-14.

Thinking you're smarter than Mail, you click Send Anyway. A few moments later, you'll most likely receive a second onscreen dialog, this one much worse than the first. It's from your mail server, more than likely telling you that it failed to send your message due to the missing email address.

When you clicked Send Anyway, Mail didn't remove the empty address from the list (which would've been the smart thing to do). Instead, it left just the person's name in the To field; consequently, your mail server still attempted to deliver it. When this delivery failed, the server bounced the email back to you. The net result: no one has received your message!

There is, however, a workaround. In Mail, open a new message, then switch to Address Book. Click and hold on the name of the group you'd like to use, and then drag it back to Mail and drop it on the To field. Thankfully, you can use Exposé to simplify the process: click and hold on the group, hit F9, drag the group onto the new message window, hit F9 again, and drop the group onto the To field.

When used in this manner, Mail is far more intuitive about the groups, leaving out anyone without a valid email address.

Figure 7-14. When sending to a group whose members include at least one person without a valid email address, you'll see this very friendly warning dialog, letting you either Cancel or Send Anyway. Think you know what to do? Go ahead, click Send Anyway, and then read the hint for the outcome and the workaround!

7.3.3 Toggling Between Reply and Reply All

You just typed a reply to a department-wide email, but you mistakenly responded only to the author and not to the whole team. D'oh!

Fortunately, if you haven't sent the message yet, you can recover in an instant. Just click the Reply All icon in the toolbar. Each time you click this button, it toggles between Reply and Reply All, inserting only one address or all recipients' addresses as appropriate. No matter which mistake you make, then, recovering is only one click away.

7.3.4 Resending a Message

You're sailing along, zinging emails to the four corners of the Internet, when you suddenly realize you sent a message to the wrong recipient. While you can't retrieve the first message, you can easily resend it to the proper person—in either of two ways:

  • In your Sent folder, click the message once, and then choose Message Send Again. The message opens with the original recipient, subject, and message. Fortunately, you can change any or all of that and resend it. Now when the message goes out, it will have a new date and time stamp.

  • In the Sent folder, Control-click the message and choose Redirect from the shortcut menu. Assign the proper address to the message that opens and click Send.

7.3.5 Blind Carbon Copy and Reply-To Fields

The organization of the Mail menus isn't always screamingly self-evident. You'd think, for example, that anything related to a message would be located in the Message menu—but it isn't.

The classic example is the Add Bcc Field command. This option is crucial when you want to send a message secretly to a third party. For example, if you're writing your boss to praise a co-worker, and you want that co-worker to learn of your good deed, you might "Bcc" her by typing her address into the Bcc line. The boss's copy of the message won't bear any indication that copy went to the co-worker. However, the co-worker will know that you sent it to the boss.

If you want to add a Bcc field to all your messages (to avoid adding it individually each time), and you look in the Message menu, you'll be searching until the cows come home. Instead, open the View menu, where you'll find Bcc Header (Shift- [image] -B)—albeit grayed out. What's the secret? You can only activate this setting when you're in a New Message ( [image] -N) window. Once you open a new message and select the Bcc Header option, you put a new line on the message (and on all future messages) in which you can type the secret recipient's address.

Incidentally, the Edit menu also offers a command called Reply-To Header (Option- [image] -R). Use this box to type in a different address for any replies to your message. That's a handy feature when, for example, you're sending mail from your work email address but you want replies to go to your home account.

7.3.6 Sending Messages Later

Mail likes to stay on the ball: if you click Send, it promptly tries to shoot your message out into the ether. OK, but what if you want a message to hit the digital road later, perhaps after you leave the office—or, if you're answering email at 39,000 feet, after you land? Although Mail lacks the Send Later option of some other email programs, you can work around it.

After you've received new messages, choose Mailbox [image] Online Status [image] Go Offline. Now proceed with your message-answering session. Each time you compose a message and click Send, Mail stores it in your Outbox without attempting to connect to the Internet.

When you're finally ready to connect, choose Mailbox [image] Online Status [image] Go Online. Once Mail connects as usual, all your stored replies go along for the ride.

7.3.7 Sending a File from the Finder

Most people know of only two methods to add an attachment to an outgoing message:

  • Click the toolbar's Attach icon (which looks a paper clip) and then browse your hard drive for the desired file.

  • Drag the attachment icon right off the desktop or a Finder window and into the outgoing message.

In actuality, there's a much more enjoyable method you can employ. Just drag the file you want to send onto Mail's Dock icon (or its Finder sidebar icon, if you've dragged the Mail icon there). In the blink of an eye, your Mac opens Mail, brings up a New Message window, attaches the dragged file, and deposits the insertion point in the To field. Now that's productivity!

7.3.8 Copying Entire Folders

Mail provides a "Save As" feature (File [image] Save As or Shift- [image] -S), which lets you save a copy of an individual message elsewhere on your hard drive or iDisk. But what if, say, you want to move those 639 emails from your sweetie off your machine at work and onto your iDisk? Mail has no Export feature—at least not that most people know about.

Have no fear. Like everything else, there's a cool workaround. Simply drag the folder you want from the Mail drawer clear out of the Mail window and onto your desktop. As you go, the cursor shows a plus sign, indicating that the Mac is making a copy. When you release the mouse, [Mailbox name].mbox appears on your desktop. You've now got yourself a convenient backup.

Like many Mac OS X programs, the [Mailbox name].mbox file is what's known as a bundle. It may look like a single file icon, but it's actually more like a folder. You can open it, if you like, by Control-clicking the icon and choosing Show Package Contents from the shortcut menu.

To move this mail backup to another machine, you must first burn it to a CD or find some other method to transport it there. Make sure Mail isn't running on the new Mac, then drop the backup into your Home [image] Library [image] Mail [image] Mailboxes folder. (If there's already a mailbox there with the same name, rename your backup first.) When you relaunch Mail, you'll see your backup folder in the "On My Mac" section of your folder list.


7.4 Troubleshooting

Few people run into any problems using Mail. If you do, the following hints may help you work through the issues you're having.

7.4.1 Preventing Mac.com Mailbox Overflow

If you have a Mac.com account—the $100-per-year suite of special Apple features described at www.mac.com—it's a good idea to learn the fundamental difference between its email account and regular email accounts.

Most people with ordinary Internet service providers have a kind of email account called POP (Post Office Protocol). If you have this kind of account, whenever you check your email, it's transferred to your email program and removed from the Internet computer (the server) where it was waiting for you.

If you have a .Mac account, however, you have the more modern IMAP (Internet Message Access Protocol) account. This kind of account is somewhat different: even after you've downloaded your mail, copies of your messages remain on the IMAP server, freeing you from using the same Mac all the time to check your email. You can log onto the .Mac Web page using almost any computer on earth, and you'll still find your entire email collection, neatly sorted and ready to go.

As you can imagine, you must therefore be more diligent about deleting messages when you're through with them. If you don't pay attention, IMAP servers (including those that hold your Mac.com mail) can max out their storage limit very quickly. When that happens, you won't receive any more messages until you create room on the server. Even worse, friends sending you emails will probably receive error messages explaining exactly how your lack of housekeeping skills has caused your mailbox to overflow.

To remove messages from an IMAP server, transfer them to any folder (in the On My Mac section of the Mail drawer) that you've created for mail storage. The IMAP server will remove the messages from its own storage area the next time you check your mail.

7.4.2 Incomplete Message Error

From time to time, you may encounter an error message that shows the header for a previously received email message, but then states that the remainder of the message cannot be read until the account is taken online. More than likely, there's a problem with the index file—Mail's behind-the-scenes email table of contents.

To fix it, highlight the mailbox that contains the problem message and choose Mailbox [image] Rebuild. The system zips through and recreates the index file, repairing any corruptions.

In fact, this is a handy practice for any kind of mailbox eccentricity, as it never hurts anything, and frequently helps.

7.4.3 Diagnosing Opening-Sequence Crashes

If your Mail program crashes when you open it, your Address Book might be responsible.

To find out, open your Home [image] Library [image] Application Support folder. Drag the AddressBook folder onto the desktop. Open Mail now. If it starts without incident, then you have a corrupted entry in your Address Book (just the entry, not necessarily the person it represents).

The only solution is to delete the current Address Book (that is, throw away the folder that you dragged to the desktop in the previous paragraph). The next time you start up Address Book, it'll be empty; you'll just have to add your entries from scratch or restore them from a recent backup (see the tip below).

A more palatable scenario is if you have a .Mac account and you've used iSync to synchronize your Mac with it. In this case, just resynchronize your Address Book with the copy on your .Mac account, and all your contacts will be magically added again.

If you haven't created a backup of your AddressBook folder (in Home [image] Library [image] Application Support), take two seconds to drag the AddressBook folder to another drive or Option-drag it to another folder on the same drive.


Chapter 8. iTunes

iTunes, which sits at this very moment in your Applications folder, is the ultimate software jukebox. It can play music CDs, tune in to Internet radio stations, load up your iPod music player, and play back MP3 files (compact files that store almost CD-quality music) and other popular audio formats.

It can also turn selected tracks from your music CDs into MP3 files, so you can store favorite songs on your hard drive to play back anytime—without having to dig up the original CDs. In fact, iTunes can even load your MP3 files onto certain portable MP3 players. And if your Mac can burn CDs, iTunes lets you make your own custom audio CDs. Heck, it'll even create the CD insert for you, too.

Finally, but perhaps most importantly, iTunes is your entry point to the 99¢-a-song iTunes Music Store, also known as the iTMS.

In order for some of the hints in this chapter to work, you'll need iTunes 4.5 or higher. You can always download the latest version from http://apple.com/itunes/download/.


8.1 Mini Modes

iTunes can run in three size modes: small, medium, or large (Figure 8-1). Here's where you'll find them:

  • Large. This size is what you see the first time you open iTunes.

  • Medium. You can switch back and forth between large and medium sizes by clicking the green zoom button or choosing Window [image] Zoom. Either way, the medium mode is handy for playing tunes in the background while you work without your screen being overtaken.

  • Small. If your desktop isn't big enough for even the medium iTunes window in Figure 8-1, try taking it down a notch. To create the mini-window shown at lower right in Figure 8-1, start with the medium-size window and drag the Resize handle (the diagonal lines in the lower-right corner) leftward. To expand it, just reverse the process.

Figure 8-1. And what size music would you like today? You can choose large (top), medium (lower left), or small (lower right). Only the large version, however, has the space to serve as a command center for Internet radio, visual effects, and the iTMS.

8.1.1 Set the Playback Volume with a Scroll Wheel Mouse

If you have a multi-button scroll wheel mouse, you can easily change iTunes' playback volume in any of the three modes shown in hint Section 8.1—as long as iTunes is the active, foreground application. If your window is in the large mode, move the mouse so it's over the volume slider in the top left of the window. Now move your scroll wheel up (increase) or down (decrease) to change the volume.

This trick is even easier in iTunes' medium and small modes: just make sure your mouse is somewhere over the iTunes window and the volume will change when you scroll the mouse.

8.1.2 Control iTunes in the Background

The previous hint explains how to use your scroll wheel to change iTunes' volume settings; unfortunately, iTunes must be the active application for it to work.

In order to change the volume even when iTunes is in the background, simply click and drag directly on the volume slider. iTunes' volume will change as you move the slider, but iTunes itself won't come to the foreground.

This technique only works in iTunes' small- and medium-size modes, described in hint Section 8.1.

This trick also works for the rewind (previous song), play/pause, and forward (next song) buttons. As long as those are the only buttons you click, iTunes remains in the background.

For the ultimate in iTunes background control, however, consider something like MenuTunes (www.ithinksw.com/products/menutunes), which puts an iTunes controller in your menu bar, or X-Tunes (www.pol-online.net/index.php?page=freeware), which pops up an iTunes controller when you press a predefined hot key. Both of these are freeware applications that give you perfect control over iTunes, even when its window is hidden.

8.1.3 Become an iTunes Power User: Read the Help!

Although Apple's built-in Help system has its faults, it can also provide very detailed information about less obvious features in certain program. Such is the case with iTunes, whose help includes a long page of interesting tidbits and shortcuts.

To find this information, select Help [image] iTunes and Music Store Help. On the main iTunes help page, click Learn About iTunes, and then click "Go to tips." When you do, you'll see all sorts of informational nuggets, including hidden tricks like this one:

"To avoid the message that appears when you insert a blank CD, click the Burn button before inserting the blank CD."

You may also want to visit the keyboard shortcuts page in the "Shortcuts and tips" section of iTunes help. There are literally screenfuls of keyboard shortcuts here.

8.1.4 Reduce CPU Usage on Slower Processors

If you're not fortunate enough to have one of Apple's latest G5s, you may notice that iTunes keeps your processor fairly busy. If you'd like to free up some speed for more important tasks, here are a few things to try:

  • Disable the Sound Enhancer. You'll find this option in iTunes' Preferences [image] Audio pane. Sound Enhancer is designed to "add depth and enliven the quality of your music," according to iTunes help. On the downside, you'll pay dearly in the speed of all your other programs.

  • Disable Sound Check. Sound Check automatically adjusts the volume of each song in your library to be nearly identical. In theory, you no longer need to fiddle with the volume knob each time you switch from listening to Mozart to AC/DC. In reality, it doesn't always work well, plus it stresses your CPU.

  • Disable the Equalizer. The Equalizer allows you to tweak the frequency curves for your music. You can choose from predefined selections such as Rock or Classical to adjust for the differences in the style of music. (You can also create your own settings to suit your listening preferences.) Sound manipulation can really slow other programs down, however; see Figure 8-2 for instructions on how to disable it.

  • Close the iTunes Window. Honestly. You don't need the window to use iTunes. To control playback and volume, consider using one of the freeware tools mentioned in hint Section 8.1.2, or iTunes' Dock menu (hint Section 8.3.1).

If you ever need the window back, just choose Window [image] iTunes.

Figure 8-2. To disable the equalizer, first click the leftmost button in the lower-right corner of the iTunes window, highlighted here with a black circle. When the equalizer window opens, uncheck the On box to turn the equalizer off.

8.1.5 Quicker Resizing

If the visual updating of the iTunes window lags as you resize it, press [image] when dragging the lower-right corner. This way, the rectangle that shows the iTunes window shrinks or grows smoothly and quickly, displaying only an outline while you drag, and then fills in when you release the mouse (Figure 8-3).

Figure 8-3. On slower machines, iTunes is jerky when it comes to resizing the window while you drag. If you hold down [image] when you drag, however, iTunes resorts to the OS 9-style, or outline-only resizing.

8.1.6 The Column Shortcut Menu

When you get right down to it, iTunes is really a database. Its primary view reveals columns of information on all the songs in its virtual head.

Like any good database, you can specify what kind of data you want iTunes to display. As shown in Figure 8-4, iTunes lets you customize the columns of information it shows for each song.

Figure 8-4. When you Control-click any of the existing column headings, a menu lists all of the information columns available to you. Select a column's name to add or remove it (you can't hide the song names, though). If you'd like the columns to resize themselves, choose Auto Size All Columns. But be careful: this command discards any hand-adjustments you've made to the column widths.

8.1.7 Changing the Displayed Play Time

The iTunes Library and your custom playlists both display an information bar at the bottom of the window. This bar displays the total duration and disk-space consumption of the songs in the selected playlist (or Library). It might read something like "1253 songs, 3 days, 7.28 GB."

If you click this text, though, it changes to also include hours and minutes—"1253 songs, 3:12:23:37 total time, 7.28 GB"—handy information for planning party playlists. In this example, the party would last for three days, twelve hours, 23 minutes, and 37 seconds before the music stops and everybody goes home.

8.1.8 Renaming the Library

If you're the type of person who likes naming his socks, you'll be glad to know that you're not stuck with "Library" as the name of your music collection. Just click the word Library (at the top of the Source list) and hold the mouse still for a second. iTunes opens up a renaming rectangle, just like the Finder does for renaming files.

8.1.9 How to Rip Multiple CDs

If you're just starting out with iTunes, you've probably got a huge stack of CDs sitting in front of you, waiting to be inserted, ripped, and then returned to their appropriate jewel cases. Although iTunes can't help you insert the CDs, with a small settings change, it can help you rip them somewhat quicker.

In the General pane of iTunes' preferences is a setting that controls what iTunes does when you insert a CD. iTunes starts out set to simply list the songs on the CD. When you're ripping a large pile of CDs, however, you can save quite a bit of time by changing this setting, as shown in Figure 8-5.

Figure 8-5. If you're planning to rip a bunch of CDs, change this setting to save some time. When you insert the first CD, iTunes encodes all the songs, then ejects the CD automatically when it's ready for the next one.

This hint only helps, though, if you're ripping all the songs off your CDs. If you're only ripping a few select songs, you must go through them one at a time.

8.1.10 Splitting a Song

Imagine how convenient it'd be if you could chop up your songs. You could divide up audio books into easier-to-manage chunks for listing on your iPod. You could split apart those "hidden bonus track" songs on a CD—you know, the ones with five minutes of silence before the hidden song starts. You could even chop out the self-indulgent dialogue that certain artists tack onto the beginning or end of certain songs.

Well, imagine no more. Start by Control-clicking a song in the iTunes list and then choose Get Info from the shortcut menu. Click the Options tab, type the timings you want into the Start Time and Stop Time boxes, and then click OK.

Next, choose Advanced [image] "Convert selection to MP3" (or "Convert selection to AAC" if that's your chosen import format). iTunes creates a new song based on your chosen start and end times.

Even after you've made the split, iTunes keeps the old version of the song around in your Library. Feel free to delete the original, longer version if you prefer the new one.

8.1.11 Fun and Games with the iTunes About Box

This hint will add no value to your use of iTunes.

There's a small Easter egg hidden in the iTunes About box. If you select iTunes [image] About iTunes, you'll see a dialog box scrolling a list of your iTunes version numbers and then a bunch of copyright and trademark notices.

If you're really into this kind of stuff and want to memorize the MPEG license, however, you'll find it quite hard given the speed with which it scrolls by. Luckily, if you hit the Space bar, the scrolling stops. And if you press and hold the Option key, the About box scrolls backward so you can reread the exciting trademark notices you missed.


8.2 The iTunes Music Store

It's fun. It's easy to do. All your friends are doing it, too. While doing it, you feel invincible, like you can have anything you want. It seems inexpensive, but then you realize you've already spent next month's paycheck, even though payday is still two weeks away.

No, you don't have a drug habit. You're just stuck on the iTunes Music Store (iTMS), Apple's completely legal—albeit addictive—way to buy online music.

Yes, yes, the music you download is locked against copying. But the protection is less onerous than that of iTunes' competitors, and the store provides the typical, excellent Apple experience. For now, the store is limited to the United States, France, Germany, and the UK, but it should be available soon in other places.

Here's a collection of hints to maximize the store's benefits.

8.2.1 Change the Behavior of the Gray Arrow Links

The iTunes' store links are those small gray arrows next to each song, artist, and album in your library, as seen in Figure 8-6.

Figure 8-6. These small gray arrows are your direct connection to the iTunes Music Store. Click one, and you'll be taken to the matching entry online, where you can browse (and buy) other tracks from the album.

When clicked, they take you directly to the corresponding entry on the iTMS. These arrows can be annoying, though—especially if you have a slow Internet connection or if you live somewhere where the store is not yet available.

There are two ways around this behavior, one temporary and one permanent. The temporary solution is to hold the Option key before you click a gray arrow. When used this way, the arrows take you to a match in your Library rather than the music store.

Unfortunately, this method requires that you remember to hold down Option each time. If you'd rather have the opposite arrangement (so that clicking an arrow brings you to your Library without having to hold down the Option key), you'll need to tweak iTunes' hidden preferences.

Quit iTunes and open Terminal (in your Applications [image] Utilities folder). Enter the following text and hit Return:

defaults write com.apple.iTunes invertStoreLinks -bool YES

Once you relaunch iTunes, the gray arrows will always take you to your Library (that is, unless you hold down the Option key, in which case they'll take to you the iTMS). If you ever tire of this reversed behavior, quit iTunes and repeat the above command, replacing YES with NO.

If you'd like to eliminate the little gray arrows [image] altogether, simply choose iTunes [image] Preferences [image] > General, and turn off "Show links to Music Store."

8.2.2 View Your Account Information

Once you've created and activated your iTunes Music Store account, you may wonder how to check and edit things such as your mailing address and credit card information. You may also wonder about your purchase history or want to give or redeem a gift certificate. All of these things are controlled on your Account Information screen, but it's not very obvious how to get there from the iTunes Music Store interface.

To do so, click your account name next to the Account label at the top right of the window. After entering your password, you'll see a screen where you can handle all your account management tasks.

8.2.3 Listen to Music While Downloading Videos

From the main iTMS screen, you can click links for Music Videos and Movie Trailers. The problem is, as soon as you start downloading a video, your currently playing tunes stops. If you're on a slow connection, downloading the videos can take quite a while, and you'd probably rather listen to your music than the sound of your computer's fan.

There are two workarounds for this problem. The easiest is to avoid the issue in the first place by opening the iTMS in another window. Do so by double-clicking on the Music Store entry in the Source column of the iTunes window. When you navigate to and begin downloading a video or trailer, the song you're presently playing will still stop. However, when it does, just switch to the main iTunes window and click the Play button; your song will pick up right where it left off.

If you've already opened the store in the main iTunes window, the second workaround is sort of the reverse of the first. This time, double-click any playlist (or your Library) to open it in a new window. While the trailer or video is downloading, switch to the playlist window and click Play.

The disadvantage of the second method is that your playback won't resume; it simply restarts at the beginning of the track.

8.2.4 Save Videos and Trailers After Viewing

The iTMS movie trailers and music videos are often high-quality, large videos that can be fun to watch repeatedly. However, the way the store works, once you've downloaded and watched a video, it's basically gone. If you want to watch it again, you'll have to download it again, and there's no apparent way to save it.

Downloaded videos and trailers, however, are actually stored for a while on your hard drive. They're in a hidden folder that gets erased each time you reboot your machine. With the help of AppleScript, you can copy these videos from the hidden folder to your desktop, making it easy to keep them for future viewing.

Open Script Editor (in Applications [image] AppleScript), and enter the following:

set originalFile to do shell script ¬

"lsof -wa -Fn -c iTunes +D /tmp | grep -i QTP | head -1 | cut -c 2-"

if length of originalFile is greater than 0 then

  set newFile to POSIX path of ¬

  (choose file name default name "iTunes Video.mov")

  if length of newFile is greater than 0 then

    if newFile does not end with ".mov" then ¬

    set newFile to newFile & ".mov"

    do shell script "/bin/cp -v '" & originalFile & ¬

    "' '" & newFile & "'"

    do shell script ¬

    "/Developer/Tools/SetFile -t 'MooV' -c 'TVOD' '" ¬

    & newFile & "' || true"

  end if

else

  display dialog "No movie found. Please make sure that the movie is

  currently visible in iTunes." buttons {"OK"} default button "OK"

end if

The "¬" characters are used in AppleScript to indicate the continuation of a line. Do not enter them when you see them here. Instead, type the next line as a continuation of the line containing the "¬" symbol.

Click the Compile button to insure you didn't make any typos, and then use File [image] Save to save your script. In the Save dialog box, set the File Format to Application, and check the Run Only box. Name the script whatever you want, then save it into your Documents folder (or some other easy-to-find location). Quit Script Editor.

Now visit the iTMS, find a video or trailer you'd like to keep, and let it completely download. While the iTMS window is still open, switch to the Finder and double-click your new script. After a brief delay, you should see a save dialog box; enter a name and pick a folder to store it in, then click OK. The script will find the movie, rename it, and copy it to your destination. Furthermore, it'll make sure the type and creator values are set properly for QuickTime to play the video.

This script requires that you have the XCode Developer Tools installed. If you don't have the tools, you can still use the script—just remove the line that begins with do shell script "/Developer/Tools/SetFile -t. You may then have to open the movie directly from QuickTime or use another tool to set the type and creator codes.


8.3 Navigating iTunes

A whole section on navigating iTunes? How hard can it be? It's got a couple buttons and a volume slider!

Hiding behind that deceptively simple interface, however, are a variety of hidden (and not-so-hidden) features that let you get the most out of iTunes. This section will help you out with 'em.

8.3.1 Controlling iTunes Through the Dock

You're working away in Word when suddenly you realize that iTunes has played "The Long and Winding Road" 47 times in a row. You must change the song immediately, but your iTunes window is buried in a mass of other open windows. What do you do? See Figure 8-7, that's what.

Figure 8-7. When you need to quickly silence your Mac, what are you supposed to do—switch out of Word, switch into iTunes, find the proper menu or click the right button, and then return to Word? Instead, hit the Dock, as shown here. If you Control-click (or click and hold) iTunes' Dock icon, a handy menu pops up. Use this menu to control iTunes without switching out of the program you're already using. When you make menu choices this way, iTunes doesn't come to the foreground at all.

8.3.2 Marking or Unmarking All Songs

When you're browsing a library or playlist, you can [image] -click the checkbox next to a song to turn off (or on) all the songs.

This trick can be a big timesaver when, for example, you want to import only a few songs from a CD. Insert the CD, [image] -click a song to unmark the whole playlist, and then just turn on the songs you want to import. (This can be a lot faster than the other way: unchecking all the songs you don't want.)

8.3.3 Keyboard Navigation of Song Playback

You can fast-forward and rewind a song right from the keyboard, as long as you know the keyboard shortcut: Option- [image] -left or -right arrow key.

8.3.4 Keyboard Navigation of the Library and Playlists

If you're browsing your Library, you can use the keyboard to jump around to various artists, albums, genres, and more. Keyboard navigation here works much like it does in the Finder—type a few letters at the start of an artist's name, and you'll jump directly to the first song by that artist in your Library. There is, however, one significant trick to keyboard navigation: The shortcuts work only for the currently selected column. So if you've highlighted Artist, for instance, typing "ever" will take you to the first Everclear album in your collection. If you've highlighted Song Name instead, then "ever" will take you to "Everybody Hurts" by R.E.M. You can use this same typing selection method with Genre, Album, or any other text-based field.

You can also use it when you have the Browser pane open. Click once on either Artist or Album, and then type a few characters to advance directly to that location in the list.

8.3.5 Keyboard Navigation of the Info Window

When you select an item in iTunes and choose File [image] Get Info (or hit [image] -I), the Info window opens. The Info window contains four tabs, one each for Summary, Info, Options, and Artwork. Sure, you could activate each tab by clicking on its name, but what fun is that?

Instead, try the ultra-fast and ultra-hidden keyboard shortcuts: -1 for the Summary tab, [image] -2 for Info, [image] -3 for Options, and [image] -4 for Artwork.

8.3.6 Hover Focus

If you own a mouse with a scroll wheel, you can take advantage of hover focus to scroll the various lists in iTunes (the list of songs, for example, or your list of playlists). You don't have to click the list you want to flip through—just move the cursor over it and then turn the scroll wheel. As soon as you move the cursor out of that area, the scrolling stops.

8.3.7 Cranking It Up (or Down)

If you use iTunes in its smaller states (either small or tiny; see hint Section 8.1), there's a quick keyboard shortcut at your disposal for setting the volume level all the way up or all the way down: Shift-up arrow (maximum volume) and Shift-down arrow (silence).

You can also press Option- [image] -down arrow to mute iTunes. For added convenience, this keyboard combo works even when the window is maximized.

8.3.8 Controlling Dialog Boxes with a Keystroke

When iTunes dialog boxes appear—as one does when, say, you remove an item from your Library—they often give you choices of Yes, No, and Cancel. Instead of clicking the buttons or using a [image] -key shortcut, just press Y, N, or C, respectively. (In fact, this trick works in many Mac OS X programs.)

Be careful with this trick. If you were to select the Library, press Delete, and then reflexively press Y, you'd wipe out your whole collection.

8.3.9 Clearing Searches

Although this hint is amazingly simple, it's also easy to overlook, especially if you're a longtime iTunes fan. After rounding up a certain subset of songs using the Search box at the top of the iTunes window, you can click the small X icon at the end of the search bar to clear the text from the search box, as shown in Figure 8-8. The list returns to displaying the complete playlist or music library. No more tedious backspacing to clear your typed text!

Figure 8-8. How do you delete that search you just ran? X marks the spot. Click it, and the search field clears.

8.3.10 Keyboard Control

You can control iTunes' music playback using its menus, of course, but the keyboard can be far more efficient. Here are a few of the control keystrokes worth noting:

Function | Keystroke
Play, Pause | Space bar
Next song/previous song | right arrow, left arrow
Next source/previous source | down arrow, up arrow
Louder | -up arrow
Quieter | -down arrow
Mute | Option- [image] -down arrow
Fast-forward, Rewind | Option- [image] -right arrow, -left arrow
Eject | -E
Turn Visuals on | -T
Turn Visuals off | -T or mouse click
Full-screen visuals | -F
Exit full-screen visuals | -T, [image] -F, or mouse click

8.3.11 Extended Help Labels

Like many Mac OS X programs, iTunes displays yellow pop-up labels—tooltips, as Microsoft would call them—when your cursor pauses on a button, icon, or other screen element.

In iTunes, however, pressing [image] offers an extended, more complex form of the tooltip, as shown in Figure 8-9.

Figure 8-9. Left: A basic help tag tells you what you're mousing over.


8.4 The Visualizer

Visuals is the iTunes term for the onscreen laser-light show that pulses, beats, and dances in sync to the music you're listening to. The effect is hypnotic and wild. (To turn on the visualizer, click the flower-power icon in the lower-right corner of the window or choose Visualizer [image] Turn Visuals On.)

The show begins immediately. (For a really cool performance, choose Visuals [image] Full Screen so that the movie takes over your whole monitor.)

8.4.1 Add Your Own Visualizers

Visualizers are iTunes plug-ins. So when Apple's built-in collection starts wearing a little thin, you can download a variety of new ones from www.versiontracker.com or www.macupdate.com. For example, the ArKaos Visualizer is an astonishingly adept freeware visualizer that you can install with a couple of clicks from www.arkaos.net.

Once you run a plug-in's installer, the software winds up in your Home [image] Library [image] iTunes [image] iTunes Plug-ins folder. As a result, the next time you run iTunes, you'll see the new visualizer listed at the bottom of the Visualizer menu, so you can choose your favorite for each song.

8.4.2 Keyboard Controls for the Visualizer

If you're using the built-in iTunes Visualizer, you may not even realize that you can greatly influence what you see onscreen. Activate the visualizer, then once the screen is alive with visuals, you can turn it into your personal biofeedback screen by experimenting with these keys:

Key

When you download additional visuals from the Web, each comes with its own custom set of keyboard controls. These controls should be explained in their respective documentation.

8.4.3 Commemorate a Visual

The only problem with iTunes's stunning visual special effects—the Visualizer—is that you can enjoy them only while you're actually in iTunes.

Or can you?

Actually, once you've got Visuals playing full-screen (choose Visuals [image] Full Screen), press the screen-capture keystroke [image] -Shift-3 (see hint Section 4.3.14). You've just created a full-screen snapshot of the visuals, in PDF format, on your desktop.

You're free to use this graphic as your desktop picture (hint Section 2.6.2), in a Web design program, in Photoshop, or anywhere you need an interesting background or texture.


8.5 Songs and Playlists

A playlist is nothing more than a subset of your Library, consisting of songs you've added. The following hints help you create playlists to keep your most popular music handy and to reveal some hidden features that will help you manage your music collection.

8.5.1 The Song List Shortcut Menu

When browsing your song collection, don't overlook the usefulness of iTunes' shortcut song menu, which you can summon by Control-clicking any song in the Library or a playlist (Figure 8-10).

Figure 8-10. The ever-useful Control-click offers some convenient options for iTunes' Library and playlists.

The shortcut menu contains a number of useful choices, including an easy way to set the rating (from one to five stars) for a given song, as well as an option to display any playlists that contain the selected song.

8.5.2 Playing a Song Without Adding It to the Library

Whenever you drag a file into the iTunes window, the program's instinct is to make it a permanent part of your collection. But that isn't always what you want. Maybe you're just trying to play a 15-second song preview from an online service or listen to an audio joke recorded by a buddy. Either way, you probably don't want to make that sound file a permanent part of your library.

To turn off this feature for good, choose iTunes [image] Preferences, click the Advanced button, and turn off "Copy files to iTunes Music folder when adding to Library." Finally, click OK.

If that seems a bit drastic, you can also prevent the copying on a one-shot basis. The trick: hold Option as you drag the file into the iTunes window. Now, instead of copying the file, iTunes creates an alias in the Library. So, although you see the file in your Library list, it doesn't actually exist in your iTunes music folder.

It's not easy to distinguish an alias from an actual song in the iTunes display, though. To correctly identify them, you must highlight a song in the main window and then choose File [image] Get Info ( [image] -I). In the Info tab, "Where" shows the file's actual location. If this location matches that of your iTunes music folder, then the song exists in your real Library. If the listed location is elsewhere, the song is an alias.

8.5.3 Import a CD as One Continuous Song

The Beatles' "Abbey Road." Pink Floyd's "Dark Side of the Moon." Modern techno music. What do they all have in common? They're all best played in iTunes as one continuous song since they all feature either no breaks between songs, or they contain interesting content during the song breaks. So how should you import these albums with iTunes?

Start by inserting the CD and then select all the tracks in the iTunes window. Under Advanced, select Join CD Tracks. During this step, the track display in iTunes will change, as seen in Figure 8-11.

When you rip the CD, the entire CD's contents appear as one super-long song with no additional breaks between each track. And yes, this file plays just fine on your iPod, too!

8.5.4 View Cover Art While Listening to a Song

iTunes includes a nice feature to add cover art to your Library. These images are displayed in the Now Playing area just below the Source column of the main iTunes window.

If you don't see a Now Playing area at all, click the rightmost button in the lower-left corner of the iTunes window.

Figure 8-11. When you use the Advanced [image] Join CD Tracks feature, iTunes will merge the selected tracks into one long track, as shown here by the line joining the first track to the last track. This tactic is a quick way to import modern techno music, as well as occasional one-track classics.

If you don't see a Now Playing label, but instead see Selected Song, never fear— your album covers are but a mouse click away from full visibility. To toggle the currently-playing-song mode for album covers, just click the words Selected Song. When you do, they'll change to read Now Playing, and if the song being played has an associated cover, you'll see its image.

But how do those covers get into iTunes in the first place? The next hint holds the answer to the riddle.

8.5.5 Collecting Cover Art

As noted in the previous hint, you can display album covers while iTunes is playing. So, how do you get those covers into iTunes? There are a number of ways, really, ranging from the simple to the, well, not so simple.

  • Any songs you purchase from the iTMS will have cover art already included. This is clearly the easiest, yet most expensive, method of moving artwork into your Library.

  • You can visit a Web site that displays covers, such as Amazon.com or Allmusic.com, and search for artists and albums. Once you've found a cover, select the matching song in iTunes and simply drag the image from the Web browser into the Now Playing area in iTunes.

  • Scan your own covers, modify them in Photoshop as necessary, and then import into iTunes. Clearly this is the most difficult way to proceed, but it also gives you the most control over the end result.

  • Use an automated artwork collector, such as Clutter (www.sprote.com/clutter), which looks on Amazon for a match for the currently playing song. If it finds one, it displays the cover; you can copy it to your Library with one menu selection (File [image] Copy Cover to iTunes). Clutter even acts as a nice iTunes controller, as seen in Figure 8-12.

Figure 8-12. Clutter is not only a great way to get album covers into iTunes, it's also a pretty good controller. The previous song, pause, and next song buttons work as expected, so you can see both iTunes artwork and navigate iTunes from the same window. You can even create "virtual albums," as seen here. Just double-click a virtual album and Clutter creates a special iTunes playlist of that album's songs and starts playing it.

Keep in mind that adding cover art to your iTunes library increases the size of your music files, as the images are stored directly inside the song files. It may not matter on your desktop machine, but if you use an iPod, the extra bulk could be an issue. (To delete artwork, you'll need to select the song(s) you wish to modify, hit [image] -I to open the Info window, click the Artwork tab, and then delete the cover.)

8.5.6 Store More than One Image per Song

If you're really into your musical artwork, you may wish to store more than one image per song—perhaps you're scanning your own covers, and you'd like to have the lyrics and back cover in addition to the front cover. Keep in mind you're likely making your song files much larger, as each image is stored directly in the song itself.

If you wish to forge ahead anyway, it's easy to do. Select a song in iTunes, then hit [image] -I and click the Artwork tab. Click the Add button to add an image from a file, or just paste it into the image area. Each time you do so, the image is added to the existing images in the collection.

8.5.7 Let iChat Tell the World About Your Musical Tastes

Are you proud of your musical tastes? Do you want to share your fine taste with the rest of the world? If so, this hint is for you! With a simple AppleScript, you can set your iChat status to display the name of the artist you're currently listening to.

Open Script Editor (in Applications [image] AppleScript), and enter the following code:

on idle

  tell application "iTunes"

    if player state is playing then

      set a to artist of current track

      if a is "" then

        set a to "mysterious unknown music"

      end if

    else

      set a to "nothing"

    end if

  end tell

  tell application "iChat"

    set status message to "listening to " & a

  end tell

  return 20

end idle

When you're finished, click the Compile button to insure you didn't make any typos, then select File [image] Save. Give your script a name and place it somewhere handy, such as your Documents folder. Set the File Format pop-up to Application, and check the Run Only and Stay Open dialog boxes.

Switch to the Finder and double-click the newly saved script. Assuming iChat is running and iTunes is playing, you should now see your status as "listening to" followed by the artist's name. If you tire of the script, just quit it as you would any other program, and then change your iChat status manually.

If you like the concept in this little script, you might want to check out Doug Adams' Now Playing in iChat AV script, which offers additional error-checking and a few more options. You can download his script here:

www.malcolmadams.com/itunes/scripts/scripts09.php?page=2#nowplayinginichat

And if you really want to go overboard with your iChat status messages, check out iChat Status from Infinity-to-the-Power-of-Infinity, available here:

http://ittpoi.com/?type=frameset&product=com.ittpoi.ichatstatus

You should note that iChat Status is a preference pane, not an AppleScript. Consequently, it communicates with iChat using a different technique, which may not work with future Mac OS X or iChat upgrades. This disclaimer aside, iChatStatus lets you do some amazingly cool stuff with the simple iChat status line.

8.5.8 Seeing into the Future

If you enjoy iTunes' random-playing song mode, but still want to see what's coming up, you can set the program to give you a sneak preview. Here's how:

  1. Create a new playlist.

    Choose File [image] New Playlist, or click the + button in the bottom left corner of the window. Name it whatever you like, and then drag in all the songs from your Library (or just the ones you'd like to hear).

  2. In the main pane, click the top of the Playback Sequence column.

    It's the column just to the left of the song names.

  3. Click the Shuffle button (second from left at the bottom of the iTunes window—the one with the crossed arrows).

    You've now put your playlist into Shuffle (random) mode, and yet because you've sorted the list by song number, you can see exactly what the order of the songs will be.

    If you don't like what you see, click the Shuffle button again. Each time, a new random order is produced, which is clearly revealed by the list of songs in the main window.

8.5.9 Deleting a Playlist Without a Warning

When you try to delete a playlist in iTunes, you'll get a warning dialog, as seen in Figure 8-13.

Figure 8-13. When you try to delete a playlist, iTunes politely asks if you're sure you'd like to do so. While this reminder is helpful the first time, it can get quite annoying after the 35th such request.

If you get tired of seeing the warnings, you can always check the "Do not ask me again" box. But if you do, you'll never again receive a warning. Naturally, you'll probably realize you want one just after you delete your special, ultra-cool, heavily customized St. Patrick's Day party playlist. It's at that time you'll discover that iTunes doesn't have an easy way to turn the warnings back on again. You'll have to delete your iTunes preferences file (com.apple.iTunes.plist) from your Home [image] Library [image] [image] Preferences folder, which will also toss out all your other preference settings, such as your preferred song import format.

A better option is to leave the warning turned on, and then just force your way around it when you're positive you want to delete a playlist. How? Hit [image] -Delete instead of just Delete. Presto, the playlist vanishes with nary a warning in sight.

8.5.10 Delete from Playlists and the Library

iTunes treats songs in playlists much like the Finder treats folders of alises—playlist songs are actually just pointers to the real songs in your Library. Hence, when you delete a playlist, you're not deleting the songs from your Library; you're just removing a bunch of links to them. Most of the time, that's probably what you want to do.

However, what if you've added some songs to your Library for a special iMovie project? You may have created an iMovie-only playlist just for the project, and now that the project is done, you want to remove both the playlist and the original songs from your Library. You could, of course, delete the playlist, then find the tracks in your library, and delete them there. But with thousands of tracks in your library, this process can become a bit tedious.

Luckily, there's a much easier method: click once to select the playlist with songs you'd like to delete, and then hit Option-Delete. iTunes warns you that you're about to do something quite dangerous, as seen in Figure 8-14.

Figure 8-14. iTunes warns you when you hit Option-Delete on a playlist, as you'll be erasing the songs not just from your playlist, but from your Library as well. And unless you never make mistakes, you should leave the "Do not ask me again" box unchecked. (You don't really want to buy all those iTMS songs twice, do you?)

Click Yes, and iTunes asks if you'd also like to move the songs to the Trash, to which you should also answer Yes. That's it: end of playlist, end of songs in your Library.

Make sure you're 100 percent positive about the deletion, though, because there's no Undo for this one. And if you deleted an iTMS-purchased song, your only option to get it back is to buy it again!

8.5.11 Reshuffling a Playlist

iTunes' Shuffle mode occasionally forgets that it's already played something and treats you to a certain sequence of songs twice.

To slap iTunes into submission, force the program to recreate the shuffle order by clicking the Shuffle mode button twice—to turn it off and then on again.

8.5.12 Skipping Albums During Random Play

iTunes lets you play a random mix in two ways: by song (which shuffles your entire library and plays the songs randomly) or by album (which plays the albums in random order, but leaves the songs in order within them). Specify which method you [image] want by choosing iTunes [image] > Preferences [image] Advanced.

If you're listening to albums in random mode, you can skip an entire album by pressing Option and one of your arrow keys: Option-left arrow jumps to the previous album, Option-right arrow jumps to the next.

8.5.13 Radio Stations

iTunes has some nifty Internet radio features; in fact, the program lets you treat radio stations almost like songs. You can add them to a playlist or your Library (Figure 8-15), and you can use File [image] Get Info to set their tags—associated information about the artist, album, year recorded, genre, and so on. Once that's done, you can sort your stations by genre, add an artist name of "Radio" for all of them, use smart playlists to make sub-selections (see Section 8.6 for creating smart playlists), and so on.

Figure 8-15. If you normally listen to your Library in shuffle mode, you may not want to add radio stations to it. If a radio station comes up in the rotation, iTunes will stop there because a radio station doesn't really have an end to its "song." Instead, a better idea is to keep your radio stations in a playlist of their own.

8.5.14 Moving Songs to the Top of a Playlist

You've just created the playlist for a weekend-long bash, but it's not yet in any order. As you prepare for the shindig, you realize that you'd like many of the songs near the bottom of the list to play first.

At first glance, you might suppose that the only way to move them up your gigantic music list is to drag them toward the top of the iTunes window, wait for the long list of songs to scroll by, and then drop the selections at the top.

Fortunately, there's a better way.

The following trick works only within a playlist—not within your entire Library.

Select the songs you want to move ( [image] -click to select individual, nonadjacent songs in the list). Instead of dragging them, however, drag the handle of the scroll bar toward the top of the window. Scan the list for a song near where you want the selected songs to wind up. Then [image] -click this new "top song" to temporarily add it to your selection.

Now—this gets a little weird—click the song you just selected and keep the mouse button down. Wiggle the mouse around. If you move it just enough, the horizontal insertion indicator appears without actually moving the song.

Return the insertion line to the spot where you grabbed this top song and then release the mouse button. Almost like magic, the top song drops into place—with all of your selections from the bottom of the list just beneath!

8.5.15 Burning MP3 CDs

You're probably aware that iTunes can burn customized CDs—containing only the music you like in the order that you want—that play in any CD player.

You may not be aware, though, that iTunes can also burn MP3 CDs. These are discs that work just like regular music CDs but hold many, many times more music. To wit, an audio CD holds just over an hour's worth of music (15 or 20 songs), while an MP3 CD can hold well over 100 songs.

MP3 CDs are also handy for transferring multiple MP3 files from one computer (Mac or PC) to another.

Before you start trembling with excitement, however, there are two caveats. First, not all CD players can play MP3 CDs. Most recent models can, but you can't be sure until you try it. Second, purists complain that the quality of MP3 isn't as high as audio CDs. (It's plenty adequate for everyday jogging or yard work use, though.)

To create an MP3 CD, choose iTunes [image] Preferences [image] Burning. Here you can specify which kind of CD you intend to make most of the time—Audio CD or MP3 CD. (You can also create a Data CD or DVD for backups, but that's not nearly as useful for actually playing your music.)

If you mostly burn audio CDs, you can leave the preference panel set to Audio CD. Thereafter, when you need to make the occasional MP3 CD, use this method: insert a blank CD and then drag a selection of songs directly out of the iTunes window and onto the CD's desktop icon. Eject the CD as usual, and indicate that yes, you want it burned before ejecting.

A CD made this way may wind up with inaccurate track information, so it's best for transferring files or creating quick-and-dirty, casual CDs. Moreover, the songs will always play in alphabetical order. (If you want a different order, name the songs with numerical prefixes. You can rename a song by Control-clicking it and choosing Get Info from the shortcut menu.)

8.5.16 The Browser

If you choose Edit [image] Show Browser (or press [image] -B), the iTunes window changes to show you two panes above your list of songs. At the upper left, there's a list of genres, followed by singers or bands. Click one to see, in the upper-right pane, a list of the albums by that group. As you go through this procedure, you'll see an updating list of the matching songs in the bottom half of the window. The underlying point is to provide you with a quick way to narrow your database when you want to see only the songs from one genre, on one album, or from one artist (see Figure 8-16).

Figure 8-16. The iTunes Browser lets you quickly navigate even large, complex collections of songs. Once activated, you can then select a genre in the left pane, choose an artist's name in the middle pane, see a list of their albums on the right, and look through all their songs in the lower portion of the window. Click a particular album and just that album's songs appear in the lower pane.

In older versions of iTunes, you could only view the Browser when the Library—your complete music collection—was selected. Since iTunes 3, however, it's also been available when you're viewing playlists, making it all the more useful. Now once you've opened up the Browser, you can view subsets of a specific playlist by genre, artist, and album just by clicking the relevant names in the Browser list.

8.5.17 Creating a Playlist from the Browser

One thing that makes the Browser so useful is its ability to instantly create a playlist whose songs come from only one artist or album. Just highlight the artist or album, and then drag the selection into the playlist window on the left (Figure 8-17). iTunes instantly builds a new playlist containing the songs you selected.

Figure 8-17. You can create a new playlist from an artist or an album (or even genre) by simply dragging its name from the Browser window into the Source area.

If you drop the selected artist or album on an existing playlist, iTunes adds all the songs to that playlist.

8.5.18 Printing a Playlist

Although you might not expect it, iTunes actually has a fully functional Print command. Hidden in the Print dialog box, moreover, are tools you can use to print song listings, album listings, and—best of all—CD jewel case inserts (see Figure 8-18).

Figure 8-18. Using iTunes' printout-maker, you can spare yourself the trouble of writing out track lists by hand. You can find CD-insert paper at stores like Staples or on Web sites like www.officemax.com.

No matter what kind of printout you want, though, you owe it to yourself to look through the Themes pop-up menu, since iTunes has a surprising number of color schemes and layout options. Once you've selected the theme, click Print to proceed to the traditional Print dialog box.

When printing a jewel case insert, it's best to use paper that's cut specifically for that purpose (found at almost any office-supply store). If you absolutely must print on normal-sized paper, though, make sure you first pay a visit to File [image] Page Setup and orient the paper so the entire printout fits lengthwise on one page.


8.6 Smart Playlists

"Smart playlists" are self-creating lists of songs that update themselves according to rules you define—the number of times a song has been played, its rating, its genre, and other such criteria.

To create a new smart playlist, choose File [image] New Smart Playlist (Option- [image] -N); see Figure 8-19 for help. The Smart Playlist dialog box opens, letting you set the rules you'd like to use. When the dialog box closes, you can type a new name for your playlist.

Figure 8-19. Here's another way to open the Smart Playlist dialog box: Option-click the + (New Playlist) button. When you've done it right, the usual + icon (left) becomes a gear shape (right).

8.6.1 Playlists that Play All Songs Once

Creating one of the most useful smart playlists—a playlist that simply plays every song once—sounds as easy as pie, but there's actually a little more to it than you might expect.

Open the Smart Playlist dialog box (Option- [image] -N) and then proceed as shown in Figure 8-20.

A song is not considered fully played until it ends, so if you skip ahead with the "next song" button (the >> button above the volume bar), the skipped songs remain in the unplayed category and will therefore come up again. If, later, you decide that you want to hear the rest of it, click the << button.

If you've already been listening to your music and want to start over with this one-shot playlist, click in the song list section of the Library, hit [image] -A (to select all), then Control-click any selected song and pick "Reset Play Count." You'll see a warning about resetting the play count on the selected items; click OK. You've now got a "factory fresh" selection of music for your smart playlist.

Figure 8-20. To create a smart playlist that runs through your Library one song at a time without repeats, start by selecting File [image] New Smart Playlist. Turn on "Match the following condition," and then set the three fields to "Play count," "is," and "0." Make sure Live Updating is on. Click OK, and type a new name for your playlist.

This "play once" smart playlist is a fun way to assign your songs star ratings. Even while the playback continues, you can Control-click in the My Rating column—or, if you're working in another program as you listen, the rating menu in the iTunes Dock icon—to rate each song on a scale of one to five stars. Eventually, you'll have heard all of the music in your collection, and rated every song.

8.6.2 Keep Track of iTunes Music Store Purchases

When you buy music from the iTMS, you receive a new smart playlist called Purchased Music in the Music Store section of the iTunes Sources column. This smart playlist contains a list of every song you've purchased, and it's an effective way to keep track of your iTMS activity.

But it's also just a normal smart playlist, and, as such, it can be deleted at the touch of the Delete key (especially if you've disabled the playlist deletion warnings, as described in hint Section 8.5.10). Once it's gone, it'll come back with your next purchase. By that time, however, all your purchase history will be gone. Never fear, though: you can easily recreate it yourself. Select File [image] New Smart Playlist, and set the conditions as shown in Figure 8-21.

Make sure you turn on the "Live updating" box, which makes the list automatically update itself when you purchase additional songs. Note that your recreated purchases playlist will show all purchases, regardless of whether you made them before or after you accidentally deleted the Apple-supplied version.

8.6.3 Monitor Required Backups Using a Smart Playlist

Unless you relish the thought of reimporting and repurchasing all of your iTunes music, you should back it up regularly. Fortunately, iTunes makes a relatively simple procedure. If you've never backed up before, create a new playlist and drag your entire Library's contents into it. Then open iTunes preferences, click burning, and set the Disc Format to Data CD or DVD. Return to the main iTunes window, select your playlist, and click the Burn button.

Figure 8-21. If you've accidentally deleted the Apple-supplied smart playlist that tracks your iTunes purchases, don't worry—you can create your own stand-in. Just create a new smart playlist and set it up as shown here, then click OK.

iTunes now walks you through a backup, prompting you for new discs as it needs them. Obviously, if you have a lot of music, you'll want to have a fair number of CD-Rs around. Bear in mind that you can probably fit about 100 to 150 MP3 or AAC encoded songs on a CD-R disc. A DVD burner can shorten the process significantly, fitting somewhere around 750 encoded songs per blank disc. Either way, you'll need to go through this painful process at least once to produce a full backup.

But after that first backup, how do you keep track of newly added files that you need to backup? Why, use a smart playlist to do the hard work for you, of course! Select File [image] New Smart Playlist, and add two simple conditions. For the "Match the following condition" section, set it to "Date Added" "is after" and then enter the date of your first full backup. Check the box labeled Live Updating, and then click OK. Name it something like "To be backed up."

The playlist now automatically increases in size as you add new material to your Library. When it becomes big enough to justify the cost of a 5¢ blank CD, burn the playlist to a CD-R or DVD-R. After burning, Control-click the "To be backed up" playlist, select Edit Smart Playlist, and enter the current date in the date field. The list empties out and then grows over time again.

8.6.4 Add Some Logic Capabilities to Smart Playlists

Although iTunes Smart Playlists are indeed smart, they lack the ability to understand complex logic. You can set the playlist to match "any" criteria (which is an "or" condition) or "all" criteria (an "and" condition). But you can't mix and match the two to find all songs recorded in the 1990s that are either polkas or Gregorian chants, for example.

Luckily, newer iTunes versions include the ability for one smart playlist to reference another, which can help you work around these logic limitations.

In the above example, start by creating one smart playlist for your genres. To do so, select "any" condition, and then add two criteria: genre equals polka and genre equals Gregorian chant. Save this smart playlist as "Dance and Pray," and start a new one—the one you'll actually use.

For this second playlist, set the matching conditions pop-up to "all." For the first criterion, select Playlist from the left pop-up, "is" from the middle pop-up, and "Dance and Pray" from the right pop-up. For the second criterion, set the pop-ups to "Year," "is in the range," and "1990" and "1999" for the start and ending years. Now, the first list isolates all of your polkas and Gregorian chants, while the second starts with the members of that first playlist and then considers only those recorded in the 1990s. Congratulations...you've just created a combined smart playlist.

Although combining playlists in logical arrangements can be tricky, it's the best solution until Apple imparts full logic to its smart playlists.

8.6.5 Install Free iTunes-Related Fonts

Everyone likes free stuff. Well, how about 25 free fonts, courtesy of Apple?

Head over to the iTunes Scriptable Applications page (www.apple.com/applescript/itunes), and click Download. When the download completes, expand the archive (if it didn't automatically expand), and then open the AppleWorks 6.2.2 Stuff folder. The ITC Folder inside holds 25 fonts, ready for your use in any application. (They were originally intended to be used with the scripts you just downloaded.)

To install the fonts, drag the ones you want to either Library [image] Fonts (to install for all users) or Home [image] Library [image] Fonts folder (to keep them to yourself).

8.6.6 Modifying Random Playlists

When you set iTunes to randomly play the Library or a normal playlist, you can't modify the order or contents of the list. OK, but what if you see that the "Love Boat" theme song is in the list, and you suddenly remember it caused your dog to toss his cookies on the rug last week? Better to have a playlist you can modify.

Choose File [image] New Smart Playlist and then set things up as shown in Figure 8-22.

Figure 8-22. Turn on "Limit to." Select a number of songs (or minutes or hours or volume), and verify that "selected by" is on "random." Also make sure that "Live updating" is on, so the whole thing looks like this. Click OK, and type a new name for your playlist.

The smart playlist you just created is not only random but completely controllable, too. Now, at your whim, you can drag songs around to set their play order, and you can delete songs (like the "Love Boat" theme) that you don't want to hear. When you delete a song, iTunes picks a new song from the library to replace it. In short, using the wide variety of options available, you can make a list of tunes to match anyone's musical taste.


Chapter 9. iPhoto 4

Digital cameras, by their very nature, encourage lots of snaps. That's because once you've bought enough batteries and memory cards, there's no additional cost to taking tons of photos. But how do you keep those pictures organized? Carefully labeled shoeboxes simply won't do the trick.

Luckily, iPhoto 4, one of Apple's "iApps" (included with every Mac or sold as part of iLife for $49), lets you create digital albums and assign searchable keywords to photos. For all but the most prolific of picture takers, iPhoto is a quick, convenient, and inexpensive solution to the timeless problem of photo organization.


9.1 The Basics

iPhoto is a masterpiece, a breakthrough, a revolution. It can handle thousands of images without really breaking a sweat, and, accordingly, if you can't organize your images with its help, you should probably visit Unorganizers Anonymous. However, just because it's a powerful tool doesn't mean there aren't a few tricks you can employ to maximize its usefulness.

9.1.1 Speeding Up iPhoto

When you're viewing a library, film roll, or album, iPhoto comes set to display your photos with a subtle drop shadow in the main window. While this effect looks cool, it slows down scrolling and resizing on all but the fastest machines. Boost your speed by turning off the shadow.

Choose iPhoto [image] Preferences, and in the Appearance pane uncheck the Drop Shadow option. (If you'd like a somewhat faster alternative, set the pictures to display a solid-line border instead.)

In this preference pane, you can also change the background color for the iPhoto window. Many photographers prefer a neutral gray to more accurately contrast the colors in the images.

Return to Organize mode, and try enlarging the photos using the slider in the lower-right corner, or scrolling through a collection. You'll gasp at the speed improvement.

9.1.2 Rotating Clockwise

When you click the Rotate icon below the album list area (the button on the far right in Figure 9-1), iPhoto rotates the selected image counterclockwise—a handy action for photos you took after rotating the camera 90 degrees. Unfortunately, if you want to rotate a photo 90 degrees in the opposite direction, you have to click the Rotate button three times—right? Not necessarily; see Figure 9-1.

Figure 9-1. Top: The Rotate button generally indicates that it will spin a selected photo counterclockwise.

9.1.3 Zooming In

When, in Edit mode, you zoom in on a photo using the slider in the corner of iPhoto's main window, the program focuses on the center of the photo. To zoom in on a different portion, use your mouse to "drag out" a box over the area you'd like to work on, and then use the zoom slider. iPhoto not only zooms in on that selection, but also centers it inside the window.

9.1.4 Sideways Zooming

If your mouse has a scroll wheel, you've probably already noticed that you can scroll images up and down while zoomed in on them. You might not have noticed, though, that if you press Shift, you can use the same wheel to scroll the zoomed area horizontally.

9.1.5 Long Comments

iPhoto includes a Comments box for storing notes about your photos. (If you don't see it, click the small "i" below the album area—twice, if necessary.) Unfortunately, the Comments box doesn't automatically widen if you have a long note, and it doesn't have a scroll bar.

If these annoyances prevent you from savoring the genius of the extensive comments you've typed in, three solutions await:

  • Click inside the Comments box once, and then use the up and down arrows on the keyboard to scroll through the box.

  • Resize the Comments box by dragging the small dot that separates the bottom of the album list from the information area (Figure 9-2).

Figure 9-2. When you resize the Comments box, the cursor changes from an arrow to a two-headed creature.

  • Resize the entire album pane by dragging the bar that separates it from the photos.

9.1.6 Commenting Rolls, Albums, or the Library

You've just decided to create separate albums for each year of your annual Civil War re-enactment party. Problem is, you don't want to name the albums "Civil War 1998," "Civil War 1999," and so on, since there just isn't enough space in an album name to type all the juicy details of each gathering.

Instead of renaming them, the better method might be to add a comment to each entire album, listing the date, the participants, and the dips you served. See Figure 9-3.

9.1.7 Banish Minuet in G

You know the tune—thousands of times over. It's that tune you hear every time you view a standard slideshow in iPhoto. Though you can easily change it for any given album by clicking on the Music tab in the Slideshow dialog box, Minuet in G may return unprompted when you play a new slideshow.

Figure 9-3. Select the album you want to add a comment to, and make sure that no individual image is highlighted. (Click anywhere in the right-hand panel except on a photo. You've done it right if, in the information area below the album list, the label on the first line is "Album," not "Title.") To add a comment, just type it in the Comments box. Note, however, that this comment only shows up when no image in the album is selected.

Though you may think you're stuck with Bach forever, you're really not. To set the automatic music—including no music—for future slideshows, click the Slideshow button. In the Music tab, select the song you'd prefer to hear (or turn off the "Play music during slideshow" box if you'd prefer the blissful sounds of silence). While you're here, visit the Settings tab and specify exactly how you'd like your slideshows to appear.

Now, to make the changes stick, click the Save Settings button and then Cancel—that is, unless you want to watch a slideshow of your entire photo library. In this unlikely case, you should click Save Settings and then Play.

9.1.8 View a Slideshow in a Window

When you click the Slideshow button to display a slideshow, you'll see a dialog box with various options you can control, along with a Play button. When you hit Play, iPhoto proceeds to take over your entire screen, dimming it to black and then starting the slideshow in full-screen mode. Of course, the fact that the slideshow is the only thing visible onscreen means that you can't work on anything else while it's playing.

If you'd rather not give up your entire display to the slideshow, here's a sneaky little workaround: hold down the Control key prior to clicking Play, and the slideshow opens in a window that can be placed anywhere on the screen. Unfortunately, the window floats on top of everything else on the screen, guaranteeing that it'll block at least a portion of some window on all but the largest displays.

9.1.9 Editing Windows I

Using the options in iPhoto [image] Preferences [image] General, you can tell iPhoto what to do when you double-click a photo: either open the picture in the main window (in Edit view), or in a separate editing window.

Every now and then, though, you may prefer to use the arrangement that isn't selected. Instead of switching to Edit mode in the main window, for example, you may wish to open a photo into its own window.

Fortunately, no matter which mode you've chosen, you can temporarily override the setting by Option-double-clicking a picture. If you selected "Changes to Edit view" in the preferences, Option-double-clicking opens a picture in a separate window—and vice versa.

9.1.10 Editing Windows II

Unfortunately, the Option-double-clicking trick (hint Section 9.1.9) doesn't work if you've selected the third option in the Preferences window: "Opens photo in." This mode is best for people who like more editing control over their pictures (or for people who've spent $600 on Photoshop and want their money's worth).

If you fit into either of these categories, you may want to forget hint Section 9.1.9 altogether. Instead, whenever you want to edit a photo, Control-click it. The resulting shortcut menu offers all three choices: "Edit" (that is, switch iPhoto into Edit mode), "Edit in separate window," and "Edit in external editor."

In order to have all three choices available, you must set your preferred external editor. Open iPhoto [image] Preferences [image] General, choose Select Application, and specify your favorite graphics program.

9.1.11 Before and After Pictures

Want to see your photo changes before you commit to them? If you're like most people, you probably do. While you're working in Edit mode, hold down the Control key for a quick trip back in time to see a pre-edited view of your picture (not counting rotation). When you release Control, the image reverts to its edited state.

9.1.12 Backing Up the Preferences File

iPhoto's preferences file doesn't just store your program settings. It also stores any keywords you've created, as well as the association of those keywords with various photos. If that file gets wiped out, you also lose your ability to sort photos by keyword. And, heaven forbid, if your library is large, you could spend one very tedious Christmas vacation reassigning them all.

To back up iPhoto's preferences, switch to the Finder and open your Home [image] Library [image] Preferences folder. Copy the file called com.apple.iPhoto.plist to a safe location. Store the backup in a fireproof, flood-proof, hail-and-sleet-proof place.

Should you ever reinstall your operating system or move to a new computer, drop the iPhoto preferences-file backup into your Home [image] Library [image] [image] Preferences folder. Your full collection of keywords and image associations survives intact.


9.2 Libraries

Behind the scenes, all of your photos sit in an extremely important folder called the iPhoto Library folder. Understanding this fact is the first step to mastering a useful bunch of hints.

9.2.1 The Library Location

Given its druthers, iPhoto would store its iPhoto Library folder in your Home [image] Pictures folder. But what if you want to keep your photos somewhere else, such as an external drive (so that you can easily move your photos from one Mac to another), or on a second, larger hard drive?

Unlike iTunes, which lets you choose any folder you like for storing your music, iPhoto doesn't have a similar preference setting. Still, you can do the deed using either iPhoto Library Manager (see the next hint) or Terminal.

Make sure iPhoto isn't running, then open Terminal (Section P.3.5.3). At the prompt, type:

defaults write com.apple.iPhoto RootDirectory "/path/to/new/home"

The only part of the command you need to change is the /path/to/new/home part, which specifies the new iPhoto Library location.

For example, if you wanted to park the library on a hard drive named Room to Grow in a folder named My Images, then "/path/to/new/home" would become "/Volumes/Room to Grow/My Images". (Quotes are required in Unix if the folder or file names contain spaces; you also have to add "/Volumes" whenever you specify any location that isn't on your main, startup hard drive.)

See Section P.3.5.4 for details on the defaults write command.

Once you press Enter and exit Terminal, iPhoto creates and manages your library at the location you specified. Should you ever wish to return to the original location, just open Terminal again and type:

 defaults delete com.apple.iPhoto RootDirectory

This command doesn't affect any albums and photos—that is, it doesn't copy them into the newly specified folder. (You can do that manually, if you like.) Instead, this command teaches iPhoto to look in the newly specified location the next time it runs.

9.2.2 Multiple Libraries

If you're a real shutterbug, you've probably accumulated tens of thousands of images. While iPhoto 4 easily handles image libraries in excess of 20,000 photos, your mind may not. If you're going nuts taking photos of your seahorse's development, and you photo-document every item in your Star Wars action-figure collection, and you tend to snap every airport, hotel lobby, and toll booth you pass through while traveling, it probably makes sense to create a few separate iPhoto Library folders.

iPhoto Library Manager, a free program, lets you do just that. You can download it from http://homepage.mac.com/bwebster/iphotolibrarymanager.html, among other places.

The program is designed to help you create and manage multiple libraries, set permissions on those libraries, and even keep separate sets of keywords for each library. You can also write AppleScripts that let you specify which library to use when you open iPhoto.

9.2.3 Libraries on Removable Hard Drives

If you use the previous two hints to point iPhoto at a library that's stored on a removable disk, like a FireWire hard drive, you may have problems if you run iPhoto while that drive isn't connected.

For example, suppose you've stored the iPhoto Library folder on a FireWire disk named Photos Drive. Now suppose you disconnect this drive—take it to the office, for example. When you next run iPhoto from your home computer, you'll find no pictures at all. That's not too surprising, considering that the library location no longer exists. But since you know you'll have the drive back tomorrow, you import some new Barbecue Pix from your camera.

When tomorrow rolls around, you return home with the hard drive, plug it in, and open iPhoto. Unfortunately, it'll show you only the small batch of Barbecue Pix; your main collection is gone. Your brain reels—why don't you see your whole collection? After all, the original iPhoto Library folder is now back on the Photos Drive, where the Mac expects it.

  • The Explanation. (If you're not especially interested in the techie innards of this problem, skip down to The Solution.)

  • Mac OS X maintains icons for all your hard drives (except the startup drive) in the /Volumes folder. (This folder is normally invisible, but you can see its contents if you choose Go [image] Go to Folder, type /Volumes, and then press Enter.)

  • When you first plugged in the Photos Drive, Mac OS X created an icon for it in the /Volumes folder. When you unplug the drive, the icon disappears.

  • Later, when you open iPhoto while the drive is absent, iPhoto decides that, since the specified library folder doesn't exist, it had better create one. iPhoto once again adds a Photos Drive icon to the /Volumes folder, and then puts its iPhoto Library folder inside it. Any new pictures you import while the FireWire drive is absent go into this folder. If you were to open /Volumes in the Finder again, you'd see a normal folder icon for the newly created Photos Drive folder (rather than the special drive icon used for the original Photos Drive).

  • When you return home and plug in the FireWire drive, the Finder tries to create an icon in /Volumes for it, but finds that the name Photos Drive is already in use. So, smart little operating system that it is, Mac OS X names the newly reunited drive Photos Drive 1. Now when you launch iPhoto, it only sees the Photos Drive folder; as far as iPhoto is concerned, the FireWire drive now has a new name.

  • The Solution. Quit iPhoto if it's running and disconnect the FireWire drive. Open the /Volumes folder in the Finder by choosing Go [image] Go to Folder, typing /Volumes, and pressing Enter.

  • Now rescue the Barbecue Pix photos by dragging the Photos Drive folder out of the /Volumes window onto, say, your desktop. Reconnect the FireWire drive, which now proudly bears the correct name, Photos Drive (not Photos Drive 1). Open iPhoto, which once again displays all of your older photos and albums.

  • All that remains is to drag and drop the Barbecue Pix batch of photos from the folder on your desktop into the iPhoto window to reimport them.


9.3 Film Rolls

Each time you import a batch of photos, iPhoto groups them into what it calls a film roll, which it stamps with a roll number, the import date, and the number of photos in the import.

9.3.1 Faster Scrolling Through Collapsing

In iPhoto 4, you can turn on film-roll grouping by choosing View [image] Arrange Photos [image] by Film Roll. The result is shown in Figure 9-4.

Next to each film roll is a flippy triangle that collapses to hide all the photos in that group. Or, if you prefer, you can collapse all of your film rolls at once by Option-clicking the flippy triangle next to any single film roll.

Collapsed rolls make scrolling in iPhoto considerably faster, since the program doesn't need to process all of the image data. You may find it useful to leave the current roll in an expanded state, with all older rolls collapsed until you need them.

9.3.2 Changing a Film Roll's Title, Date, and Comments

In many cases, it's well worth taking the time to change a film roll's name ("Disneyland vacation" instead of "Roll 135"). To do so, just click its existing name and then edit the information that appears at the lower-left corner of the screen, below the album list. (If you don't see any information fields, click the small "i" button in the lower-left corner of the main window.)

You'll find that you can edit not only a roll's name, but also its comments and date—a great opportunity to rewrite history. When you change the date on a film roll, iPhoto re-sorts that roll based on the modified date. Trouble is, if you import a bunch of older pictures, you probably want them to appear in the proper chronological spot. Without your intervention, the new roll would appear at the top of the list, simply because it was imported last. A simple edit of the date field, though, returns the roll to the correct spot in the list.

Figure 9-4. The flippy triangle to the left of the film roll icon lets you collapse or expand the display of photos in that batch. (Working with collapsed rolls is much easier if you name them, as described in hint Section 9.3.2.)

9.3.3 Selecting a Whole Film Roll

An easy way to select all the pictures in a film roll—in preparation for creating a book, slideshow, or whatever—is just to click the roll's name. (If you don't see its name in the photo pane, refer to hint Section 9.3.2.) There, you've just highlighted all of the photos in the album; to deselect an individual picture, simply [image] -click it.

To deselect all the images in a roll, [image] -click the film-roll header.


9.4 Albums

The best part of iPhoto is the way it lets you organize your photo collection into smaller subcollections called albums, which appear in the list at the left side of the window. You can even create so-called "smart albums," which update automatically based on keywords or other matching criteria from your photo collection. (They're almost exactly like playlists and smart playlists in iTunes.) These hints help you use iPhoto's album-organizing tools.

9.4.1 Create a Smart Album for General Searching

iPhoto includes the ability to add keywords to photos—assigning "Aunt Hilda" to all of your aunt's pictures, for example—so that you can find them quickly with a future keyword search (or even a smart album based on keywords). Sure, that's convenient, but what if you want to find the one photo out of your 23,250 picture collection that you named "Secret to success?" Amazingly, iPhoto 4 lacks a basic search feature, which means you're left to browse for the proverbial needle in the photostack.

Luckily, you can use smart albums to fake your own basic search tool. Select File [image] New Smart Album, or just hit Option- [image] -N. iPhoto displays the smart album creation sheet. As seen in Figure 9-5, set the first criterion to search on Any Text (using "contains"), and add a few Keyword criteria if you wish (they're not required). When you're done, click OK.

Once saved, you can easily find a photo whenever you want. To conduct the search, just Control-click the saved smart album, select Edit Smart Album, and modify whichever criterion you'd like. To find the missing "Secret to Success?" photo, for instance, just enter the photo's name in the Any Text box, and click OK. (The Any Text function searches photo names, roll names, dates, comments, and keywords.)

The two Keyword fields you added can be used to help refine your search further. Namely, when you enter a keyword value, iPhoto narrows down the smart album to only those pictures that match the keyword.

9.4.2 A Quick Shortcut for Creating Smart Albums

Want to create a smart album in a hurry? Instead of using the menus, or even the keyboard shortcut (Option- [image] -N), just hold down the Option key to turn the "Create an album" plus-sign button into an icon of a gear. Mouse over the gear for a second, and iPhoto's helpful pop-up hint tells you that it's now the "Create a Smart Album" button. That's it—just Option-click the New Album button, and you'll create a smart album instead.

Figure 9-5. Although iPhoto lacks a basic search function, you can use smart albums to create one of your own. Create a new smart album with these criteria, and then just edit this smart album when you need to find something different. iPhoto automatically limits the album's contents to those images that match your search terms.

9.4.3 Browsing Albums for Desktop Images

One of the cool features of iPhoto is its integration with the Desktop & Screen Saver pane of System Preferences. Specifically, your iPhoto albums (and smart albums) appear as available image sources in the Desktop tab's left-side panel. Click any image in the right-side pane, and your digital picture shows up on the desktop.

Unfortunately, Mac OS X deprives you of the pleasure of seeing your pictures change on the desktop at certain intervals when you select an iPhoto album as your source. If you do, the "Change picture" box is unavailable.

If you'd like, you can even use slideshows of your photos as screen savers. Just go to System Preferences [image] Desktop & Screen Saver [image] Screen Saver tab, and select your favorite album (or smart album) from the left-side pane. (For more control over the look of the screen saver, click Options.)

9.4.4 Drag Photos to Create a New Album

You will probably guess that you create an album by clicking the + button below the album list (to create a new, empty folder), and then dragging the desired photos into it. Perhaps you also know that you can either select a group of photos all at once, by dragging a selection box around them, or one at a time, by [image] -clicking them.

However, you can save a step by dragging a batch of photos directly onto a blank spot in the album list. When you release the mouse, a new album is born.

If the white space is all taken up, drag your photos nearly to the end of the album list. As you drag over the Trash icon, a black outline appears around it. If you now drag upward or downward just slightly, the entire album box appears in outline, as shown in Figure 9-6. iPhoto creates a new album with all the selected images when you release the mouse.

Figure 9-6. When you create a new album by dragging photos into the album panel, a little plus sign tells you how many images you've selected.

9.4.5 Selecting Multiple Photo Albums at Once

Want to create books from, and add keywords to, multiple albums at the same time? Or how about burning multiple albums onto the same CD? In iPhoto 4, you can select multiple albums by [image] -clicking album names (to highlight names that aren't adjacent in the list), or by clicking the first and Shift-clicking the last (to select a batch of consecutive names). The main photo display area now displays all of the photos in the combined albums.

9.4.6 Merged Albums

The previous hint provides a quick trick for displaying a new, merged album from two or more other albums, but not for creating one permanently. To do that, after simultaneously selecting all the albums you want to combine, select all the images in the main photo display area ( [image] -A), and then drag them en masse into a blank spot in the album list (or onto an album you've already created). Presto! You've now added all the images from the previously selected albums into a new one.


9.5 Books

iPhoto lets you create books from your albums. While an album is simply a digital collection of pictures, iPhoto books are, well, actual, physical, gorgeous, hardbound books. You have the luxury of designing your own cover and laying out the individual pages from among the host of design schemes iPhoto offers you. A couple of clicks later, iPhoto hands your book design over to a professional bindery, which delivers the finished product in about three days.

To lay out a book, you need only click the aptly named Book button at the bottom of the iPhoto window.

9.5.1 Exporting Book Pages as Image Files

If one of your book pages is a particularly arresting masterpiece, you may want to print out only that page to hang on your fridge. This tip explains how to separate the page.

Normally, in iPhoto's Book mode, clicking the Preview button displays a preview within iPhoto itself. However, if you Option-click the Preview button, the book opens in the Preview program (the basic Mac OS X graphics viewer).

In Preview, select the single page you want, and then choose File [image] Export. In the dialog box that opens, choose a file format—such as JPEG—and press Enter.

A warning appears, blathering on about exporting to a format that does not support multiple pages. In small print it says, "Only the current page will be exported," which is exactly what you want. When you click OK, you have a spanking new image of your page as it appears in the book, ready to print or email to all your friends.

9.5.2 Printing Books as PDF Files

Books you order through iPhoto can get pricey: a 10-page book costs $30, plus another $3 per additional page. If cash is tight, you can always do the job yourself, using the same technique as discussed in the previous hint. Once the book is open in Preview, simply select File [image] Print, and click the "Save as PDF" button.

You can now print this PDF yourself, if you so desire. If you're using an inkjet photo printer with glossy paper, the results look quite a bit like the finished product you could have bought through Apple—minus the hardbound cover, of course, and with slightly different dimensions.

As a bonus, you now have a handsome "virtual book" PDF that you can email to friends, post on a Web site for downloading, burn to a CD for distribution, and so on. Baby pictures never had it so good.

9.5.3 Edit the Album as You Go

Even when you're working in Book mode, you can rotate photos, rename them, or change their dates. For convenience, don't flip back to Organize mode to perform these tasks.

9.5.4 Intro Pages Anywhere

An Introduction page (one of the choices in the Page Design pop-up menu) doesn't have to be the first page after the cover. Believe it or not, you can turn any page into an Introduction page. Such pages make great section dividers, for example.

Intro pages are especially useful in designs like the Picture Book theme, which otherwise have no text at all. Whatever you type or paste into the Introduction page can set the scene and explain the ensuing uncaptioned pages of pictures.


9.6 Working with Other Programs

iPhoto doesn't work in a vacuum. It's perfectly happy to transport your photos to an email program for sending, a graphics program like Photoshop or GraphicConverter for editing, and so on. It's a great team player—and thus a great source of hints like the following.

9.6.1 Emailing Photos

You can send selected photos to interested parties by email, provided that you use one of the Big Four programs: Mail, Entourage, Eudora, or America Online. (Set your [image] preferred program in iPhoto [image] Preferences [image] > General.)

And even if you use another mail program, like Mailsmith, PowerMail, or QuickMail Pro, you're still in luck. The freeware iPhoto Mailer Patcher, which you can download from http://homepage.mac.com/jacksim/software/imp.html, solves that problem neatly. As promised, it patches iPhoto so that you can use virtually any email program under the sun. It then replaces the Email icon at the bottom of the screen with that of your chosen program and installs a new AppleScript to handle the mailing duties.

iPhoto Mailer Patcher includes a Restore function that returns iPhoto to its original, more limited condition. Be sure to use this feature before you upgrade to a new version of iPhoto.

9.6.2 Shorter URLs for Exported Slideshows

You don't need a .Mac account to create handsome online slideshows from your iPhoto photos. If you have a Web site, you can use the File [image] Export command to build equally great-looking online slideshow files. The result is a folder on your hard drive containing a folder full of thumbnail images, an HTML "home page" to display them, and folders full of Web pages and full-size images that appear when a visitor clicks one of the thumbnails.

Trouble is, the home page document isn't called index.html. It's called whatever you named the export folder—Vacation, for example. Consequently, your visitors have to do a lot of typing—something like http://www.earthlink.net/Vacation/Vacation.html—just to see your slideshow home page. They must specify both the Vacation folder and the Vacation.html file inside it.

Here's how to save them some time and energy: choose File [image] Export, click the Web Page tab, set up your show, and click the Export button. In the Save dialog box, click the New Folder button to create a new folder named "index." Export your slideshow to it; iPhoto uses "index" as the basis of all the files and folders inside.

Before you upload the whole index folder to your Web site, though, give it a name better suited to its purpose (Vacation, for example). Now, because the folder still contains a document called index.html, your visitors automatically see the startup page for your slideshow (the index.html file) when they type only http://www.earthlink.net/Vacation into their browsers.

The beauty of this hint is that it lets you create as many slideshows on your site as you like. And each has a nice, short URL, thanks to the index.html file nestled inside each slideshow folder.


Chapter 10. The Other iApps

Sure, iTunes and iPhoto may be the Big iKahunas as far as hints are concerned...but it takes a whole iVillage of iApps to make a digital hub. The rest—iCal (for tracking appointments and events), iChat (for online conversations), iMovie (for digital movie-making), and iDVD (for producing DVDs on SuperDrive machines)—have a few tricks up their respective sleeves as well.


10.1 iCal

iCal offers several advantages over paper calendars. For example, it can:

  • Automate the process of entering repeating events, such as weekly staff meetings or gym workout dates.

  • Give you a gentle nudge (with a sound, a dialog box, or even an email) when an important appointment is approaching.

  • Share information with your Address Book program, Mail, your iPod, other Macs, calendars on the Internet, or a Palm organizer. Some of these features require a $100-per-year .Mac account, while others simply require iSync. But many iCal features work just fine on a single Mac, even without an Internet connection.

10.1.1 Multiline Entries

When you type in a new calendar entry—what iCal calls an event—and then press Return, the program adds it to your calendar. Let's say you want your event to appear on multiple lines, though, as shown in Figure 10-1. What then?

10.1.2 View Any Number of Days at Once

iCal seems to offer three distinct views, which you can select by clicking the appropriate button below the calendar: Day, Week, and Month. In reality, though, there are additional views, available only through a set of hidden keyboard shortcuts.

If you press and hold Option and [image], then hit any of the keys from 1 to 7, you display that same number of days on the iCal calendar. For instance, [image] -Option-4 shows four days; Option- [image] -7 shows a full week. If you're one of the lucky people with a three-day work week, Option- [image] -3 shows just your workdays, and Option- [image] -4 displays your extended weekends!

Figure 10-1. By holding down Option before you press Return, you force iCal to wrap your entry onto another line (technically, you insert a line break). This trick is handy for making a quick-and-dirty two-line reminder, for example, out of a single event. (To turn the info pane into a separate window, as shown here, open the info drawer and choose Window [image] Detach Info.)

10.1.3 Take Advantage of the Scroll Wheel Mouse

If you're someone who believes mice should have a wheel and more than one button, you're in luck—your scroll wheel can save you some work in iCal. When creating or editing an event, you can use the scroll wheel to scroll within almost all the fields in the Info pane. For example:

  • Click the month in the "from" field and your scroll wheel moves to the next or previous month as you scroll.

  • Click Status, and select a level of importance for the event with a simple scroll.

  • Use the scroll wheel to navigate any field that has a set of selectable options (like the Color pop-up menu).

10.1.4 Take Advantage of the Keyboard

If you haven't splurged on a power-user mouse (see the previous hint), don't despair—you can still save time in iCal's data entry phase by the wise use of your keyboard. Use the Tab key to move from field to field in the Info pane, then open any of the pop-up menus, such as Status or Repeat, by hitting the Space bar. You can then use the arrow keys to choose the setting you'd like to change.

A method even faster than that, though, is simply typing the first few letters of the menu selection. Type Co in the Status menu, for instance, and the menu jumps to "Confirmed." Between the Tab key, the Space bar, and the rest of your keyboard, you can fly through the Info pane in iCal without ever touching the mouse.

10.1.5 Open the Main iCal Window via the Keyboard

Are you one of those people who prefers to leave iCal running all the time? If so, you probably close the main window to regain some of your screen real estate. iCal includes a number of handy keyboard shortcuts in its Window menu, but unfortunately there isn't one for reopening the iCal window when you need it.

You might think you could use Mac OS X 10.3's Keyboard Shortcuts preferences to create your own shortcut for this item—but you'd be wrong. For whatever reason, Apple decided not to let you add a shortcut for the iCal menu item.

Luckily, there's a simple workaround. To activate iCal and open its main window, first hit [image] -Tab until iCal is active, then hit [image] -T (which is the shortcut for View [image] Go to Today). This forces iCal to open the main window—mouselessly.

10.1.6 Change iCal's Email Messages

Although iCal's preprogrammed messages for meetings and reminders aren't bad, you may want to customize them for an added personal touch. Luckily, it's not too hard to do. Quit iCal, and then Control-click the iCal icon in the Finder and select Show Package Contents.

In the new window that opens, navigate to Contents [image] Resources [image] English.lproj. Find the file named iTIP.strings, and duplicate it in the Finder (just in case something goes wrong). Then drag and drop the original onto your favorite text editor. When the file opens, you'll see something like what's shown in Figure 10-2.

To customize the messages, change the text on the right side of the "=", but make sure you leave the quotation marks and semicolon in place. The lines that begin with "/*" are comments, and they do a great job of explaining exactly what each subsequent line is for.

Figure 10-2. The messages that iCal displays can be easily customized by editing the iTIP.strings file. As shown here, only change the text on the right-hand side of the equals sign (=). Do not change or delete the "%@" symbol, as that's what iCal uses to insert names, dates, and other information.

When you're done, save and close the file, then relaunch iCal. Now, the next time a message is shown, it will use your newly customized messages.

If something goes wrong, replace your modified iTIP file with the backup you made at the start of this hint.

10.1.7 Moving Events from One Calendar to Another

Just as iTunes has playlists that let you organize songs into subsets, and iPhoto has albums that let you organize photos into subsets, iCal has something called calendars that, not surprisingly, let you organize appointments into subsets. One person might have calendars called Home, Work, and TV Reminders. Another might have Me, Spouse 'n Me, and Whole Family. A small business could have categories called Deductible Travel, R&D, and R&R. You can name your calendars anything you like.

To create a calendar, double-click any white space in the Calendar list (below the others), or click the + button at the lower-left corner of the iCal window. Now type a name that defines the category in your mind.

Should you ever want to reassign an event to a different category, well, that's possible, too. Figure 10-3 explains how.

This hint moves an event from one calendar category to another; it doesn't copy it like iPhoto or iTunes does.

Figure 10-3. If you Control-click an event, a menu pops up with a list of your calendars. Select one, and iCal moves the event to that calendar.

10.1.8 Useful Calendars from Apple

To become really organized using iCal, download a few of the free calendars Apple offers at www.apple.com/ical/library. You can choose from such tasty treats as holiday schedules, NBA and NFL game times, and movie release dates, among many others.

Of course, you might like to view these calendars before you download them. Here's the secret: take a calendar's "subscribe" URL, replace "webcal" with "http,"and take off the ".ics" extension.

For example, to see the U.S. holiday calendar, change webcal://ical.mac.com/ical/US32Holidays.ics to http://ical.mac.com/ical/US32Holidays. The calendar appears right in your browser for your perusal pleasure.

You'll find dozens more preloaded calendars at www.icalshare.com, ready to import into your own copy of iCal.

10.1.9 Merging Calendars

As noted in hint Section 10.1.7, iCal lets you create multiple calendars (categories) that you can hide and show at will. But what if you've subscribed to the season calendars for both the Tampa Bay Devil Rays and the Green Bay Packers, yet you want just a single unified calendar called Sports? This hint shows you how to combine calendars, using the Devil Rays/Packers scenario as an example.

In the Calendars list (upper-left of the iCal window), click the Packers calendar, and then choose File [image] Export. Name the file something memorable (perhaps "Packers Export"), press [image] -D to choose the desktop as the destination, and then click Export. Switch to the Finder, and then drag your newly exported file onto the Devil Rays calendar in iCal—that is, directly onto its name in the calendar list. You've now got one merged calendar.

To rename the calendar something more appropriate, just double-click the calendar's name. And don't forget to erase the exported calendar from both your desktop and iCal; now that you've merged the calendars, you no longer need the original.

You can merge more than two calendars. In fact, there's no limit to the number of calendars you can merge by dragging them onto a single calendar in iCal. Regardless of how many you merge, however, you still must export each calendar one at a time.

10.1.10 Replacing iCal's Dock Icon

On a brand-new Mac, iCal's Dock icon displays July 17 as the date—an icon that makes no sense 364 days of the year. Each time you open iCal, Mac OS X updates its Dock icon to the current date. That's fine, too, but it still means that you're stuck with an out-of-date date unless you open iCal once a day.

One way to solve the problem is to paste in a custom icon of your own choosing. For your convenience, Apple has given you a blank calendar icon to work from, as shown in Figure 10-4.

Figure 10-4. Use a blank calendar icon if the icon with varying dates annoys you.

Here's how to swap in the blank calendar icon:

In the Finder, open your Applications folder, Control-click iCal, and then choose Show Package Contents from the shortcut menu. Open the Contents [image] Resources folder, find the file named iCal-Empty.icns, and copy it by clicking it once and choosing Edit [image] Copy ( [image] -C).

In the open Resources window, open the English.lproj folder. Choose Edit [image] Paste (or [image] -V) to paste the copy of the empty icon file.

If you view the Resources window as a list view, the file you just pasted appears directly after something named iCal.icns, which you should rename to iCal_OLD.icns (or any other name that will remind you that this was the original). Finally, rename iCal-Empty.icns to iCal.icns.

To see your unconfusing new icon, either log out and log in again or restart the Mac.

10.1.11 Setting Identical Window Sizes

iCal lets you view your calendar by day, week, or month. It also remembers the window size for each mode independently, since Day probably doesn't require as much real estate as Month. Nevertheless, you may find the size change distracting when you jump from one mode to another.

Yes, you could take the time to drag all three windows to the same size—just make sure you've got half an afternoon and a bottle of Advil handy before you start. A more precise way to create three identically sized windows is to edit iCal's preference file. Here's how:

  1. Set the Day view window to the size you'd like to use for all three views, and then quit iCal.

    Behind the scenes, you've just implanted certain window dimensions in iCal's preferences file.

  2. In the Finder, open your Home [image] Library [image] Preferences folder. Find the file called com.apple.iCal.plist, and drag it onto the icon of TextEdit.

    See Section P.3.5.1 for details on this technique. You may wish to make a copy of the file first and save it to your desktop—just in case something goes awry.

    In the text file filled with code that now opens before you, look for the first <dict> tag a few lines from the top. Just below that, you should see something like this:

    <key>1-day view window rect</key>

<string>{{640, 265}, {846, 742}}</string>

    The text between the <string> tags will probably be different on your machine, because it reflects your window size and location.

  3. Carefully select and copy the text between the <string> and </string> tags.

    Press [image] -C, for example.

  4. Find the <key>7-day view window rect</key> line further down in the file. Directly below that, replace the text between the <string> tags with the stuff you just copied in the previous step.

    That is, select the text you want to replace, and then press [image] -V to paste. You've just set the Week view window to the same size as the Day view window.

  5. Find the <key>monthly view window rect</key> line. Once again, replace the text between the subsequent <string> tags with the stuff you just copied in step 3.

    You've just set the Month view window to the same size as the Day view window.

  6. Save the file, quit the text editor, and then reopen iCal.

    You now have identically sized windows in all three views.

If you change one of the windows' size in iCal, it stays changed. Doing so undoes all the work you just did to get the windows all the same size. If you like, though, you can always repeat the method with your new size.


10.2 iChat

iChat is Apple's souped-up version of AIM, America Online's Instant Messenger program. With iChat, you can carry on typed conversations with other people, share pictures and documents with a quick drag-and-drop, and have video and audio chats with Mac and PC fans alike—assuming you and your buddies have high-speed Internet connections and video cameras.

If you've signed up for Apple's $100-per-year Mac.com service, you already have an iChat user name: it's your .Mac email address. If you don't use .Mac, you can still use iChat by signing up for a free AIM screen name. You don't need to be a member of AOL to receive an AIM name, either. Just visit www.aol.com/community/directory.html and follow the link that says, "Try AOL Instant Messenger now for FREE."

10.2.1 Prevent Premature Chat Closure

In today's multitasking world, it's never enough to simply do one thing at a time. So, in addition to talking to your 27 online iChat buddies, you're also browsing the Web, working on your doctoral thesis in Word, and creating your latest Photoshop masterpiece. In the midst of all the [image] -tabbing and window dragging, you hit [image] -W, thinking you were closing the thesis, as you're done editing for the day. Instead, much to your dismay, one of your 27 chat windows vanishes. Although iChat issues a warning if you try to quit with an active chat window open, you get no such warning if you merely close an active chat.

Since Mac OS X 10.3 lets you create your own keyboard shortcuts, you can prevent this accident from ever happening again. Just tell iChat that you want it to use a different keystroke for closing the window, and you'll protect your chat buddies from your overzealous multitasking.

Quit iChat and open the Keyboard & Mouse pane of System Preferences. Click the Keyboard Shortcuts tab, and then click the + sign at the lower left to add a new shortcut. In the sheet that drops down, select iChat from the Application pop-up menu, and then enter Close for the Menu Title (the name of the menu item in iChat that you're changing). Now enter a shortcut you'd like to use—Shift- [image] -W, for instance—in the Keyboard Shortcut box. When everything's configured, it should look like Figure 10-5. Click Add and launch iChat to activate your newly defined shortcut.

Figure 10-5. Using the Keyboard Shortcuts System Preferences pane, you can reassign existing shortcuts. By adding the Shift key to the shortcut for Close, you'll never accidentally close an active iChat window again.

It's now almost impossible to accidentally close an active iChat window.

10.2.2 Adding Buddies to the Buddy List

You may think there's only one way to add someone to your Buddy List—by clicking the + sign at the bottom of the Buddy List window, then using the Address Book sheet to add the person. Sure, you can do it that way...if you prefer doing things the slow, painful way.

A much easier method is to first establish a chat with someone by using File [image] New Chat with Person and entering their screen name. Once the chat window has opened, select View [image] Show Chat Participants, and then just drag and drop your buddy's name into the Buddy List window, as shown in Figure 10-6.

10.2.3 Moving Buddies to a New Screen Name

iChat uses America Online's AIM protocol to communicate with both Mac and PC fans around the world. One of the benefits of using AIM is that you can change your screen name any time you like, just by visiting www.aim.com and registering a new name. (If you use your .Mac address for your iChat ID, you can't change it quite so easily, of course.) So when you tire of your once-trendy "YoDude_123" identity, it's pretty easy to put that era behind you by creating a new screen name.

But what about all the buddies you added to your original screen name? When you log in to iChat with your new name, your buddy list will be empty. Sure, you could start adding them back one-by-one using the Buddies [image] Add a Buddy menu command, but you're using a Mac—why do things the hard way?

Figure 10-6. Tired of the long slog through the Address Book to add a new buddy to your Buddy List? Just drag a new buddy's icon into your Buddy List instead.

When you added all your buddies under your original screen name, each one of them was given an address card in Address Book. To transfer these records to your new screen name, choose Window [image] Address Book. Click once on any item in the Name column, then hit [image] -A to select all of the entries. Now drag and drop this list (try using Exposé via F9 to reveal all your open windows) onto the Buddy List window in iChat. Presto! All of your old buddies are added to your new screen name.

10.2.4 Creating Your Own Image Icon

iChat, like other instant-messaging programs, lets you associate an icon with your screen identity. Anyone you chat with sees this picture (known in geek circles as an avatar), so they can see what you look like—or what you'd like them to think you look like.

Screen identity icons are 32 pixels square. You could create one using a graphics program, taking the time to trim your photo to fit this square. Or you can use iChat's convenient built-in tool for this very task.

Drag a graphics file of any size onto the iChat Buddy List window and drop it on the icon to the right of your name. A new window opens up, revealing your image behind a small, see-through square. Edit the result as described in Figure 10-7. The selected stuff in the middle becomes your icon.

When you're finished, click Done. Your newly created icon now appears next to your name, and on all your buddies' screens as well.

iChat remembers the last 16 icons you've used. If that's not enough for you, you'll have to rely on a traditional graphics application to create and save additional icons on your hard drive.

Figure 10-7. Drag your image around to align the part you want with the transparent square. Use the slider dot below the image to resize it.

10.2.5 Display Your AIM Screen Name or .Mac Account Name

Need to see the AIM or .Mac account that you're currently using in iChat? You could go to your Address Book, find the entry under your name, and then see which account you set up for iChat. But why waste the time?

Instead, just click your name in the Buddy List window; it switches from displaying your name to displaying your AIM or .Mac account name. Click again to switch back to the normal name display.

These clicks have no effect on what others see. They're simply an easy way to see your account information on your own screen.

10.2.6 Disable Certain Emoticons

Emoticons are those cute faces you can create by either typing certain keystrokes—such as :) to make a smiley face—or by using the pop-up menu at the right side of the input line in instant message windows. Generally speaking, emoticons are useful, as they help convey emotion that doesn't always come through in pure text messages.

Sometimes they can get in the way, though. Try sending a list of objects, such as A) item #1; B) item #2 in iChat, and you'll find that your B) turns into a smiley face wearing sunglasses. If you'd rather avoid this fate, help is at hand.

  1. Quit iChat.

    This ensures that any changes you make won't interfere with the running program.

  2. In the Finder, navigate to System [image] Library [image] PrivateFrameworks [image] [image] InstantMessage.framework [image] > Versions [image] A [image] Resources.

    This folder contains all the emoticons that iChat uses, as well as the preferences for when iChat should use them.

  3. Select the English.lproj folder and choose File [image] Get Info.

    Click the triangle next to Details in the Ownership & Permissions section.

  4. Click the lock icon, then change the folder's owner from System to your user name.

    Enter your administrator password when asked. Doing so gives you ownership of the folder, so you can make the necessary changes.

    Leave the Info window open—you'll be needing it again shortly.

  5. Open the English.lproj folder and duplicate SmileyTable.plist.

    You've just created a backup of the smiley file in case something goes wrong.

  6. Drag and drop the original SmileyTable.plist file onto TextEdit.

    When the file opens, you should see something like Figure 10-8.

  7. Find the section of the file for the emoticon you wish to modify.

    For instance, to keep "B)" from triggering the Cool emoticon, use TextEdit to search for "Cool." TextEdit finds the following chunk of code:

    ...

<array>

        <string>8-)</string>

        <string>8)</string>

        <string>B-)</string>

        <string>B)</string>

</array>

<key>Filename</key>

<string>cool</string>

...

    To remove the "B)" shortcut, delete the entire <string>B)</string> line. You can, of course, make other modifications while you're here, including adding shortcuts. To do that, just insert new lines that look exactly like these, but change the keys within the <string> tags.

    Remember to make the changes in the proper section for each emoticon.

    When you're done, save the file (overwriting, if asked) and quit the editor.

    Figure 10-8. The smiley file controls which keyboard shortcuts create which emoticons. Here, the shortcuts for the normal Smile and the Wink have been highlighted with boxes.

  8. In the Finder, return to the Get Info box and set the Owner pop-up menu back to System.

    You may have to re-enter your admin password.

  9. Close the Get Info box, and launch iChat. Test your newly disabled emoticon by sending someone a "B)" message.

    You might think that disabling the graphic on your machine wouldn't change things on the other end, as the other person's machine would go ahead and interpret the symbols to display the Cool emoticon. However, that's not how iChat works. It renders the emoticons on your computer and sends them with the message. Thus, if you don't see it on your screen, neither will the recipient.

10.2.7 Use Emoticons in Status Messages

iChat's status message is that single line of text just below your name near the top of the iChat Buddy List window. Typically, it says something like Available or Away, but you can also set a custom message here to tell everyone exactly how you feel. To do so, click the line of text itself, and then select Custom from either the green (Available) or red (Away) sections of the pop-up menu.

The coolest part, though, is that you can include emoticons in your status message, as seen in Figure 10-9.

Figure 10-9. By including an emoticon in your status message, you can really show the rest of the iChat universe how you're feeling at the moment.

The key to using these emoticons lies in the pop-up menu at the right-hand edge of each instant message window, as seen in Figure 10-10.

Figure 10-10. When you mouse over an icon in the emoticons pop-up menu, you'll see not only its name, but also the keys used to create it: 8-) in this case. To put an emoticon into your status message, just use the appropriate keystrokes as part of the message.

You won't see your custom icon in your own Buddy List window (you'll just see the textual representation), but other chatters will get the full emoticon treatment. Go easy on them by not using 10 emoticons in one status message.

10.2.8 Create Multiline Messages

If you have a lot to say in an iChat instant message, iChat is smart enough to automatically expand the input box as you type. That is, when you reach the end of the line, the input box adds another blank line for your continued typing. But what if you want to arbitrarily insert line breaks, like when you're sending someone a to-do list? Figure 10-11 holds the solution.

Figure 10-11. To send someone a list of items, as seen here, the answer is simple: press Option-Return wherever you'd like to see a line break. Your message won't be sent until you hit Return alone, and the recipient will see your message laid out as you set it up.

10.2.9 Send Messages to Cellphones

Do you have friends with cellphones? Want to let them know that you're around? Most cellphones support something called Short Message Service, or SMS. iChat AV supports SMS, which means you can send a text message to a cellphone nearly as easily as you can send one to a logged-on friend.

Sending an SMS is easy, and requires only that you know your buddy's cellphone number. In iChat, select File [image] New Chat with Person. Instead of entering a name, though, enter the person's phone number, formatted like this: +13035551212, where (303) 555-1212 is the phone number. When you type a message and hit Return, your text message goes on its way to your buddy's phone.

Depending on your buddy's cell service, the message may take a few minutes to arrive, and she may or may not be able to reply from her phone when it does.

10.2.10 Stream Prerecorded Videos

Do you have a digital video recording of your son's second birthday party that Grandma just can't wait to see? Or is your Dad interested in seeing the video of your new home? You could, of course, use iMovie to import the video from your camera, edit it, then burn DVDs or CDs with QuickTime movies for the relatives. But you live in the age of Mac OS X: use iChat to give your loved ones instant satisfaction.

This trick doesn't work on G3 iMacs, PowerBooks, desktop towers, and iBooks, since G3s aren't fast enough to process and transmit the video.

Connect your camera to your Mac, but instead of putting it in the On position, set it to VTR mode—the mode you'd normally use for importing into iMovie. Now launch iChat and find your relative's name in your buddy list. Click their camera icon to initiate a video chat, then, after the connection begins, press Play on the video camera. Your prerecorded video now broadcasts to your relatives, who can watch it and comment as the tape plays. They won't get to see all your iMovie and iDVD editing mastery, of course, but they'll get to see the video much sooner.

10.2.11 Watch Disk Space Usage When You Log

iChat has the ability to log (record) all of your text-based iChats, but in the program's factory settings, logging is turned off. To start logging, open iChat's Preferences, click the Messages icon, and then turn on "Automatically save chat transcripts." iChat stores these logs in your Home [image] Documents [image] [image] iChats folder.

This location can't be changed, but individual transcripts can be moved or copied.

If you have logging turned on, one thing to be aware of is that iChat logs can grow very big very quickly. That's primarily because iChat keeps an exact duplicate of your chats, including any pictures or files that you sent or received during the discussion.

If you lead a relatively active chat life, sending and receiving numerous images, you may want to keep an eye on the iChats folder. Free up drive space by deleting older chats that you no longer need. Each chat file's name shows the chat participant, date, and time, so it's easy to delete specific chats right in the Finder.

10.2.12 Spell Checking

A key benefit of Cocoa programs (Sidebar 4.2) is that they include automatic, on-the-fly spell checking. iChat, however, comes with this feature turned off. After all, most chat words would freak out any self-respecting spell checker: "AFK," "dont have time for chating now," "ROTFL!" and so on.

Still, if you're chatting with a more literate partner, you can turn on the spell checker by choosing Edit [image] Spelling [image] [image] Check Spelling As You Type. From now on, incorrectly spelled words appear with a red underline beneath them, just as in other Cocoa programs like TextEdit and Mail.

If the red underlining distracts you, turn the automated feature off. You can always spell check an individual word now and then by Control-clicking it (Figure 10-12).

10.2.13 Chat Rooms for Group Discussions

Although iChat specializes in one-on-one messaging, it can also create "rooms" for conversations among many people. For example, if your siblings live in seven different cities and you want to involve everyone in a discussion about buying Dad a vintage Yugo for his birthday, you can create a "Birthday Business" chat room and save yourself the trouble of talking to each sister and brother individually.

To create a new chat room, choose File [image] Go to Chat and enter a name for the room. (Unfortunately, if you type a chat room name that's already in use somewhere in cyberspace, you join that room instead of creating a new one.) Once you've built the new room, drag the names of everyone you want into the Participants pane to send them virtual invitations.

To create a nameless chat room instead, just choose File [image] New Chat. Chat rooms you launch this way are inaccessible to people whom you or one of the other participants haven't specifically added.

Chat rooms hang around until every participant has closed the chat window.

Figure 10-12. If you Control-click a misspelled word, iChat displays alternative spellings and asks if you want to learn or ignore the word.

If you run a small company, chat rooms can be a good way to keep in touch with your customers. Tell them that they can find you on Monday from 3 p.m.-5 p.m. in the chat room named, say, "CyberWidget's Customer Chat," and then spend a couple of hours talking with whomever stops by.

10.2.14 Changing the Chat Background

For kicks, you can set the image iChat uses as the background for chat windows. Choose View [image] Set Chat Background, and navigate around your machine to pick a file you like.

For even more fun, you can change the background for the current chat only: just drag a graphics file into the big chat area. The current background changes instantly. (Any new windows you open, though, will still use the picture you designated in Set Chat Background.)

10.2.15 Bring Back Image Pasting

There may be times when you're not able to send an image in iChat. This problem can happen for a number of reasons, including errors on AOL's server. Usually, the inconvenience is temporary, and image pasting will work again in the near future.

Sometimes, though, it seems that the ability to paste images is totally absent. In particular, this failure can occur when you try to transfer an image to someone using a non-iChat AIM client. Adium, for example, doesn't support image transfer. Even worse, the mere act of trying to send images to someone on Adium can disable image pasting for anyone you're having a conversation with. The symptom of this problem is an AIM error that reads, "The AIM service could not send the message: [hresult 0x80000003]" or something similar to that. If your image pasting is broken, you'll see this every time you try to send an image.

You might think the solution would be to quit and restart iChat, but alas, that doesn't do the trick. That's because iChat uses an invisible background application in addition to the main iChat program. When you quit iChat, the background application, which is often the root of the problem, continues to run.

To make image pasting work again, you'll need to quit iChat, then launch Activity Monitor (in Applications [image] Utilities). Find the process named iChatAgent in the list of running tasks, click it once to select it, then click the Quit Process button in the toolbar (or select Process [image] Quit). When you relaunch iChat (which automatically launches iChatAgent again), you'll find that your ability to paste images has been restored.

10.2.16 Opening Transferred Images

When somebody sends you a graphic via iChat, it appears in your chat window as a small preview of itself. To view it at regular size, you have two choices: either resize the chat window, or drag the image to the desktop and then double-click it to open it.

This is a perfectly fine system for retirees who have time to rename and file their desktop leftovers. If that's not you, though, and if you'd prefer not to make gigantic iChat windows, there's an alternative. Simply drag the transferred image to the Dock icon of your favorite graphics program. Presto! The image opens without appearing on your desktop. Now you can rename and save it in one simple step.


10.3 iDVD

iDVD is the perfect partner to iMovie. It turns your newly created film masterpiece into a professional-looking DVD, complete with moving menus and background sound effects, able to leap tall buildings in a single bound, and ready to play on nearly any DVD player.

10.3.1 Making iDVD Fonts Available in Other Programs

iDVD comes with a number of interesting fonts, including Bank Gothic, Cracked, Santa Fe, and so on (Figure 10-13). It sure would be nice to have these fonts available in your other programs, too.

Figure 10-13. iDVD includes a collection of high-quality fonts with bold strokes ideal for viewing on television sets. Here's just a small sampling of the fonts, which you can make available in other programs, like Mail and TextEdit.

Well, then, make it so! In the Finder, Control-click iDVD, choose Show Package Contents from the shortcut menu, and then open the Contents [image] Resources [image] Fonts folder. Select the fonts you want, and Option-drag them onto your Home [image] Library [image] Fonts folder. (Option-dragging creates a duplicate, so iDVD won't freak out if it can't find the fonts where it expects them to be.)

You now have access to the iDVD fonts from any Mac OS X program.

To see the fonts in other programs, you must quit and restart those that were already running when you made the copies.

10.3.2 Using Apple's Theme Movies in Custom Themes

Many of iDVD's themes (canned design schemes)—Fish One, Fish Two, and Road Trip One, for example—feature full-motion background videos. They add a professional touch to any DVD, and, with this hint, you can add them to your own homemade themes.

Start by designing your theme. To begin, specify the fonts, sizes, buttons, and colors you want to use. Next, click the Settings tab so that you can see the Image/Movie well in the Background section (see Figure 10-14).

Figure 10-14. By navigating into the packages containing Apple-supplied themes, you can use any background movie in any iDVD theme you wish. Just drag and drop the movie into the Image/Movie well, as shown.

Switch to the Finder, Control-click the iDVD program icon, choose Show Package Contents from the shortcut menu, and then open the Contents [image] Resources folder. You're now ready to raid Apple's canned themes for their background movies.

For example, to appropriate the background movie from the Marquis theme, Control-click the icon called 17_Marquis.theme, and again select Show Package Contents from the shortcut menu. Now open its Contents [image] Resources folder. Inside are two files that start with the words BackgroundMovie (one apiece for NTSC and PAL, the American and European television formats, respectively).

Position this window so that you can also satisfactorily see the Image/Movie in iDVD, and then just drag the movie into it. You now have one of Apple's standard moving image backgrounds behind your custom theme.

If you carry out this procedure often, consider copying the animated backgrounds from all themes to a new location so you can reach them with less clicking around. You can use the Save as Favorite button on the Settings tab to save your customized theme for future use, too.

10.3.3 Burning Projects to DVD-RW Discs

iDVD lets you burn your movies onto DVD-R (single-use DVD-Recordable) discs only. If you hope to save a little money by trying to burn a movie onto a DVD-RW (RW stands for rewritable—that is, erasable and reusable—disc instead, iDVD tells you to forget about it.

This hitch can lead to some expensive experiments. If you want, for example, to test a new menu layout for your DVD, or if you just want to see how your project looks on the big screen, you must keep burning new DVD-Rs, throwing away perfectly good money each time.

If you don't want to blow your kid's college fund on DVD-Rs, you can fool iDVD into using a DVD-RW disc. In the burning stage of the project, insert a DVD-R disc when requested. Then, when iDVD is in the "Preparing" stage, eject the DVD-R (hold down the Eject key on your keyboard), and insert a DVD-RW instead. iDVD, none the wiser, now happily burns your project to the DVD-RW disc.

10.3.4 Hiding iDVD While Burning a Disc

iDVD is perfectly happy to burn your DVDs in the background—a delightful feature, since DVD burning takes a long time. But you could go a lifetime never knowing that background recording existed. If you try to choose the iDVD [image] Hide iDVD command, you'll have a hard time getting iDVD's attention, given that it's totally focused on preparing and encoding your project.

The solution: As soon as you start the encoding process, switch over to the Finder and choose Finder [image] Hide Others. You can then make individual programs visible by clicking their Dock icons one at a time.

10.3.5 Put iDVD on a Diet

Are you challenged for space on your hard drive? Do you only use one or two iDVD themes, and more or less ignore the others? If so, you can slim down iDVD and free up valuable hard drive space by removing the themes you don't use.

Start by writing down the names of your favorite iDVD themes. Quit iDVD, Control-click its icon in the Finder, and then select Show Package Contents. In the new window that opens, navigate to Contents [image] Resources. There are lots of files in this folder, but you're only interested in those with names that end in .theme. Find all those that aren't on your favorites list, and drag them to a new blank folder you created just for this purpose—iDVD Excess Themes or something similar.

It's a smart idea to now burn your iDVD Excess Themes folder to a DVD-R, just in case you ever want the themes back. If you only have a CD-R available, you can still back up the .theme files, but you may have to split the backup across multiple discs.

After backing up the unused files, delete them and empty the Trash. If you recheck the drive's free space, you may find that you've freed up anywhere from 500 MB to 1 GB or more.

If you change your mind later and want the themes back, just insert your backup disc and copy the .theme files back into the same folder shown above.


10.4 iMovie

iMovie can turn footage from your digital camcorder into professional-looking movies that you can then share as QuickTime files, save onto CDs, or burn onto a DVD for the world to enjoy. Here are a few tips that will make you an iMovie maestro.

10.4.1 Free Add-Ons

With each release of iMovie, Apple stocks its Web site (www.apple.com/imovie) with free plug-ins and add-ons.

At this writing, for example, the listing includes dozens of professionally recorded sound effects and music, plus special effects plug-in samplers from four different software companies. Grab 'em while they're still available.

10.4.2 Synchronizing Still Images

If you're working on a movie project that contains a lot of still images (a slideshow with sound and fancy transitions, for example), and you want each still to hang onscreen for the same amount of time, you can set the duration a few ways.

The best way is to decide and set it before you import the photos. Beneath the clip shelf area, click the Photos icon. Change the number on the rabbit/turtle slider either by adjusting the slider or by typing into the box at the right. Also, if the Ken Burns Effect is on (for panning and zooming over pictures), turn it off. You've just specified the standard onscreen duration for any photos you now import.

Of course, if you want to modify a set of stills you've already imported, this feature isn't much help.

In that case, simply Shift-click each photo's icon in the movie track (at the bottom of the window), and then drag the Speed slider (at the top right), or type the new duration in the box next to the turtle end of the slider. When finished, click Update to reset the durations of all the selected photos.

10.4.3 Import Images and Clips Ordered by File Name

If you're working on a large iMovie project that involves lots of digital photos, make sure you read the prior hint, which explains how to synchronize their timing. Beyond that, you might also find this photo import hint quite handy.

iMovie lets you add photos to the clip bins merely by dragging them from the Finder. You can even select and drag multiple images at once. However, if you use icon-view windows in the Finder, iMovie places the images on its clipboard in a completely random fashion. While this may not be a problem if you're only inserting five or six pictures, it's a big problem if you bring in 250 and want to find "Key_intro_picture.jpg" to put at the start of your slideshow.

However, if you set the Finder window to column view first, iMovie imports the photos (or movie clips) in order based on their file names. No longer will you have to hunt and search for that one clip in a large bin. If you know its file name, you can just find it alphabetically.

10.4.4 Hiding iMovie While It Renders

One of the nice side effects of running iMovie in Mac OS X is that you can switch out of the program while it's rendering (processing) transitions, titles, and effects. iMovie takes a fair amount of time to render this stuff (some title sequences require nearly half an hour on a slow computer), so you'll appreciate the ability to check your email, surf the Web, or make some coffee while you're waiting.

Should you start too many renders, though, your Mac can get a case of digital mononucleosis. Exhausted from rendering, the cursor may jerk across the screen, and the multicolored, spinning "please wait" cursor may rear its twirly head a lot.

To prevent such sluggishness, hide iMovie (choose iMovie [image] Hide iMovie). Mac OS X is much more responsive now that it doesn't have to update the iMovie window.

To check in on the rendering progress, click iMovie's Dock icon to bring iMovie to the front. If the program is still toiling away, just rehide it and return to researching player trades in your fantasy football league.

10.4.5 Removing Extraneous iMovie Help Files

Unless you're a spectacular polyglot, you probably don't need help for iMovie in 14 languages. But that's exactly what the program comes with, eating up nearly 40 MB of hard drive space in the bargain.

The iMovie help files live in your hard drive's Library [image] Documentation [image] iMovie folder. You can delete the folders for the languages you never speak by dragging each of them to the Trash.

10.4.6 Reduce Startup Time

iMovie aficionados understand that the program takes a good while to start up when launched. Even if you're on Apple's latest and greatest hardware, it can still entail a few seconds' worth of waiting after you double-click. But if you're a serious Type A personality and those wasted seconds are interfering with your computing experience, there's a way to reduce iMovie's launch time.

Control-click the iMovie icon in the Finder and select Show Package Contents. In the new window that opens, navigate to Contents [image] Resources [image] [image] Sound Effects. Move the two folders you find there (Skywalker Sound Effects and Standard Sound Effects) to your desktop or another location where you won't accidentally delete them. The next time you launch iMovie, you'll find that it starts much quicker than it used to.

"Wait," you're thinking, "now I don't have any sound effects." True, you won't see any listed in the iMovie Sound Effects section of the Audio tab. But if you need one of the standard sound effects, you can just drag and drop it from the Finder into the timeline of your movie. If you don't use the bundled sound effects all that often, this small inconvenience may well be worth it for the reduction in iMovie startup times.

Should Apple ever update the sound bundles in iMovie, you may not receive the new sounds, as you've modified the original application and the original folders are therefore missing. For that reason, it's probably best to move the folders back to their original location before you update the program—or Mac OS X.


Chapter 11. Other Apple Goodies

Without a doubt, the iApps described in the previous chapters are fantastic programs, and serve very well as the heart of the Apple digital hub software suite. But enough already about iApps—what about the aApps, bApps, cApps, and so on? Truth is, they deserve equal time when it comes to undocumented shortcuts and secrets—and in this chapter, they get it. Open your Applications folder, peruse the list of free programs, and read on.


11.1 Address Book

Mac OS X's Address Book is a central repository where you can enter someone's contact information just once, and then use it in a slew of other programs. While Mail and iChat are the biggest names so far to use this feature, more developers are including Address Book technologies in their own programs every year.

11.1.1 Quick Entries from Mail

One of the most efficient ways to add an email buddy to the Address Book is to do so from within Mail. Just highlight a message and choose Message [image] Add Sender to Address Book—or simply press [image] -Y. Mail instantly adds the person who sent the message to your Address Book, no questions asked.

11.1.2 Sharing Palm Contacts with Address Book

If you've been using Palm Desktop, the free Rolodex program provided with every Palm-based organizer, you might be looking longingly at Address Book. After all, Address Book is just as good at synchronizing your little black book with a Palm organizer (thanks to the free iSync program), but is much more useful than Palm Desktop because it works with Mail and iChat as well. Another sweet benefit is that you can synchronize Address Book between computers through a .Mac account.

Fortunately, you can transfer your Palm Desktop names and addresses to Address Book—just not directly. Here's how.

  1. Create a folder on the desktop to serve as a temporary transfer station for your information.

    You'll use this folder to store contacts before you move them into Address Book.

  2. In Palm Desktop, select the contacts you want to export.

    To select noncontiguous sections of contacts, [image] -click each one. Or, if you'd like to transfer all of your contacts, choose Edit [image] Select All ( [image] -A).

  3. Drag the selected contacts out of the Palm Desktop window and onto the folder you created in step 1.

    Behind the scenes, you've just created a bunch of "virtual business cards," or, in geek circles, vCards.

    This technique works for any program that can export vCard files, not just Palm Desktop.

  4. Open the folder in the Finder.

    You should see a list of files inside, one for each contact you exported.

  5. Press [image] -A to highlight all the vCards, then drag them into the Address Book window.

  6. They now appear as safely ensconced Address Book contacts (Figure 11-1).

Figure 11-1. Need to move multiple contacts from Palm Desktop to Apple's Address Book? Start by highlighting all the addresses you wish to transfer from Palm Desktop. Then, as shown here, drag them into a new temporary folder. From there, drag them directly into the Address Book window.

11.1.3 Viewing Group Members While Creating a Group

Groups are collections of address cards stored under one name. They're very useful if you frequently email two or more contacts at the same time, like your family, your sewing circle, or your poker game buddies. Instead of typing each email address individually, you can simply type the group name ("Family," "Sewing Circle," or "Poker").

Creating a group, alas, isn't quite as easy as you might have hoped. When you choose File [image] New Group, Address Book gives you an empty group to name. Once you've named it, you must click All so that you can drag the names of the group members onto the name of the group. Unfortunately, you can then no longer see the names you've already added to the group. Back and forth you go, clicking All to see your full address list, and then clicking the group name to see who you've already added.

The better way is to use the New Group From Selection command, as illustrated in Figure 11-2.

Figure 11-2. In Address Book's Name column, [image] -click each person you want to include in a group, as shown here. Once you've selected all the contacts you want to add, choose File [image] New Group From Selection. Bam! You've just created a group in a single step.

11.1.4 Which Group Is this Contact in?

You're a well-connected individual. You've got hundreds or thousands of contacts in your Address Book, and you've set up quite a few groups to keep them all in some sort of manageable order. But now you want to send an email to your "Saturday Golf" group, and you can't remember if you've included your newest golfing buddy, Tiger Woods, in the group. Sure, you could scroll through the list of groups and click Saturday Golf, then scroll through the membership in that group looking for Tiger's name.

Chances are, however, you'll find it easier to use this method: enter Tiger Woods' name in the search box and hit Enter. In the Name column, you'll now have just one name (you only know one Tiger Woods, right?). Click his entry in the Name column, then press and hold the Option key; you then see a bright yellow highlight on all groups that contain his name.

You don't have to conduct a search first to make this feature work. If you like, just click any entry in the Name column, and then press Option to see which groups it belongs to.

11.1.5 Maps and Other Nifty Tricks

If your Mac is online, you can summon a map that shows the precise location of anyone in your Address Book (at least, anyone who lives in the United States). It also makes an impressive demo for disillusioned PC users.

All you have to do is click the word "work" or "home" next to a street address. A shortcut menu then appears (even though you didn't Control-click anything). Then choose "Map of," as shown in Figure 11-3. Your Web browser opens and, after a moment, displays a map showing the chosen address.

Figure 11-3. Top: If you click Address Book titles, you get various useful options. For example, if you click next to an email address, you get a menu that lets you "Send email." If you click next to a phone number, "Large Type" pops up. This option displays the number in huge digits—useful if you want to show a phone number to a friend who lives three blocks away.

11.1.6 Phonetic Name Fields

It happens to everyone: you need to look up Fred Graczynwyzniki's phone number, but you can't remember whether it's an i or a y after the w.

Oh, all right, you haven't the faintest memory of how to spell his name. So how are you supposed to look it up? Easy: phonetically.

That's the purpose of the Card [image] Add Field [image] Phonetic First/Last Name command. It inserts, onto the currently selected Address Book card, text boxes called First Phonetic and Last Phonetic. By taking the time to fill in these fields (with a spelling that will help you remember the pronunciation), you'll be able to search for this person using that phonetic spelling later.

The Card [image] Add Field menu contains a number of other useful options: a Birthday field and an extra field for the Yahoo instant messaging system, for example.

11.1.7 To-Do Calls in iCal from Address Book

More often than not, when you need to make yourself a to-do item that involves calling someone, that person is already in your Address Book. Apple doesn't give you an easy way to plunk a contact into a to-do, but thanks to Address Book's support for plug-ins, you can supply this missing feature yourself. Open Script Editor (in Applications [image] AppleScript) and enter the following lines.

You don't need to enter the lines that begin with "- -", as these are simply comments to help you understand one section of the script.

using terms from application "Address Book"

  on action property

    return "phone"

  end action property

  on action title for p with e

    set theName to (first name of p) & " " & (last name of p)

    return "Schedule call to " & theName

  end action title

  on should enable action for p with e

    return true

  end should enable action

  on perform action for p with e

    set theName to (first name of p) & " " & (last name of p)

    scheduleCall((id of p), theName)

  end perform action

end using terms from

on scheduleCall(id, name)

  tell application "iCal"

    -- New to-dos appear in the first calendar in your list

    -- of calendars. To change where they go, change the '1'

    -- in the next line to another number. Just count down from

    -- the top of the calendar list in iCal to find the number.

    set theItem to (make new todo at end of todo of calendar 1)

    set summary of theItem to "Call " & name

    set url of theItem to "addressbook://" & id

    activate

    show theItem

  end tell

end scheduleCall

When you're done typing, click the Compile button. If you did everything right, iCal should launch in the background. (If you receive an error, compare what you typed to the script above and make the appropriate changes.)

When the script compiles correctly, select File [image] Save As and give your script a memorable name (although the name you pick won't be visible in Address Book). Leave the File Format as Script, and save it in your Home [image] Library [image] Address Book Plug-Ins folder.

If you don't have this folder, go ahead and create it—just be sure you spell it exactly as shown.

If you were running Address Book when you created the script, quit and relaunch the program. Then select a contact and click the label next to a phone number (click the word "home," "work," or "mobile"—not the numbers themselves). When you do, you'll see a new option in the pop-up menu, as shown in Figure 11-4.

Figure 11-4. With the Create To-Do Address Book plug-in, merely click a contact's phone number label lets you create a to-do in iCal. As a bonus, the new iCal event automatically contains a link straight back to the contact's record in Address Book.

11.1.8 Perform Reverse Phone Number Lookups

Using an Address Book plug-in (like the one in the previous hint), you can easily look up the address that's matched with a given phone number. This maneuver could be useful if you receive an Address Book card from your boss showing only her work phone number, for example, but you'd like to send her a package by mail.

For a variety of reasons, reverse lookups don't always work properly. More than likely, it won't be your fault.

Quit Address Book if it's running, then open Script [image] Editor (in Applications [image] > AppleScript) and enter the following lines.

When entering this script, do not type the "¬" characters—these signal to Script Editor that a line will continue onto the next line. Instead, just replace these symbols with a space, so you see one long line of text.

using terms from application "Address Book"

  on action property

    return "phone"

  end action property

  on action title for aPerson with aPhone

    return "Look Up Address"

  end action title

  on should enable action for aPerson with aPhone

    return true

  end should enable action

  on perform action for aPerson with aPhone

    set thephone to ((value of aPhone) as string)

    set wpq to 1

    if (label of aPhone) = "work" then

      set wpq to 0

    end if

    set AppleScript's text item delimiters to {"(", ")", " ", "-"}

    set qpa to (first word of thephone)

    set qpx to (second word of thephone)

    set qpp to (third word of thephone)

    set AppleScript's text item delimiters to ""

    open location ¬

    ("http://ypng.infospace.com/home/yellow-pages/redir.htm?" & ¬

    "qfm=p&searchtype=all&fromform=psearch&QK=10&top=1&" & ¬

    "qcat=reverse&qsubcat=revphone&wqp=" & wpq & "&qpa=" & ¬

    qpa & "&qpx=" & qpx & "&qpp=" & qpp & "&x=0&y=0")

 end perform action

end using terms from

As in the previous hint, save the script to your Home [image] Library [image] Address Book Plug-Ins folder. You can name it anything you want, just so long as you keep the File Format as Script.

Now relaunch Address Book. Click the label next to a contact's phone number field (not the phone number itself) and select Look Up Address from the pop-up menu. Your favorite Web browser should open and display the address for the associated telephone number, assuming it was able to find a match.

11.1.9 Reveal a Contact's Age in Years

Want to see the ages of your contacts expressed in years, instead of just seeing their birthdays in Address Book? The following Address Book script will display such information for you—perfect if you failed kindergarten counting class.

As in the previous two hints, enter this script in Script Editor (in Applications [image] AppleScript). Replace the "¬" symbols with spaces to make long lines instead of multiple lines.

using terms from application "Address Book"

  on action property

    return "birth date"

  end action property

  on action title for p with e

    set monthnow to (month of (current date) as number)

    set daynow to (day of (current date) as number)

    set monthcheck to ((month of e) as number)

    set daycheck to ((day of e) as number)

    if monthnow < monthcheck then

      return (first name of p) & " is " &Â¬

      (((year of (current date)) - (year of e) - 1)¬

      as string) & " years old"

    else

      if monthnow = monthcheck then

        if daynow < daycheck then

          return (first name of p) & " " &Â¬

          (((year of (current date)) - (year of e) - 1)¬

          as string) & " years old"

        end if

      end if

      return (first name of p) & " " &Â¬

      (((year of (current date)) - (year of e)) as string) &Â¬

      " years old"

    end if

  end action title

  on should enable action for p with e

    return true

  end should enable action

end using terms from

Once again, save the script in your Home [image] Library [image] Address Book Plug-Ins folder, naming it whatever you want and keeping the File Format set to Script. Relaunch Address Book, click a contact, then click the "birthday" label to view the relevant age in years.

11.1.10 Check the Weather in a Contact's Town

As with the previous three hints, this is another Address Book plug-in. Once you've installed it, you can check the weather in any contact's town with a simple click of the mouse. If you need details on creating and saving Address Book plug-ins, see any of the three previous hints. (Reminder: don't enter the ¬ characters; just replace them with spaces.) Note also that there are two very long lines that are split at "cgi-bin." Remove the line breaks to create long single-lines for both of these.

using terms from application "Address Book"

  on action property

    return "address"

  end action property

  on action title for per with addr

    set ccode to country code of addr

    if ccode is missing value then

      set ccode to default country code

    end if

    if ccode is equal to "us" then

      return (("Weather Underground forecast at " as Unicode text) & ¬

      name of per as Unicode text) & "'s " & label of addr

    else

      return ("Weather Underground forecast of " as Unicode text) & ¬

      city of addr

    end if

  end action title

  on should enable action for per with addr

    if city of addr is missing value then

      return false

    end if

    return true

  end should enable action

  on perform action for per with addr

    set ccode to country code of addr

    if ccode is missing value then

      set ccode to default country code

    end if

    if ccode is equal to "us" then

      set loc to ¬

      "http://www.wunderground.com/cgi-bin/findweather/getForecast?query=" & ¬

      zip of addr

    else

      set loc to ¬

      "http://www.wunderground.com/cgi-bin/findweather/getForecast?query=" & ¬

      city of addr & "," & country of addr

    end if

    open location loc

    return true

  end perform action

end using terms from

After saving the script (see previous hints) and relaunching Address Book, just click the label next to any contact's location. You'll see a new entry in the pop-up list, reading "Weather Underground Forecast at Susan Sample's home" (or whatever contact name you've chosen). When you select this option, your favorite Web browser opens to show the forecast for the chosen location.


11.2 Apple System Profiler

The System Profiler (found in Applications [image] Utilities) tool is like a little X-ray machine for your Mac. It reveals all kinds of useful details about your computer, including information about its hard drives, memory, attached devices, and so on. If you—or a tech-support person you have on the phone—ever have a question about what's inside your machine, System Profiler is a good first stop on Geekland's solution trail.

11.2.1 Quick Access to Apple System Profiler

Instead of burrowing into your Applications [image] Utilities folder to open System Profiler, it's faster to use this trick: choose [image] [image] About This Mac, then, in the resulting dialog box, click the More Info button. The About This Mac window closes and Apple System Profiler opens, just like that.


11.3 Calculator

You may feel a tiny twinge of shame for using your expensive Macintosh for pocket-calculator features—but don't. The Calculator program looks good, works well, and even has a few hidden tricks up its digital sleeve.

Before you read the following hints, however, make sure you know the two most basic Calculator secrets of all:

  • The calculator has two modes: Basic and Advanced (a scientific-calculator mode). Switch between them by selecting your preferred mode in the View menu, or just press [image] -1 for Basic mode and [image] -2 for Advanced mode. For hidden additional modes, just keep reading!

  • Sure, you can operate the calculator by clicking the onscreen buttons, but it's much easier to press the corresponding number and symbol keys on your keyboard.

Some of the calculator operations use unusual keystrokes. For example, to multiply, you need to hit Shift-8; to divide, hit the slash ( /) key; and to add, hit Shift- =. The rest the operations either use self-evident keystrokes like a hyphen (-) for subtraction, or simply don't have corresponding keystrokes, as with Memory Recall.

11.3.1 The Talking Calculator

Believe it or not, you can make your Calculator speak each key you press—a glamorous feature that can actually be fairly useful. For one thing, it ensures that you don't mistype as you keep your eyes on the receipts in front of you.

Just choose Speech [image] Speak Button Pressed to turn this feature on or off. (You choose the voice in the Speech pane of System Preferences.)

If you'd like Calculator to read the results of your calculations too, choose Speech [image] Speak Total.

11.3.2 The Graphing Calculator and Other Hidden Modes

As discussed in the introduction to this section, the Calculator has but two modes, Basic and Advanced . . . or so it would appear. However, with a very simple change in the Finder, you can enable not one, not two, but three new modes: a graphing calculator (Figure 11-5), an expression sheet for entering long calculations, and a hexadecimal calculator for the programmer types among us.

  1. Quit Calculator, if it's running, and switch to the Finder.

    It's always a good idea to quit a program before you modify it.

    Figure 11-5. Ever need a quick way to graph an equation? Use Calculator's built-in (but hidden) graphing calculator! A few simple tricks in the Finder will secure all this graphing goodness (along with a couple of other bonus calculators) for the grand total of $0.00.

  2. Click once on the Calculator icon in the Application folder, and choose File [image] Get Info.

    -I does the same thing from the keyboard.

  3. Click Add, and navigate to Applications [image] Calculator [image] Contents [image] Resources in the dialog box that opens.

    If your dialog box is in list-view mode, you might find it easier to navigate if you switch to column-view mode first. To do so, click the button in the upper-left corner that looks like three vertical bars.

  4. Select ExpressionSheet.calcview, Graphing-2D.calcview, and Hexadecimal.calcview in the dialog box. Click Choose.

    It's easiest to select these items—without selecting anything else—if you hold down [image] while clicking them. Once you've clicked Choose, you should see all three new plug-ins listed in the Plug-ins pane of the Info window.

  5. Close the Info window and relaunch Calculator.

    You'll now see all three new modes listed in the View menu.

11.3.3 Large-Type Calculations

You probably don't usually need to see your calculation results in type big enough to view from Mars. But when you're trying to make a mathematical point to someone across the room, enormous type can come in rather handy. If you're ever in that situation, Control-click anywhere in the results window and choose Large Type from the shortcut menu. The result is something like Figure 11-6.

Figure 11-6. Now that's large type. To display figures for the world to see, Control-click anywhere in the results window and select the first option. To return to a normal perspective, just click the mouse or hit a key.

11.3.4 Unit and Currency Conversions

One of the coolest new features in Calculator is the Convert menu, which lets you perform unit conversions (feet to meters, Celsius to Fahrenheit, and so on) in a variety of different categories including Pressure, Power, Speed, Length, and Temperature. Figure 11-7 depicts the full list of possible conversions.

Currency is one of the more useful conversion tools, as it lets you choose from more than 30 monetary units. Even better, if you're online and choose Convert [image] Update Currency Exchange Rates, Calculator downloads up-to-the-minute exchange rates for all its currencies.

The Convert menu has a handy submenu, Recent Conversions, which makes it easy to repeat several conversions (currency or otherwise) in a row.

11.3.5 The Tale of the Tape

Calculator keeps track of your calculations as you go, thanks to its virtual "paper tape." If, after 43 calculations, your income for 2003 works out to negative $145,675, the paper tape lets you backtrack and see whether you mistyped a number—or whether you need a new job.

Figure 11-7. Top: Through the handy Convert menu, you can learn, for example, that 200 horsepower is equivalent to 149.14 kilowatts...just in case you were about to bet $20 that it's the same as 150.2 kilowatts. More useful for most people is probably the Currency option, which can be updated online (using the last choice in the menu) for current conversion rates.

For a session history, select View [image] Show Paper Tape. The tape window, marked with a time and date stamp, pops into existence (Figure 11-8). You can also copy text from it, which is handy if you want to display your calculations in a Keynote or PowerPoint presentation or a Word document.

Figure 11-8. You can select text from the tape area, copy it (Edit [image] Copy or [image] -C), and then paste it into another program. Amazingly, you can actually edit the numbers on the tape, even long after a calculation is over. The total will update itself when you press the Recalculate Totals button.


11.4 ColorSync Utility

If you're thinking, "I can skip this section, I don't work with color for a living," you're missing out on a lot. The bundled ColorSync Utility has several hidden tricks that are helpful even if your personal idea of ColorSync is trying to pick a shirt to match your neon-blue pants.

11.4.1 Reduce the Size of Photo-Laden PDFs

For those who regularly use Mac OS X's Save as PDF feature with graphics-heavy files (such as iPhoto contact sheets or image-intensive Web sites), you can reduce the size of those PDFs using ColorSync. Downsizing these kinds of PDFs before you email them can save your recipient a lot of unnecessary downloading.

There are two ways to shrink a PDF: you can reduce the file size when you first create the PDF, or you can do so after the fact.

11.4.1.1 When-the-PDF-is-created method

To reduce the file size when you first print to PDF, proceed through your normal routine in the Print dialog box: specify the printer, page layout, and so on. Before you click the Save as PDF button, however, choose ColorSync from the pop-up menu in the middle of the window and select Reduce File Size from the Quartz Filter pop-up menu, as shown in Figure 11-9.

When you click Save as PDF, ColorSync takes over and does its best to reduce the size of the graphics in the file—and it's usually quite successful. You may find, however, that ColorSync is a bit too aggressive, and that you've given up some image quality for disk space. If that's the case, you'll want to use the "after the fact" method instead.

Figure 11-9. This handy ColorSync filter will do its best to reduce the file size of your image-heavy PDF files. Your results will vary based on the number and size of images in your document, but there's a possibility you could see a dramatic reduction in image quality.

11.4.1.2 After-the-PDF-is-created method

If you've already created a PDF without using a ColorSync filter, this method's for you. Launch ColorSync Utility (in Applications [image] [image] Utilities), and use File [image] > Open (or drag and drop) to open your PDF. Click the New button below the list of filters to create an Untitled filter (to rename it to something more memorable, double-click the word "Untitled").

Next, click the Details tab, and then choose Images from the pop-up menu. Another pop-up menu pops up. Select Compression from that one, and then choose JPEG from the final pop-up menu. The Quality slider at the bottom lets you control your PDF's size/quality tradeoff. Specifically, Least makes a small file using terrible image quality; Best makes a large file using superb image quality.

You can see the effect of the filter by turning on the Preview box at the top of the window.

With everything set up, the window should look something like Figure 11-10.

When you're done, click the Apply button, then use File [image] Save As to save the file under a new name (in case you want to revert to the high-quality version later). Should you compare the before and after file sizes in the Finder, you'll most likely find a large reduction for the filtered version.

Figure 11-10. Using the ColorSync Utility, you have complete control over the compression of images in your PDFs, among other things. Here, a new Untitled filter has been created, using medium-low quality JPEG images.

As an added bonus, the filter you just created now appears in the Quartz Filters pop-up on the ColorSync pane of any Print dialog box.

You can create any number of new filters, and combine existing effects for different uses.


11.5 Disk Utility

For Panther, Apple merged the abilities of the old Disk Copy (for making disk images) and the old Disk Utility (for repairing disks) into the all-new, super-convenient Disk Utility. At the same time, however, Apple moved disk image-opening capabilities into the invisible DiskImageMounter program, which launches every time you double-click a disk image in the Finder or download one in Safari.

Still, Disk Utility holds plenty of hidden tricks. You can find the [image] program in Applications [image] > Utilities.

UP TO SPEED Disk Images

No, disks aren't especially concerned with their image. Instead, a disk image is like a digital envelope that can maintain, store, and transfer a bunch of files together, as a unit—or as a single file attached to an email message.

The usual lifecycle of a disk-image file that you download from the Web is illustrated here. First, you download it from a Web site or email message. The result is an icon with a name that usually ends in .img or .dmg (top).

Second, when you double-click this icon, Disk Utility creates an icon that simulates a new disk (middle). Finally, when you double-click this icon, you see exactly what the original creator of the image wanted you to see (bottom). This virtual disk behaves exactly like a CD that you've inserted.

When you're finished working with it, you can "eject" it like a CD. You can also throw away the original .dmg file, unless you think you may want to reinstall the software later.

Making your own disk images can be handy when you want to send someone all of the related files for a project. For instance, you could make a disk image of a Web site that's composed of hundreds of HTML and JPEG files in order to keep them nicely organized in one location.

11.5.1 Dragging Your Way to Disk Images

The quickest way to create a disk image of your own is to launch Disk Utility, select Images [image] New [image] Image from Folder, drag a folder from the Finder into the dialog box, and click Open. Disk Utility then presents a Convert Image dialog box for the disk image you're about to create. Here are the choices for the Image Format pop-up menu:

  • "Read/write" makes your disk image a superb imitation of a hard drive. You can drag files and folders onto it, drag them off of it, change icons' names on it, and so on.

  • "Read-only" makes your disk image behave like a CD-ROM. You can copy things off it, but can't make any changes to it.

  • A "compressed" disk image is best for sending by email or posting on the Web. It takes a little longer to bring back the simulated disk when you double-click a compressed image file, but it takes up a lot less disk space than an uncompressed version. That also makes it the best choice for making backup copies on a separate hard drive or on your disk.

  • Choose "DVD/CD master" if you'd like to burn the disk image straight onto a CD or a DVD. The resulting file is a perfect mirror of an optical disk—ideal for making duplicates, too.

Name your new image, click Save, and let the program go to town.

11.5.2 Speed-Mounting Disk Images

Whenever you double-click a disk image, a progress bar appears, indicating that it's verifying a disk image's checksum before mounting. The Mac is taking this time to compare the data in your copy of the file with a special code in the original to confirm that nothing got scrambled on the way to your machine.

The trouble is, all of this verification business is a relic from the days of relatively unreliable floppy disks. Today, it's basically a waste of time. If the disk image truly did get garbled (an exceedingly remote possibility), then Mac OS X just won't turn the .dmg file into a virtual disk—no harm done. So when that Verifying dialog box appears next time, feel free to click Skip to save yourself some time.

In fact, you can instruct Mac OS X to always skip this verification business. First, launch the Terminal (in Applications [image] Utilities), and type:

defaults write com.apple.frameworks.diskimages skip-verify true

Then hit Return. From now on, all disk images will mount without verification.

If at some point you'd like verification back, repeat the above command, but replace true with false.

11.5.3 Stop Special Treatment of "Internet-Enabled" Disk Images

If you use Safari as your Web browser, you've probably run into Internet-enabled disk images, though you may not know that's what they were. Internet-enabled disk images are—aside from perhaps the most poorly named objects in computing—disk images that, after downloading, automatically expand and mount, then copy their contents onto your hard drive and throw themselves in the Trash. This feature is a blessing for Mac newcomers, as it makes it easier to understand that the file they downloaded is right there, on their desktop and ready to go.

But if you prefer to create a software installation library by keeping your downloaded images (see hint Section 4.3.11), you now have to access the Trash can to retrieve the trashed image. And if you've accidentally emptied your Trash, you'll need to redownload the file just to get the disk image back.

If you'd rather not deal with Internet-enabled disk images, here's a quick fix to prevent their annoying self-destructive behavior. In the Terminal (in your Applications [image] Utilities folder), type:

defaults write com.apple.frameworks.diskimages skip-idme true

Then hit Return. From now on, downloaded disk images will sit quietly on the desktop (or in your specified download folder) until you're ready to do something with them. (To re-enable these self-unpacking images, just repeat the above command, but replace true with false.)

11.5.4 CD-Free Laptop Gaming

If you play games that require the original CD to be in the drive as you play, Disk Utility can lighten your load when you're on the road with your laptop. In essence, you can use Disk Utility to create a simulated CD directly on your hard drive. This arrangement has two benefits. First, it saves your computer from having to spin up its CD drive all the time—a great benefit to battery life. Second, you can relax on the road, knowing that your original CDs are safe at home even if your laptop is lost or stolen.

  1. Insert a CD containing a game you want to play. Open Disk Utility and select the game CD from the list of devices at the left.

    As seen in Figure 11-11, make sure you select the lowest level of the CD (Spider-Man, in this example), not the top level.

  2. After selecting the disk, select Images [image] New [image] Image From [Name of Game].

    In this example, the game's name is Spider-Man (see step 1). A dialog box like the one in the bottom part of Figure 11-11 appears.

  3. Once you've specified a name, location, and format, click Save and prepare to wait.

    The process will likely take between 5 and 15 minutes, depending on the speed of your machine and the size of the image.

    When the imaging process is complete, you can test your new CD-free solution.

  4. Remove the original CD. Double-click the new disk image.

    The disk image turns into a simulated disk on your desktop.

  5. Double-click the game on your hard drive to check if it runs.

    If it does, raise your fist in victory. If not, just drag the image to the Trash and sigh dejectedly. Some games use the presence of the actual CD as a form of copy protection, and therefore don't respond to this trick.

Figure 11-11. Top: Select your game CD from the list of available devices. Be sure to select the contents of the disk in the drive, not the drive itself. (As shown here, the actual disk content appears indented under the drive.)

11.5.5 Password-Protect a Folder

OK, the name of this hint is a bit misleading, since you can't really password-protect a folder in Mac OS X. Still, you can password-protect a disk image, and you can turn a folder into a disk image easily enough.

  1. Select Images [image] New [image] Image from Folder.

    In the dialog box that appears, navigate to the folder you'd like to protect and click Open. In the next dialog box, you're offered several options.

  2. From the Encryption pop-up menu, choose "AES-128 (recommended)."

    In other words, "password-protect this baby."

  3. Choose a name and location for your new disk image file.

    The name you choose here doesn't have to match the original disk or folder name. But do name it something that makes it easier to keep track of what the disk image represents.

  4. Click Save (or press Enter).

    After converting your folder to a disk image (which can take anywhere from five seconds to five hours, depending on the size of the original folder), the Mac asks you to make up a password.

  5. Type the password you want into both boxes.

    Nobody will be able to open your disk image without the password. The exception: If you turn on "Remember password," you'll be able to open the file without typing the password—but only when it's on your own Mac and you've logged into Mac OS X with your own password.

  6. Click OK.

    Disk Utility creates the image and then encrypts it. Your work is complete here: If you double-click the resulting image file, the Finder asks for the password before mounting a virtual disk on your desktop. (That is, unless you turned on "Remember password" in the previous step, in which case it'll open—within your account, anyway—without a password.)

This method is not the one to use if you're going to be adding to the contents of the folder, though. That's because Disk Utility creates a disk image that's just big enough to hold the folder you've specified, making it impossible to add anything else. To create a protected disk image that can grow with your needs, see the next hint.

11.5.6 Create a Password-Protected Blank Disk Image

To create a password-protected image to which you can add future files, select Images [image] New [image] Blank Image. In the dialog box that appears, name your image and specify where you'd like to save it. Use the Size pop-up menu to set the amount of hard drive space to put aside for your image. Be generous, as you won't be able to enlarge the image beyond this size. Use the Encryption pop-up menu to select "AES-128 (recommended)." As you know by now, encryption keeps your data safe from prying eyes.

Finally, select "sparse disk image" from the Format pop-up. A sparse disk image starts small, but knows how big it's allowed to get. If you create, for instance, a 500 MB sparse disk image, it initially uses only about 25 MB of actual drive space. As you add files, however, the disk usage grows, up to a maximum of about 475 MB. (Disk Utility reserves the extra 25 MB for file-storage overhead.)

Once you've set all the options, hit Create and enter the password when prompted. Disk Utility will go to work and create your new, expandable disk image.

POWER USER'S CLINIC FileVault

If you're truly concerned about the security of your files, Panther's FileVault feature lets you turn your entire Home folder into one massive, password-protected disk image. This arrangement is a huge timesaver if you'd rather not create dozens of individually password-protected disk images for all the projects you work on. Instead, FileVault automatically unlocks your Home folder when you log in—and locks it when you log out.

Unfortunately, FileVault has some major downsides. First, all of your important files are scrambled, meaning a single hard drive error could wreak havoc on all of them. Second, it protects your files only while you're logged out. Once

you've logged in, anyone who gets physical access to your computer has access to all your private folders. Lastly, FileVault is dependent on a single password. Lose that, and you've permanently lost every file in your Home folder.

Still, if you work at the Los Alamos nuclear research lab, FileVault can be just the ticket for protecting your files. To turn it on, go to System Preferences [image] Accounts, select your account from the left, open the Security tab, and click Turn on FileVault. Once you create a master password (your last resort if you forget your account's password), Mac OS X lets you turn on FileVault for your own account.

11.5.7 Burning a Multisession CD

Most people think that you need a program like Roxio Toast to record a CD-R disc more than once in Mac OS X. On the contrary, Disk Utility lets you burn a single CD as many times as you like! That's right, regular cheap CD-R discs—not CD-RW (rewritable).

What you'll create here is a multisession disc. Each time you burn more material onto it, you create a new icon that will appear separately when you insert the CD. Figure 11-12, for example, shows a disc that's been burned twice.

Here's how to go about it:

  1. Prepare the material you intend to burn the first time.

    For example, put it all into a folder on your desktop.

  2. Open Disk Utility. Choose Images [image] New [image] Image from Folder. When prompted, select the folder you want to burn, and then click Open.

    Disk Utility asks you to name the disk image you're creating.

  3. Type a name for the image, specify a location (like the desktop), and then click Save.

    In this example, suppose it's called Peas.dmg.

    Figure 11-12. A folder called Carrots was burned to the CD first. Then, a week later, a folder called Peas was burned onto the same disc, creating a second session (an icon on your desktop).

  4. When you're ready to burn, open Disk Utility. Choose Images [image] Burn. Navigate to the disk image Peas.dmg, insert a blank disc, and then click Burn.

    The Burn Disc dialog box appears. Expand the box as shown in Figure 11-13.

    Figure 11-13. Top: To expand this dialog box, click the blue flippy triangle at upper right.

  5. Turn on "Leave disc appendable." Click Burn to record the material onto the CD.

    Disk Utility does its thing, burning your CD as it normally does.

  6. When it comes time to add new material to that disc, repeat steps 1-4.

    This time, in the expanded dialog box shown in Figure 11-13, you'll see that "Allow additional burns" is still turned on. Instead of Burn, though, click the lower-right button that says Append. That's your clue that Disk Utility understands what it's about to do: add information to an existing CD, resulting in a new disc icon on the desktop.

  7. Click Append.

    You've just created a multisession disc!

You can repeat steps 6 and 7 repeatedly, adding more and more sessions to a disc until it's full.


11.6 Font Book

Font Book, found in your Applications folder, is a basic font management application. With it, you can group fonts, activate and deactivate fonts, and view samples from your installed fonts. If you make your living working with hundreds or thousands of fonts for client projects, Font Book probably isn't the best fit for your needs. Instead, try Suitcase from Extensis (www.extensis.com) or MasterJuggler from Alsoft (www.alsoft.com). On the other hand, if your font management needs are relatively basic, Font Book is probably more than you'll ever need. Here are a few hints to help you get the most out of Font Book.

11.6.1 Get Detailed Font Information

When you launch Font Book, you'll see a three-column display with Collection on the left, Font in the middle, and a font preview area on the right. Just below the font preview area is a small dot. Double-click the dot, and a panel will slide up to reveal additional information about the selected font, such as font type, which foundry it's from, when it was copyrighted, and more (Figure 11-14). This data might be useful if you're trying to find other fonts in the same family or from the same foundry, for example.

11.6.2 Reveal All Font Faces at Once

In Font Book, a font's faces (such as regular, bold, and italic) are normally hidden by a flippy triangle next to the font's name. Click the triangle, and you'll see all the faces of that font. But if you're trying to check a number of font faces at once, this procedure might not be your best option. You'd have to select a font, click the disclosure triangle, click a couple of the faces, click another font family, click the disclosure triangle, click a couple of faces, and so on...it could drive you plum crazy!

Here, then, is a timesaving shortcut to display all the fonts' faces. Click any font in the Font column, then choose Edit [image] Select All (or press [image] -A). Hit the right arrow key, and after a brief delay, you'll see that every flippy triangle has now been opened, and you can choose from any of the font faces.

To close everything up again, select a font in the Font column, choose Edit [image] Select All, and hit the left arrow key.

Figure 11-14. When you double-click the dot just below the font preview area, you'll see this font information panel, containing more administrivia about fonts than you might have thought possible. But wait, there's more! Hover your mouse over the labels, and you can get additional information, as shown here. This detailed info doesn't exist for every font, though—so don't be disappointed if you don't see a pop-up label every time.


11.7 Image Capture

Image Capture is a versatile application that can be used to import images from digital cameras and scanners. Beyond those basic features, however, it has a couple of useful tricks.

11.7.1 Create Web Galleries from Existing Images

Granted, iPhoto is terrific for creating Web pages from your digital photographs, but what if you have some photos you'd rather not manage with iPhoto? For instance, a buddy has just given you a CD-ROM full of pictures of his 1953 Chevy Bel Air "Restorer's Special" that he's trying to upload. You really don't want to add these images to iPhoto, create a Web page, then delete them all again.

Fortunately, Image Capture has several hidden scripts, including one for building Web galleries from a folder of images. To handle your buddy's Bel Air project, first copy his images into a new folder on your hard drive. Next, open a new Finder window and navigate to System [image] Library [image] Image Capture [image] Automatic Tasks. There, you'll see a number of files, one of which is named "Build Web Page." Drag and drop the Bel Air onto the Build Web Page icon, and this hidden script will go to work. When it's done, your Bel Air folder now contains a wepbage folder that holds an index.html file, and a folder called webfiles. The index.html file and the folder contain all the final Web output; just open index.html in any Web browser to see the finished Web page. Upload the index file and the webfiles folder to your Web site, and your gallery is online instantly.

When you run this script, the original images remain untouched. Instead, the script copies them to the webfiles folder and modifies them there, so there's no need to worry that you'll lose your originals.

11.7.2 Share Scanners and Cameras Across the Network

One of the most powerful features in Image Capture is the ability to share scanners and digital cameras with other people on your network—for instance, sharing one scanner with all the computers in your house. When someone on your network is using your scanner in this way, you still have complete usage of your own computer—except, of course, for your scanner.

Sharing a digital camera is also possible. In fact, you can even share cameras through a Web browser. If you want your sister in Topeka to download images directly from your camera in Tuscaloosa, Image Capture can help you.

To set up shared devices, open Image Capture [image] Preferences and click the Sharing tab. Any devices you wish to share must be attached and powered up, or Image Capture won't notice them.

On the Sharing tab, click "Share my devices," and then check each device you'd like to share. If you want to make your digital camera available via the Web, click Enable Web-Sharing, too. Add a name for your shared devices, add a password, and you're good to go (Figure 11-15).

Once you've set up sharing on a networked Mac, launch Image Capture on yours. In the Sharing tab of Image Capture [image] Preferences, turn on "Look for shared devices" and click OK. Choose Devices [image] "Browse shared devices" to connect to available cameras and scanners. Once connected, the network devices behave as if they were attached directly to your computer—scans and photos are stored on your hard drive, not the networked computer's.

When you turn on Web sharing, Web denizens anywhere in the world can use a Web browser—even from a PC—to work with your digital camera (Figure 11-16). If you use a firewall such as Mac OS X's built-in version, though, you'll have to open up port 5100 to allow connections to your shared camera.

Even cooler than sharing a digital camera's existing pictures, though, is sharing live shots from your camera over the Internet. It's a great tool for monitoring your house when you're away—no more worrying whether the babysitter forgot to feed the kids.

Before you leave your house, turn on Web sharing for a digital camera attached to your computer, and leave the camera facing the direction you want. Make sure to note the Web address listed at the bottom of Image Capture's preferences: you'll need it to connect to the camera from afar.

Figure 11-15. Using Image Capture's built-in sharing features, you can make your scanner and digital camera available across your network. Here, both a scanner and a digital camera are available for sharing. Web sharing allows people to browse and download images from your digital camera though a Web browser, regardless of their physical location. (Of course, both machines must be connected to the Internet.)

Later, when you want to check on your kids, simply open a Web browser, type in the appropriate Web address, and select the Remote Monitor tab. You'll now see an updated picture every 60 seconds. (You can change this interval by clicking the light-switch icon.)

Figure 11-16. Once you've got your shared camera set up, anyone with a Web browser and the URL can access it. Although Image Capture lets you password-protect shared devices, that password doesn't apply to Web sharing. Keep that in mind before posting your nude self-portraits for the whole Internet to see.

Unfortunately, not all digital cameras support this feature, and there's no way to know whether yours does without trying it.


11.8 Keynote

Keynote is Apple's presentation (slideshow) software, a PowerPoint killer designed to let you create fancy audiovisual presentations. With Keynote, any Mac fan can create Steve Jobs-like presentations with ease. After all, Apple's programmers created Keynote from the ground up, just for His Steveness.

11.8.1 Borrowing Images from Apple's Themes

Keynote includes a number of high-quality, professionally designed themes—collections of graphics, fonts, and colors designed to look good together. Sometimes, though, you might like to use one especially good-looking theme's graphics in your own themes, or even in other programs. This hint shows you how to do that:

  1. In the Finder, Control-click the Keynote program's icon. From the shortcut menu, choose Show Package Contents.

    The program's package window opens (Section P.3.5.1).

  2. Open the Contents [image] Resources [image] Themes folder.

    This folder contains all of the Keynote themes.

    If you've installed any Keynote themes that you obtained from another source, such as the Keynote Theme Park (www.keynotethemepark.com), those themes are usually in Library [image] Application Support [image] Keynote [image] Themes.

    Apple has given each theme a number, followed by the theme name and its size. In other words, 05_Letterpress_8 6.kth is the fifth theme, named Letterpress, and it's sized for an 800 600 pixel monitor. (Graphics sized for a 1024 768 screen say "10 7.")

  3. Control-click the theme you're interested in copying images from. From the shortcut menu, choose Show Package Contents.

    In the new window that opens, you can see all the graphics used in that theme.

  4. Copy the graphics files to a different folder.

    To copy the images, Option-drag them to any convenient location—perhaps somewhere in your Pictures folder. You can now use the copied images in your own themes, iMovie projects, Web pages, and so on.

11.8.2 Create 3 5 Cue Cards

People who give a lot of presentations absolutely love 3 5 index cards. Not only can the cards hold text and graphics, but they're small enough to carry around in your pocket. Unfortunately, both Word and AppleWorks leave wide margins when they print such cards, consuming valuable space that could be used for, say, a list of especially crowd-pleasing Britney Spears jokes.

Instead, consider using Keynote for creating your cue cards. It handles text and graphics easily, plus, it's easy to rearrange the card order. Better yet, when it comes time to print your notes, Keynote can spit out near-perfect 3 5 cards. Here's how:

  1. Open Keynote and create a new presentation with File [image] New ( [image] -N).

    Pick the basic white theme for best results, and choose whatever size you want (you're about to change it).

  2. Once the presentation is ready, select File [image] Slide Size. Set the height to 300 pixels and the width to 500 pixels.

    Add your content to the slides as necessary and remove the overly large master slide templates while you're at it. Save your work.

    POWER USER'S CLINIC Using the Finder's Action Menu

    In hint Section 11.8.1, you can learn how to access Keynote's themes by first selecting Keynote's application icon, and then Control-clicking it in the Finder window. But did you realize that there's a better way to show a package's contents without wearing out your pinky on the Control key?

    With the item selected in the Finder, you can simply click the Action menu (the one that looks like a little gear wheel in the Finder's toolbar) and select Show Package Contents from that menu.

    And to speed things up a little further, once that new Finder window pops open, showing just the Contents folder, you can hit the C key to quickly select the folder. Now change the Finder from icon view (its current state) to column view by quickly using the keyboard shortcut, [image] -3. Now you can simply use the arrow keys to move right or left, up or down, within the Finder view to navigate through folders and select files.

  3. Set up the presentation for printing.

    When it's time to print for the first time, you'll have to do a bit of extra work to make sure your cards print at the right size. Select File [image] Page Setup, and under the Settings pop-up, select Custom Paper Size. In the new pane that appears, click New and type 3 5 Card. Enter a height of 3", and a width of 5". Now set the four margins to 0", or whatever your printer's minimum margins are (the manufacturer's Web site usually lets you know). Click Save and OK.

  4. Select File [image] Page Setup again and make sure that Paper Size is set to "3 5 Card." Click OK.

    Once you've created your custom paper size, you won't have to do so again—in any program.

  5. Choose File [image] Print Slides.

    When your printer's done, you should be greeted by a set of crisp 3 5 index cards, complete with graphics and text. And, if your printer supports it, no margins.


11.9 Preview

Preview is Mac OS X's built-in graphics viewer. When you double-click the icon of a graphics file whose "parent" the Mac can't identify (maybe something you grabbed from a Web page or scanned in), Preview takes over. It handles the work of opening and displaying the image onscreen.

Preview works with pictures saved in a wide variety of formats, including JPEG, TIFF, GIF, and PICT, and less common formats like PNG, SGI, TGA, and MacPaint. Preview can even open complex Photoshop files and multipage PDF documents.

11.9.1 Browsing Multiple Images at Once

Among other things, Preview makes an excellent viewer for batches of graphics. It's preferable to iPhoto, in some regards, because iPhoto makes a copy of every graphic you view and lodges it in your Photo Library.

In the Finder, select all the images you'd like to see, and drag them en masse onto the Preview icon (either on the Dock or in your Applications folder), as shown in Figure 11-17.

Figure 11-17. Drag a group of related images onto the Preview icon, and you can easily browse them from a single image window.

Preview opens a display window with a Thumbnail drawer on the side. You can switch among images by clicking the thumbnails, by using the Page Up and Page Down buttons on the toolbar, or by using the up and down arrow keys.

11.9.2 Control the Display Order when Opening Multiple Images

If you're using the previous hint to look at a bunch of photos simultaneously, you probably want to see the first photo before the last one. Let's face it, that picture of Dave lying on the floor just won't have the same impact if you don't first see him playing the piano. Since most digital cameras create files with numerically incremented file names, you really just want your images to display in order based on their file names—not the seemingly random order that Preview seems to impart on drag-and-dropped images.

If you're reading this hint and saying, "Huh? My images already open in order based on their file name," then you're one of the lucky ones, since you use a column view or list view in the Finder. If you use an icon-view window, though, Preview seems to think you like disarray, so it randomly scrambles your image order when opening images. The real trick, then, is to make sure your Finder window is in list or column view before you drag your images to Preview.

11.9.3 Zoom in Smaller Increments

Preview lets you change the viewed size (scale) of images courtesy of a couple handy toolbar buttons. When you click the Zoom In and Zoom Out icons on the toolbar, you'll quickly notice the change in scale. Namely, the image increases or decreases in size quite dramatically with a single mouse click.

If you'd prefer to take smaller steps while zooming, though, hold down the Option key prior to clicking either icon. Instead of jumping in and out in 50-percent increments, you'll change scale by a more reasonable 5 percent.

To see exactly how much Preview is zooming with each click or Option-click, just add the Scale field to the toolbar. To do so, Control-click the toolbar and select Customize Toolbar. Then drag the Scale icon up into the toolbar and click Done. You can even use the Scale field to type in exactly what scale you want to use for the current image—right down to a tenth of a percent.

11.9.4 Navigating PDF Documents

With the release of Mac OS X 10.3, the Preview application took the place of Adobe's free Acrobat Reader. Nevertheless, if you do a lot of work with PDFs, you still may prefer some of the features in Adobe's free Reader, which can be downloaded at www.adobe.com/products/acrobat/readermain.html. For example, Acrobat Reader offers more advanced search capabilities than Preview, and is a bit better at handling password-protected documents.

If you prefer using Preview for your PDF browsing, though, here are a few tricks to help maximize your time:

  • If the page doesn't fit the window (that is, if the vertical scroll bar appears), you can scroll within the page by using the Page Up and Page Down keys. Pressing Page Up or Page Down when you're at the top or bottom of a page will take you to the previous or next page, respectively.

  • If the page fits entirely inside the window (that is, if the vertical scroll bar isn't visible), you can change from one page to the next by pressing the Page Up and Page Down keys.

  • If you press End, you jump to the bottom of the document. Similarly, Home takes you to the first page.

  • If you turn on continuous scrolling (choose View [image] Continuous Scrolling), the entire PDF is displayed as one long document, with all the page breaks taken out. This mode is quite convenient if you have a scroll wheel mouse, which lets you navigate through the document without ever having to click a thumbnail for the next page.

  • If your mouse has a scroll wheel, you can scroll horizontally by pressing Shift as you turn the scroll wheel.

11.9.5 Selecting Columnar Text

If you open a multicolumn PDF in Preview and use the Text Tool ( [image] -2) to select a paragraph, you'll likely be surprised by the results. Preview will select horizontally instead of vertically, meaning you wind up with an annoying, incomplete selection of text from several columns (Figure 11-18, top).

The solution, although easy, is far from obvious. Hold down the Option key before you drag, and you can select a contiguous vertical selection of text, as shown in the bottom portion of Figure 11-18.

11.9.6 The Image Format Factory

If you need to convert an image from one format to another—say, from an uncompressed TIFF file to a low-resolution JPEG graphic for your Web site—Preview is especially convenient.

Simply open the image you want to convert, and choose File [image] Export. As shown in Figure 11-19, Preview lets you convert the graphic to a long list of formats, including Windows' bitmap (BMP) and the ancient MacPaint format. Many formats also provide an Options button, where you can further control the settings for the image. Choose JPEG and click Options, for example, and you can specify a target file size for the converted image.

11.9.7 Clipboard Graphics

If you've copied a graphic to the clipboard—perhaps a screenshot that you'd like to email to someone as a JPEG file—you can use Preview to save the graphic in the format of your choice.

Figure 11-18. Top: If you use the Text Tool to select text in multicolumn documents, you'll wind up with horizontal selections that span columns.

Once you've copied the picture to the clipboard, switch to Preview and choose File [image] New From Clipboard ( [image] -N). A new window appears with the copied image. At this point, you can choose File [image] Export to save the image in any format Preview allows (Figure 11-19).

11.9.8 Extracting One Page from a Multipage PDF Document

You may occasionally download a large PDF document, like an instruction manual, and find you only regularly use a few pages of it. If so, you'll soon learn the hard way that PDF files can take a while to open, as can navigating to the pages you need. Monks might have patience for that; you don't.

Instead, you can use Preview to create small, easy-access PDF documents for just the sections you need. Here's how:

Open your gigantic PDF document in Preview and locate the first page that you'd like to keep. Open the Print dialog box (File [image] Print or [image] -P). In the Pages section of the dialog box, select From, and then enter the page range you want to extract. ("From 10 to 20," for example, will include page 10, page 20, and everything in between.) Click Save as PDF, give your new file a name, and then click Save. Repeat this process for each section you want to save.

Figure 11-19. Don't overlook Preview when you need an image conversion tool. It's a heck of a lot cheaper than Photoshop.

Using a similar method, you can convert a single page of a PDF file into a TIFF graphics file. That's a handy workaround when you want to use part of that PDF in graphics, word processing, or page layout programs that don't accept PDF files. (Some older versions of Microsoft Word, for example, can accept TIFF graphics but not PDFs.)

To extract a page, use the usual File [image] Export command, making sure to choose the new file format (TIFF, in this example) from the pop-up menu. Preview warns you that only the currently selected page of your PDF document will be converted—but that's exactly what you want.


11.10 Printer Setup Utility

Printer Setup Utility (in your Applications [image] Utilities folder) is Apple's printer management tool. In a nutshell, this little program is where you add and remove printers. The system will launch the selected printer as a separate "mini-application" each time you print something. These printer "mini-apps" let you micromanage your printers, queues (lists of waiting printouts), and individual print jobs, too.

11.10.1 Dragging Print Jobs Between Printers

If you have more than one printer and you send a print job to the wrong one, Printer Setup Utility may be able to help you reroute the wayward job. See Figure 11-20 for details.

Figure 11-20. Rerouting a printout to a more appropriate printer is as simple as dragging it from one printer window to another. Of course, you must do the drag before it prints out on the original printer. (The ability to mess with the time-space continuum isn't expected until Mac OS XX.)

First, halt the printer to which you misrouted the job: In Printer Setup Utility's Printer List, double-click the printer and click Stop Jobs.

Now you see a list of the waiting printouts, including the one you misrouted. To reroute it, double-click the correct printer's name to open its window alongside the current printer's window, and then drag the print job into the correct printer's window, as shown in Figure 11-20.


11.11 Stickies

Stickies lets you create virtual Post-it notes that you can stick anywhere on your screen—a triumphant software answer to the thousands of people who stick notes on the edges of their monitor.

You can use Stickies to type quick notes and to-do items, paste in Web addresses or phone numbers you need to remember, or store any little scraps of text or graphics you come across. Your electronic Post-its appear whenever the Stickies program is running.

If you use Stickies frequently, make sure to add the program to System Preferences [image] Accounts [image] Startup Items so it automatically launches when you log in.

11.11.1 Creating Sticky Notes from Within Other Programs

You're surfing the Web, and unearth a site that lists Eleanor Roosevelt monuments in the mid-Atlantic states that you may want to visit next summer. Soon after, you receive an email from your spouse with a reminder to polish the silverware before your tax-resistors league comes for dinner tonight. What do you do?

The 20th-century answer: write down the stuff you want to remember on a slip of paper, and promptly forget where you put it. As a result, you wind up vacationing at Lake Mosquitoville for the fifth year in a row, and your spouse seethes about serving veal medallions with plastic cutlery.

The 21st-century answer: create a Stickies note, which hangs around your monitor until you delete it, reminding you to buy a map of New Jersey, and to get out the silver polish already.

To create a Stickies note without opening Stickies first, merely choose the proper command from a program's Services menu, as shown in Figure 11-21.

Unfortunately, the Make New Sticky command is dimmed in most Carbon programs (Sidebar 4.2). It does work, though, in most Cocoa applications—Mail, TextEdit, iTunes, Safari, and so on.

11.11.2 Calling All Stickies!

If you switch to Stickies by clicking its Dock icon or by [image] -Tabbing, Mac OS X brings all the program's windows to the foreground. By contrast, if you switch to Stickies by clicking on a visible note, only that note comes forward.

So what are you supposed to do if you're already in Stickies and want to bring all notes forward? Just click its Dock icon, or hit the Exposé Application windows key (F10) twice; all background Stickies windows now automatically jump to the foreground.

11.11.3 The Floating Sticky

Stickies can really help when you're trying to follow onscreen instructions for one of your other Mac programs. Instead of arranging the windows so that you can see both the instructions and the program you're learning, or struggling to switch back and forth, just use a Stickies floating note. Even when you switch out of Stickies, a floating note stays on top of your other windows.

Figure 11-21. Within a program that has a live Services menu, select some text, and then choose Application menu [image] Services [image] Make New Sticky Note (or just press Shift- [image] -Y). A new Stickies note appears onscreen with your selected text.

To create a floating note, click inside the note you want to float, and then choose Note [image] Floating Window (or [image] -Option-F). If you like, you can even choose Note [image] Translucent Window ( [image] -Option-T), which lets you read any text that appears behind a floating note.

You can turn off both the Floating Window and Translucent Window options in Stickies' Note menu or by hitting the keyboard shortcut again.

11.11.4 Collapsing Notes to Conserve Screen Space

After you've used Stickies for a while, you may find your screen cluttered by a blizzard of notes. Most of these probably contain information that you don't need to see all the time, plus they make it hard to find the notes you do need. After all, do you really need to see directions to your cousins' place in Perth Amboy every day?

Solve the problem by collapsing old notes into one-line summaries, as explained in Figure 11-22.

Figure 11-22. If you double-click the title bar of any note, it shrinks up and displays only its first line. To expand the note, simply double-click it again.

When you create a new Stickies note, always start it off with a meaningful first line. Why? Because it you ever collapse the note later, that's the only part that will show up.

11.11.5 Back Up Your Stickies Database

Although you should absolutely, positively, really, truly have a backup strategy for your entire Mac, you may want to back up the Stickies database even more often. Why? Because as far as Stickies is concerned, closing a note deletes it forever! It's all too easy to close—and lose—a note you intended to save.

Backing up the database is a snap. Just open your Home [image] Library folder, and then Option-drag StickiesDatabase into a backup folder or backup disk. (Option-dragging creates a duplicate of a file.) In case of disaster, you now have only to drag the backed-up file back into your Home [image] Library folder.

11.11.6 QuickTime Movies in Stickies Notes

You may know that Stickies lets you drag and drop (or paste) graphics into your notes, but you may be surprised to learn that it can also handle QuickTime movies. This feature is not terrifically practical...but it is totally cool.

Create an empty new note, and drag a QuickTime movie into it from the Finder. The Mac asks if you want to copy the movie or just create an alias (Figure 11-23). In general, you'll want the Alias option, which works fine and takes up substantially less drive space.

When you drag a movie onto a note, the note does not resize automatically, and the movie may appear all squinched up. Drag the lower-right corner of the note to make it big enough to view the movie; as you do so, QuickTime's horizontal control bar becomes visible, too.

To wow your friends right out the door, drag a movie onto a note, resize the note, and then choose Note [image] Translucent Window to make the window semitransparent. Now press Play and watch your QuickTime movie in all its semitransparent glory. Figure 11-23 shows you this trippy combo.

Figure 11-23. Top: Stickies notes can hold QuickTime movies, but when you try to drag a movie into a note, this warning appears. Unless you have hard drive space to spare, or if you think you may delete the original movie someday, click the Alias button.

Stickies can hold just about any format supported by QuickTime. That means, for example, you can drag-and-drop your favorite MP3s into a Stickies note for playing anytime.


11.12 TextEdit

TextEdit is a very simple word processor with some surprisingly powerful formatting controls built right in. There's even a multiple-level Undo command.

11.12.1 Editing HTML Documents

If you drag an HTML (Web page) document onto the TextEdit icon, the program shows you the page as it's designed to look—like a Web page—rather than displaying the behind-the-scenes HTML commands.

This behavior can be something of an annoyance if you're trying to use TextEdit to edit the raw HTML code. In that case, you have two options:

  • Change the way TextEdit handles all HTML documents. Choose TextEdit [image] Preferences, and turn on "Ignore rich text commands in HTML files," as seen in the top portion of Figure 11-24. Close the dialog box. All future HTML files will now open as documents you can edit.

Figure 11-24. In the File [image] Open dialog box, turn on "Ignore rich text commands" to prevent TextEdit from displaying an HTML file graphically.

  • Specify how HTML pages open on a document-by-document basis. Choose File [image] Open. In the dialog box that appears, select the document you want to open, and then turn on "Ignore rich text commands," as shown in the bottom portion of Figure 11-24. TextEdit dutifully opens the file with all HTML codes visible and ready to edit.

11.12.2 The Secret Zoom Command

In its factory-set state, TextEdit lacks a general zoom feature to let you increase or decrease the display size of your current document. The exception, weirdly enough, is when you're working on a document in Wrap to Page mode. Figure 11-25 explains how to capitalize on this quirk.

Figure 11-25. Open a document and choose Format [image] Wrap to Page (or just hit Shift- [image] -W) to open a page view that includes the margins and a zoom controller in the lower-right corner of the window, as shown here. To return to your normal editing mode, just select Format [image] Wrap to Window again.

11.12.3 Navigation Shortcuts

TextEdit recognizes some of the very same keyboard shortcuts found in Microsoft Word. For example, you can advance through documents one word at a time by pressing Option-left arrow or Option-right arrow. Adding the Shift key to those key combinations lets you select one whole word at a time. You can also use the Control or [image] key in conjunction with the right and left arrow keys to jump to the beginning or end of a line.

11.12.4 The Quickest Kind of Search

TextEdit offers a perfectly good Find command—press [image] -F, type what you're looking for, and press Enter—just as you might expect.

But if you're looking for the various occurrences of something already in your document, there's a much faster way. Just highlight the text as it appears in your document, and then choose Edit [image] Find [image] Use Selection for Find (or press [image] -E). This command searches for the next occurrence of whatever text you've already selected within your document, without even opening the Find Panel. For the ultimate in keyboard control, select one occurrence of the word you're seeking, press [image] -E, and then press [image] -G to jump to each new occurrence of that word.

11.12.5 Insert Page-Break Symbols

Although TextEdit isn't a full-featured word processor, there are times when it's all you need for a simple job. It seems to lack one key feature, though: the ever-popular page break.

Thanks to Mac OS X's support for a number of Unix keyboard shortcuts, however, it is possible to force a page break in your TextEdit documents. At the spot where you'd like to start a new page, type Control-Q, followed by Control-L. Depending on what mode you're working in, you may see nothing more than an empty line, or you may see a whole new page. If there's only an empty line, select Format [image] Wrap to Page, which will enable TextEdit's "page layout" view. The new page should now be plainly visible.

11.12.6 Only Replace Strings in Selected Text

TextEdit's Find and Replace dialog box, activated with [image] -F (or Edit [image] Find), is a handy way to change all occurrences of one string throughout your document. However, what if you want to just modify one portion of the document, instead of the entire thing? Most word processors have a fairly obvious "replace in selection" option, but it seems to be missing in TextEdit. Luckily, it's just hiding—see Figure 11-26 for details.

Figure 11-26. To find and replace within a specific selection in TextEdit, first select the portion of text you'd like to work on, then hit [image] -F to open the Find dialog box. Now for the sneaky part: to change the button at the lower left from Replace All to In Selection, as pictured, press the Option key.


Chapter 12. Web Browsers

As a Mac OS X devotee, you enjoy a wealth of choices when it comes to Web browsing. Internet Explorer (IE) used to be the standard Mac browser, but Apple's own Safari has taken over that spot. And, if you crave even more variety, you can use Mozilla, Firefox, Netscape Navigator, OmniWeb, Camino, Opera, or iCab.

No two browsers are created equal; they all have strengths and quirks. Choose one based on the features you like—or your desire to use the fewest Microsoft products possible (you know who you are).


12.1 Hints for All Browsers

The following hints should work on all of the browsers listed above. Due to the rapid evolution in most of the browsers, however, you may get different results, or the hint may fail completely in your browser of choice. Overall, though, these should work well in most browsers, and you may be pleasantly surprised by some of the cool tricks you've been missing.

12.1.1 Dragging and Dropping URLs

When you want to copy a URL (Web address) from a browser into another program (like your word processor or mail program), here's the hard way to do it: Highlight the URL in the address bar, press [image] -C to copy it, switch to the other program, and then press [image] -V to paste it. (OK, the really hard way is to type out the entire URL by hand. But nobody would ever do that...would they?)

Now, here's the easy way: highlight the URL in the address bar, and then drag it to the program where you'd like it to appear.

If your browser displays a small symbol in front of the URL (something like the @ sign in Internet Explorer, or the globe in Safari), dragging that instead of highlighting the full address, as shown in Figure 12-1, is sometimes easier. However, it also sometimes produces slightly different results. For example, dragging an address into Word copies the URL there; dragging the @ symbol inserts the name of the Web page and turns it into a blue, underlined link.

Figure 12-1. As you drag, some browsers display the name of the page instead of the URL itself. This feature is handy if you have the memory span of a fruit fly and you forgot which Web page you were dragging.

12.1.2 Dock-Launched Web Pages

Once you've mastered the art of dragging URLs, here's a nifty trick: create a Web Shortcuts folder, install it on your Dock, and then drag your favorite URLs into it (the folder, not the shortcut in the Dock). Now you have instant access to your most beloved Web sites.

A few Web browsers (Safari, Internet Explorer, OmniWeb, iCab, and Camino, to be specific) even let you drag URLs directly onto the Dock, where they appear as individual icons.

12.1.3 Address Bar as Launcher

You're sitting in front of your Web browser and you suddenly realize you need to look up an appointment in iCal. What do you do?

If you're content to join the unwashed masses in laborious application launching, click into the Finder, navigate to your Applications folder, and then double-click iCal.

But the elite do it this way: Just type ical:// in your browser's address bar and then press Enter. This supercool trick also works for iChat (ichat://), Address Book (addressbook://), Sherlock (sherlock://), and Script Editor (applescript://), too.

12.1.4 Open Multiple Web Sites at Once

If you're like most people, you have a set of favorite Web pages that you visit each day, perhaps first thing in the morning. Unfortunately, that usually involves clicking your way through a million or so bookmarks, waiting for each to load.

A much better way: let AppleScript do the work for you.

Open Script Editor (in your Applications [image] AppleScript folder), then type this:

open location "http://www.nytimes.com"

open location "http://www.macosxhints.com/"

Continue building this list, adding as many additional Web addresses as you like. Just remember: one per line, with each surrounded by quotes after the open location command.

Choose File [image] Save. Choose Application from the Format pop-up menu, name the script Web Faves, and save the file onto your desktop.

From now on, whenever you double-click the Web Faves icon, your browser opens a new window or tab for each site, loading up the pages you requested as you're relaxing and sipping your grande skim, extra-shot, no-foam, half-caf latté.

If you designate this AppleScript as a login item (System Preferences [image] Accounts [image] Startup Items tab), your browser will do its morning ritual automatically when you log in.

12.1.5 PDF Files in Your Browser

When you want to view a PDF (Acrobat) document from a Web site, the drill usually goes like this: you click a link, your browser downloads the file, you wait a moment, and then the file opens up in Preview or Acrobat Reader. If you actually have a life, though, this process is a major waste of time.

Look! Up in the sky! It's a bird...it's a plane...it's PDF Browser Plug-in to the rescue! This free (for personal or educational use) plug-in lets you view PDF files right in your browser windows, which means you can preview them before deciding whether to save them to your hard drive. It also makes viewing PDF documents a much speedier operation, since you don't have to wait for a separate program to open first.

You can download PDF Browser Plug-in from www.schubert-it.de/pluginpdf/.

The current version of the PDF Browser Plug-in works with all browsers except for Internet Explorer. If you still use IE, you'll need to download a much older (and less advanced) version at http:// www.schubert-it.de/download.

Install PDF Browser Plug-in by dragging it into your Home [image] Library [image] Internet Plug-Ins folder. (Or, if you've got administrator privileges, put it in Library [image] Internet Plug-Ins so it's available to all users.) If the folder doesn't exist, just create it first (name it exactly as shown here). Now simply quit and reopen your Web browser.

When you surf, the plug-in is invisible. When you try to open a PDF page, though, the PDF plug-in jumps to life at the top of your browser window, as seen in Figure 12-2.

Figure 12-2. When you click a PDF link with the PDF Browser Plug-in installed, you'll see the PDF's contents directly in your browser, along with this toolbar full of helpful features. Using the toolbar, you can do things like open the PDF in an external viewer, save it to your disk, or change the zoom level.

You can navigate the PDF document once it's onscreen either with the mouse or by pressing the arrow keys. As you read, the program displays page numbers in the lower-right corner of the PDF window.

12.1.6 Keyboard Control of Links

In Internet Explorer, Firefox, Mozilla, and OmniWeb, you can jump to any text link on a Web page by typing the first few characters of its name. When the browser finds a link that matches what you've typed, it highlights the link; once you press Enter, the linked page loads. (This trick doesn't work, of course, if the insertion point is currently in the address bar. In this case, the browser interprets typing as an attempt to input a Web address.)

For example, if you're on a page with text links for Search and Site Map, type Se to highlight the Search link or Si to highlight Site Map.

Typing to select links works well on smaller pages, but if you're on a longer page, it can be tricky. If you start typing Si in order to access the site map, you could wind up at a link for Sibling Rivalry Specialists, which comes alphabetically before Site Map. Therefore, on a page with many links, be prepared for the browser window to jump around as you type.

12.1.7 Favorites on Your Personal Toolbar

Web surfing would be a drag without bookmarks. Just think: You'd have to remember the URLs for all your favorite sites (is it ConsumerReports.org or ConsumerReports.com?), or worse, write them down on paper. And paper is so yesterday, dude. Of course, browsers also let you store bookmarks in a series of folders, called Favorites. And in all Mac OS X browsers, you can place about 10 extra-special bookmarks on a Favorites toolbar. (If you don't see the toolbar in your browser, look for a menu command like View [image] Favorites Bar.) But what if you're a Web sophisticate with more than 10 Very Important Bookmarks?

In every browser, you can also place folders on your Favorites bar, which you can then fill with individual links. These folders act like pop-up menus of the links inside; not only can you add many more favorites this way, but it's a convenient way to keep them organized. You can even put folders within folders, for the ultimate in organization.

The exact method of creating a folder varies by browser, but the basic process is the same: start by bringing up the bookmark-editing window, then create a new folder and drag it into your Favorites toolbar. When you drag individual links into the new folder, they're instantly available on your Favorites bar.

12.1.8 Google Searching in Your Browser

Google, as almost everybody knows, is the world's greatest Web-searching tool. It's so great that Apple (along with Firefox, iCab, and OmniWeb) installed a Google search bar right there on the toolbar of the Safari browser.

If you use a non-Googlized browser, however, consider installing the Google bookmarklet. (Bookmarklets are little programs that run as extra features in your browser.) The Google bookmarklet sits as a link on your Favorites bar, and when you click it, a search window pops up (Figure 12-3). If you type in your search and then press Enter, your browser jumps to a Google page with your search results.

Figure 12-3. Save yourself a lot of extra clicking around by adding the Google bookmarklet to your toolbar.

If you have any text selected when you click the Google bookmarklet, your browser automatically brings up the Google results page for those words. Congratulations: you've just saved yourself a trip to the search window.

You can find the Google bookmarklet at www.bookmarklets.com/tools/search/srchbook.phtml. (Bookmarklet.com offers a bevy of other useful search tools, calculators, design helpers, and navigation aids, too.) To install it into your browser, you just drag the Search Google icon off the Web page and onto your Favorites bar.

If just dragging the bookmarklet doesn't work (some browsers are a bit recalcitrant), proceed like this:

Define a new bookmark and assign it a meaningful name (like "Google search"). In the Address portion of the bookmark definition screen, enter the following text on one line, with no spaces:

javascript:Qr=document.getSelection( );if(!Qr){void(Qr=prompt('Keywords...',''))};

if(Qr)location.href='http://google.com/search?query='+escape(Qr+'&num=20'

After entering the code, save the bookmark and then—for truly fast access—place it on your Favorites bar.

12.1.9 Tabbed Browsing

One annoying aspect of Web surfing is that windows open and cover your screen as you go. Before you know it, you're awash in screen clutter; now, when you want to find a particular window, you have to dig halfway to virtual China.

Fortunately, all Mac browsers, with the exception of IE, offer a feature called tabbed browsing—which has nothing to do with the Tab key. It's described in Figure 12-4.

Figure 12-4. In tabbed browsing, a browser displays all your Web pages in one window, by using tabs at the top of the window to distinguish individual pages. Once you've tried browsing with tabbed pages, you'll never go back to the multiwindow system again.

With the exception of OmniWeb 5.0, all of the browsers implement tabs in a manner nearly identical to that shown in Figure 12-4. (Instead of a horizontal bar, OmniWeb uses a vertical sidebar containing small graphical representations of each tabbed page.)

Here are some general tab browsing tips that work in all browsers that offer tabs (although the actual wording and implementation may vary slightly from one to the next):

  • If you Control-click any link, a shortcut menu pops up where you can choose Open Link in New Tab.

  • If you press [image] -T (Shift- [image] -N in Opera), the browser will create a new tab and place the cursor on the address bar, ready for you to enter a fresh URL.

  • If you press [image] -W, your browser closes the active tab. If you press Shift- [image] -W, then the browser will close all tabs, usually without warning. Be sure that's really what you want to do before you do it!

  • Each browser has its own conventions for switching tabs from the keyboard. Safari uses Shift- [image] and the left or right arrow; Mozilla and Netscape use Control and Page Up or Page Down; Firefox uses Control-Tab and Shift-Control-Tab; OmniWeb uses [image] -up arrow and [image] -down arrow; Opera uses [image] -F6 and Shift- [image] -F6; and—finally—iCab uses Option- [image] -1 and Option- [image] -7.

If you find yourself addicted to tabbed browsing, you can make tabs even easier to create. If you use Mozilla or Netscape, choose Mozilla [image] Preferences or Netscape [image] Preferences. In the Navigator list on the left, click Tabbed Browsing. Here's how to modify these four settings:

  • "Hide the tab bar when only one tab is open" keeps the tab row visible at the top of the main window, even if it contains only one tab. That way, the Web page won't bounce up and down annoyingly as you add and remove tabs.

  • "Load links in the background" makes new tabs open behind the active tab, waiting for your visit later on. This convenient setup lets you read a primary article—flagging the links that look good as you go (by [image] -clicking them)—without losing your place. You can always investigate the tabs you created later, say, when you're finished reading the main story.

  • "Cmd+click or Cmd+Return on links in a Web page" makes [image] -clicking a URL force it to open in a new tab instead of a new window. If you've got limited screen space, this scheme is an effective way to conserve it.

  • "Cmd+Return in the Location bar" makes your browser open a URL in a new tab if you press [image] -Return after typing it. This option is for you if you like to open new pages without losing track of the page you're reading.

The wording of these options may vary slightly according to the version of the browser you're using.

If you use Camino, choose Camino [image] Preferences [image] Navigation [image] Tabbed Browsing tab. Here, you can set [image] -click to open either a new window or a new tab. And, if you'd like, you can make all windows and tabs open behind the current one.

In you use Safari, open Safari [image] Preferences [image] Tabs, then turn on Enable Tabbed Browsing to take full advantage of tabs. To save yourself further window clutter, select "Open Links from applications: in a new tab in the current window" in the General pane.

Opera, iCab, and Firefox also offer further self-explanatory features for managing tabs. Spend some time with your favorite browser's Preferences to make tabs work to your liking.

12.1.10 Tab Groups

The best thing about the Web is that you can find thousands of sites to satisfy your craving for news, information, and entertainment.

The worst thing about the Web is that you can find thousands of sites to satisfy your craving for news, information, and entertainment.

If you have a glut of like-minded sites that you typically search one after another—say, 11 sites that analyze weather patterns in your town—a tab group can help you organize them for easier browsing.

A tab group is a collection of Web pages that opens in one window (each site gets its own tab), providing fast access to a collection of related sites. Most browsers let you create tab groups, although the actual details of creating and using them vary from browser to browser. Here's how to work with Tab groups in the more popular Mac OS X browsers:

  • Safari. Any folder of URLs can be used as a tab group, either permanently or on a case-by-case basis. To open a folder of bookmarks as a tab group just once, select the "Open in Tabs" option, which is the last menu item when you select a folder from the Favorites bar or the Bookmarks menu.

  • To create a permanent tab group from a folder on your Favorites bar, select Bookmarks [image] Show All Bookmarks, and then find the folder you'd like to convert. Turn on Auto-Tab for that folder, and close the Bookmarks window. In your Favorites bar, you'll see the folder now has a little black square instead of a triangle after its name. Now when you click the folder, all pages within it will open in new tabs.

You can temporarily override this behavior by [image] -clicking the folder, which allows you to select just one site from its contents.

  • OmniWeb. You can open any bookmark folder in your Favorites bar as a tab group by Control-clicking it and selecting Open in New Tabs from the pop-up menu.

You can do the same thing for any folder in your Bookmarks menu.

  • Mozilla and Netscape. To create a tab group, first create a new window ( [image] -N), then visit the first site you'd like included in the group. Hit [image] -T for a new tab, and visit the second site. Repeat this process until you have a tab loaded with each site you'd like in the group.

  • Now select Bookmarks [image] Bookmark This Group of Tabs. When the dialog box appears, name the tab group.

If you choose the Bookmarks folder for the destination, you can access your tab group from either the Bookmarks menu or the Bookmarks button in the Favorites bar.

  • Camino. To convert an existing bookmark folder into a tab [image] group, choose Bookmarks [image] > Show All Bookmarks ( [image] -B). Select the folder you want to convert (use the left side Items list to narrow down the list), and then pick Edit [image] Get Info ( [image] -I). Turn on the "Tab group" checkbox, and you're done.

  • Firefox. Unfortunately, Firefox lacks a true one-click tab group feature. Still, you can choose the "Open in Tabs" option for any bookmark folder to open its contents within the same window.

You can make tab groups even handier by saving them in your personal toolbar folder, giving you one-click access. When you place a tab group in your personal toolbar, your browser gives it a different icon from a normal bookmark, as shown in Figure 12-5.

Figure 12-5. TechNews and World News have tab group icons, which look like a bunch of stacked pages in Mozilla and Netscape; they vary in other browsers. Normal bookmarks look like a single page in Mozilla and Netscape.

For the ultimate in power surfing, create multiple tab groups and open a new window ( [image] -N) for each one. This arrangement gives you the best of both worlds—only two or three open windows (easy to manage), each containing 10 or more subject-related, tabbed Web pages (multiple sites within easy reach). So instead of needing several dozen mouse clicks, you can use just three to open the 30 sites you normally visit each morning.

12.1.11 Internet Shortcuts

In most browsers, you can put about 10 of your favorite sites (or folders of favorite sites) on your personal toolbar. But if you have enough favorite sites that you can't remember where you've filed some of them, Internet shortcuts can save you a lot of frustration.

An Internet shortcut is a short name that you assign to any Web site. When you type the short name into the address bar and press Enter, your browser loads the full URL for you. So instead of typing www.nytimes.com or mousing into your News [image] World [image] Current folder, you could just type nyt and press Enter to call up the New York Times site. Shortcuts (also known as keywords) are supported in every Mac OS X browser except for Safari, iCab, and Internet Explorer.

As a general rule, you must bookmark a page before you can add a shortcut for it. Once you've done that, the process of adding a new shortcut varies slightly from browser to browser:

  • Firefox, Mozilla and Netscape. Select Bookmarks [image] Manage Bookmarks, and then select the Web site for which you want [image] a shortcut. Choose Edit [image] > Properties, enter your shortcut term on the Keyword line (Figure 12-6), and then click OK to save your work.

Figure 12-6. Here, "cn" will become the shortcut for CNN.com. For the ultimate in keystroke savings, assign your favorite Web sites one-letter shortcuts: a for Amazon.com, b for Buy.com, and c for Cauliflowers.com, for example.

  • Camino. Choose Bookmarks [image] Show All Bookmarks ( [image] -B). Select the Web site you want a shortcut for, and choose Edit [image] Get Info ( [image] -I). Then just enter your shortcut in the Keyword box and close the window.

  • OmniWeb. Select Bookmarks [image] Show Bookmarks Page ( [image] -B), then highlight the bookmark for which you'll be creating a shortcut. At the bottom of the window, just type the shortcut into the Keyword box, and you're done.

If you don't see a Keyword box at the bottom of the window, just Control-click any bookmark and choose Show Bookmark Info.

  • Opera. Select Bookmarks [image] Manage Bookmarks, highlight the bookmark for which you are creating a shortcut, and click Properties. In the dialog box that appears, enter your shortcut in the Nickname section, then click OK.

From now on, you won't have to hunt through subfolders just to find a URL—instead, you need only type your shortcut and press Enter to load your favorite page.

How you remember your shortcuts is another matter entirely. One way is to use a translucent, floating Stickies note so you can see all your shortcuts, but still see the windows underneath (hint Section 11.11.3).


12.2 Internet Explorer Hints

Internet Explorer has been around on the Mac for years. Although its features have been surpassed by a number of browsers—including Apple's own Safari—there are still some sites that may only load in Internet Explorer. If you've tried the other browsers but still prefer IE, the following hints may teach you a few new tricks.

12.2.1 Refresh Options

Just in case you ever need a fourth method of refreshing a Web page—beyond clicking Refresh, pressing [image] -R, or choosing View [image] Refresh—pressing F5 also causes the current page to reload.

12.2.2 A Good Scrolling Trick

Internet Explorer teems with ways to scroll a long Web page:

  • Use the scroll bars

  • Press the up and down arrow keys

  • Press the Page Up and Page Down keys

  • Press the Space bar to scroll down a page, or Option-Space to scroll up a page

By far the most satisfying way, however, is to turn the little wheel on the top of your mouse—if you've bought a scroll-wheel mouse, that is. This method gives you exact control over how much you scroll (plus, it works with other browsers).

Even if you haven't bought a non-Apple mouse, you can emulate one by holding down [image] as you drag inside any empty area of the Web page.

12.2.3 A Warning About Web Page Printouts

If you've highlighted some text on a Web page, the highlighting remains visible when you print the page or save it as a PDF document.

Feature or bug? It's your call.

12.2.4 Tricks for Opening New Windows

If you [image] -click a link on a Web page, Internet Explorer opens that link in a new window. This is a hugely important tip to know when, for example, you're exploring a list of search results, trying to find the one Web page that interests you. Rather than clicking the Back button after each exploration, you can just close the newly created window. As a result, you'll find yourself happily deposited back at the list of search results. If you hold down the Shift key as well, the new window will open behind your current window, making it even easier to keep browsing.

Most people don't realize, however, that you can do the same thing in the address bar, too. That is, if you type in a Web address and then press [image] -Enter (instead of just Enter), Internet Explorer opens the specified Web page in a new window.

Unfortunately, you can't press Shift- [image] -Enter to open a new Web address behind the current page.

12.2.5 Starting Downloads

If you're the kind of person who likes to try all 31 flavors at Baskin Robbins, you'll be glad to know that there's more than one way to download a file in Internet Explorer. To wit:

  • If you Control-click a link and then choose Download Link to Disk from the shortcut menu, a Save dialog box opens. Specify a file name and destination, and then click Save to let the download rip.

  • You can drag a link into your Downloads window to send it right into your preset download folder.

Out of the box, your preset download folder is your desktop. To [image] change this setting, visit Explorer [image] Preferences [image] > Download Options.

  • You can drag a link directly to any folder in the Finder to make the file download there.

  • Option-click a link to automatically download it into your preset download folder.

In each case, Internet Explorer begins transferring the specified file immediately.

12.2.6 Downloading Files with Long Names

Although Mac OS X permits up to 255 characters in a file name, certain Mac OS 9 programs that have been Carbonized (Sidebar 4.2) can only deal with a few dozen characters. Internet Explorer is one such program, at least when it comes to downloading files.

If you download something with a name longer than 31 characters, Internet Explorer automatically truncates the name. For instance, if you were downloading a file originally named MyHugeCollectionOfDillPicklesAndOtherCondimentsThatTasteGoodWithSandwiches.sit, Internet Explorer would save it as MyHugeCollectionOfDil#59EFC.sit. Obviously, this behavior can be annoying if you regularly download files with 78-letter names.

The workaround: in the Finder, rename the download to match its original name on the Internet.

12.2.7 Icons on the Toolbar

The Internet Explorer toolbar is the row that contains buttons for Forward, Backward, Stop, Refresh, and so on. But you can also place icons on that row that, when clicked, jump directly to your favorite Web sites, as shown in Figure 12-7. It's a great way to capitalize on otherwise wasted space, create a bigger target for your mouse, and provide a handy visual reminder of a site's contents.

Figure 12-7. Icons make ideal shortcuts to your utmost favorite sites. Toolbar icons, unlike Favorites bar items, display actual pictures rather than just site names.

You can create these icons in two ways: the convenient way and the inconvenient way.

12.2.7.1 The convenient way

Open the page you want to keep in the button bar, and find a graphic on the page that loads the site's index page (its home page or welcome page). On Apple.com, for example, the upper-left [image] image links to the home page. When you find such a graphic, you're in luck: just drag it up onto the button bar, and Internet Explorer obediently makes a button out of it.

12.2.7.2 The inconvenient way

If the site you're working with doesn't have a conveniently sized graphic linking to the home page, you can create your own "jump to home page" button using a different graphic. Although this method is more difficult, you'll wind up with exactly the button image you want.

  1. On any Web page, find a graphic that you'd like to serve as your button. Drag it onto the button bar.

    It doesn't matter what the graphic links to.

  2. Quit Internet Explorer and open TextEdit.

    See Section P.3.5.2 for details on the TextEdit ritual you're about to enjoy.

  3. Choose File [image] Open. Navigate to your Home [image] Library [image] Preferences [image] Explorer folder, and open the file called English.Toolbar.xml.

    You've just opened a window of code (XML, as it turns out) that stores the technical information about your toolbar. Your job now is to find the scrap of text that refers to the graphic you pasted.

  4. By scrolling or by using the Find command, look for something that should be in the name of the graphic you pasted in step 1, like part of the domain name.

    In the case of the CNN logo, a search for "CNN" finds this section of the file:

    <button>

<command>OURL</command>

<url>http://i.cnn.net/cnn/.element/img/1.0/logo/cnn.gif</url><title>CNN.com</title>

<imageenabled>http://i.cnn.net/cnn/.element/img/1.0/logo/cnn.gif</imageenabled>

</button>

  5. Replace the stuff between the <url> tags, shown italicized above, with the actual URL you want the icon to link to.

    For the CNN logo, you'd probably use the CNN home page address, like this:

    <url>http://www.cnn.com</url>

    You can also use "mailto://" or "ftp://" links to put email and FTP sites in the button bar.

  6. Change the button name, if you like.

    You can edit the name that appears under the button by changing the stuff between the <title> tags.

    At this point, the <imageenabled> tag indicates that the graphic you're using isn't actually on your hard drive, but is rather being dished out by the Web page from which you swiped it. If you'd rather use a graphic on your hard drive (either a saved copy of that same button or even another graphic), replace the "http://" stuff between the <imageenabled> tags with "file:///" followed by the full path to the image on your hard drive. For example, if it's a picture in your Home [image] Pictures folder, replace the "http://" line with file:///~/Pictures.

  7. When you're done editing, save the preference file, quit TextEdit, and reopen Internet Explorer.

    Congratulations. Your newly customized button bar awaits you.

12.2.8 PNG Files in New Windows

PNG stands for Portable Network Graphic—a newish image format that beats the JPEG format in terms of file size (smaller) and image quality (better). As a result, PNG files are springing up all around the Web.

Internet Explorer loads and displays these images as it should—unless you're trying to view a PNG image by itself. (You might do that when you're testing a Web site, for example). If you Control-click a PNG image and choose Open Image in New Window from the shortcut menu, Internet Explorer offers you the useful error message shown in Figure 12-8.

Figure 12-8. Top: Here's the Internet Explorer error message you'll see if you try to view a PNG picture in its own window. The cause of the problem is a conflict between QuickTime and Internet Explorer, and it's been around since the early days of Mac OS X's 10.0 Public Beta.

Luckily, the problem is relatively easy to fix, thanks to a tweak discovered by Macosxhints.com reader Matthew H. Rothenberg.

First, open System Preferences [image] QuickTime [image] Plug-In tab. Click MIME Settings, and in the dialog box that opens, expand the triangle next to Images. Turn off "PNG image file," as shown in the middle of Figure 12-8. Finally, click OK, and close the QuickTime preference pane.

Return to Internet Explorer and choose Explorer [image] Preferences. In the left-side frame, scroll down to Receiving Files and click File Helpers. On the right side, scroll down until you find the two PNG entries (both highlighted at the bottom of Figure 12-9). Highlight the first one, click Change, and in the Handling box, chose "View with Browser" from the pop-up menu. Click OK to save the change, and then repeat the process with the second PNG file helper.

Figure 12-9. The Page Holder is a sidebar that lets you click link after link from, for example, a search-generated results page. The main part of the window reflects the page you're summoning, while the sidebar stays the same until you click Add again. Page Holder can display just the hyperlinks on a page, concealing all of the irrelevant filler (click the Links button atop the sidebar). It even has its own private Favorites folder (click Favorites).

Close the preference panel by clicking OK. Now, when you Control-click a PNG image and choose Open Image in New Window, Internet Explorer will obediently do what you asked.

12.2.9 Page Holder I

Internet Explorer has a handy sidebar called Page Holder. If that name means nothing to you, join the confused masses. But don't overlook the feature, because it's actually very useful; see Figure 12-9.

Page Holder is worth a thousand clicks when you're searching a Web site with lots of branches and levels. Here's how it works: in Internet Explorer's main window, open a page you want to use for some surfing (Yahoo.com, for example). Then open the Page Holder sidebar (the bottom tab on the left side of the window). If you click Add, the main page loads in the sidebar. Once it's there, click the Links button for a nice summary view, and then click the individual links to open them in the main pane.

12.2.10 Page Holder II: Google

One obvious use for Page Holder is to display Google search results—and Google is already way ahead of you on this one. Go to www.google.com/ie, open the Page Holder sidebar, and then click Add, as in the last hint. When you're done, you'll get a "mini-Google" in the page holder area, as shown in Figure 12-10.

Figure 12-10. If Page Holder already has a page in it, click Clear, and make sure Links isn't selected either. Once you click Add, you'll get this full-featured Google search page, which returns results right there in the sidebar.

Now, whenever you enter search terms in the sidebar, your results appear in the Page Holder. (If you try this trick with the regular Google search page, your results appear in the main browser window.) This feature is worth the savings in Back and Forward clicks alone.


12.3 Safari Hints

Safari is Apple's Web browser, designed from Day One to load Web pages like lightning. It has quickly become the de facto standard browser on the Mac for the same reasons that IE has become the de facto browser on Windows: it's bundled, easiest to find, and works well with the operating system. While it may lack advanced features, it remains a speedy, well-designed browser that looks and feels like a polished Mac application.

12.3.1 The Master Keyboard-Shortcut List

Deep in the guts of Safari is a page listing nearly every keyboard shortcut you could ever use in the program.

To view this extensive list, open the Finder and Control-click the Safari icon (in Applications [image] Utilities). Choose Show Package Contents from the shortcut menu, and then—in the new window—open Contents [image] Resources (shown in the background in Figure 12-11). Finally, drag the icon called Shortcuts.html into the Safari browser.

Figure 12-11. Safari spills the beans about its secret keyboard shortcut list. Keep this list close at hand by dragging its URL from the address bar to your Bookmarks bar.

There are some rather neat timesaving keyboard shortcuts hidden in this file, including Delete to go to the previous Web page, and Shift-Delete to visit the next one.

12.3.2 Use Window Management Shortcuts from the Address Bar

If you read the previous hint, you're now a Zen master of Safari's keyboard shortcuts. But did you know that you can use some of these shortcuts directly from the address bar? Go to the head of the class if you did. If you didn't, simply type in the URL you wish to load and:

  • -Enter to open it in a new window (or tab, if you have tabs turned on) in the background, leaving the present Web page unchanged.

  • Shift- [image] -Enter to open it in a new foreground window (or tab), sending the current window (or tab) to the background.

You can switch the behavior of these two keystrokes by turning on "Select new tabs as they are created" in Safari [image] [image] Preferences [image] Tabs.

  • If you're entering a URL to be downloaded, hit Option-Enter to start the downloading process immediately.

12.3.3 Automatic Window Size and Position

Safari is quite finicky when it comes to the size and position of new windows. Fortunately, you can instruct Safari to open them in the size of your choosing.

Start by closing all your open Safari windows. Then open a new window, shape it to the size and position you'd like for windows in the future, then close it. From now on, new windows will automatically be created at the location and size you just specified.

12.3.4 Modify the Bookmarks Menu's Window-Opening Behavior

Normally, if you use the Bookmarks menu (not the icon on your toolbar but the word Bookmarks at the top of the screen), Safari opens your selection in the active window or tab, replacing the current page. You can change this in one of two ways, though, with a couple of modifier keys:

  • Press [image] when you open the Bookmarks menu to force Safari to open the selected bookmark in a new window or tab. You don't even have to continue holding [image] after you've clicked on the menu—you can press [image], click Bookmarks, release [image], and then select the bookmark you wish to open. The chosen bookmark will open in the foreground, obscuring (but not replacing) whatever page you were looking at.

  • Press Shift- [image] prior to selecting the Bookmarks menu, and your chosen bookmark opens behind the current window or tab. Again, you only need to hold Shift- [image] when you click the Bookmarks menu, so you can release the keys prior to selecting the bookmark to be opened.

12.3.5 Recover from an Accidental Open-in-Tabs Operation

If you've turned on tabbed browsing (in Safari [image] Preferences [image] Tabs), you'll have access to another tab-related nicety: any folder in your Bookmarks bar can be opened into tabs courtesy of an option at the bottom of its menu, as shown in Figure 12-12.

Figure 12-12. With Safari in tabbed browsing mode, this trusty menu item will open all the sites within a folder, each on its own tab.

Granted, this feature is very cute, but you may also find that you select it accidentally at times. Consequently, the tabs on which you've spent the last day setting up for your primate research project vanish as your Mac-news sites come flashing onto the screen. Potential trouble with a capital T.

Ah, never fear. Like James Bond with his back against a wall, there's a slick and even-handed way out of this predicament: simply hit the Back button. Poof! Just like that, the newly opened tabs vanish, and your previous set returns to the screen.

12.3.6 Close All Open Tabs in a Hurry

Want to close all the open tabs? Hit Shift- [image] -W, and all tabs (plus the current Safari window) close.

However, what if you want to keep the current tab open, but close everything else? Simply Option-click the small "x" in the tab that you wish to leave open, and only the rest of the tabs close.

12.3.7 Stop a Page from Loading

You just started loading a page you really don't want your boss to see, and she's coming up right behind you. Now what?

Instead of mousing up to the Stop button in Safari's toolbar, just hit Esc. On most sites, this key stops the page loading right in its tracks—saving Safari from having to fetch the rest of the pictures, and saving your bi-weekly paycheck in the meantime.

Unfortunately, some sites have JavaScript or other code running. On such sites, the Escape trick will have no impact at all. You'll have to use [image] -W to close the window—and fast.

12.3.8 Quick Address Selection I

Highlighting the URL in the address bar is the first step in a number of important Web-browsing tasks. For example, you'll want to highlight the whole thing before typing a new address into it. You also have to highlight the address before copying it for use in another program.

In any case, Safari offers a couple of shortcuts for highlighting the entire address. One of them is totally weird: position your cursor at the very upper edge of the address bar's text box—the tip of the arrow should literally be on the top line of the box—and click to highlight the entire address.

12.3.9 Quick Address Selection II

If you enjoyed the previous hint, you'll love this one. It's another way to highlight the entire address very quickly, and it's revealed in Figure 12-13.

Figure 12-13. Power play: select a whole URL with just one click. If you click the small icon on the left edge of the address bar, Safari highlights the entire URL, leaving it primed for you to copy ( [image] -C) and paste ( [image] -V) into another program.

12.3.10 Quick Address Selection III

If you're a keyboard fanatic, you don't even have to click the address bar to select it. Simply press [image] -L (the shortcut for File [image] Open Location) and the address highlights automatically.

12.3.11 Quick Bookmarks

Imagine: you're working on a huge research project, bookmarking tons of Web sites as you go. You're probably tiring of the Safari new bookmark dance: hit [image] -D (or click the plus sign button in the toolbar), name the bookmark, and pick a spot to save it from the pop-up menu. After about the seventeenth site, this routine becomes rather tedious.

So here's a faster, more efficient way to bookmark a bunch of sites: Use Shift- [image] -D instead of just [image] -D. When you add the Shift key, Safari immediately saves your bookmark directly into the Bookmarks menu—no dialog box, no pop-up menu, no nothing to slow you down. Later, after you've added all of the sites, you can choose Bookmarks [image] Bookmarks Menu to organize and rename them.

12.3.12 Browsing Recent History

If you Control-click (or click and hold) either the Back or Forward button and wait a moment, Safari produces a pop-up menu listing all your recently visited sites by name.

If you'd prefer to see URLs instead of names, Option-click either arrow.

12.3.13 Use Safari with the Address Bar Hidden

The address bar is that portion of Safari's window where you type in the address of the Web sites you wish to visit. It also holds the Back, Forward, Reload, and Bookmark buttons. Logically, you may think you need to have it visible to use Safari. Luckily for people with small screens, though, logic doesn't prevail in this case. If you wish to preserve your screen real estate for real Web content, you can actually hide the address bar and continue using Safari.

The key is the File [image] Open Location ( [image] -L). When you choose that command, the address bar temporarily pops into existence. Now enter your URL and hit Return. The address bar then vanishes, freeing screen space for what really matters: the Web site's content.

Of course, when using Safari in this manner, you'll want to be very familiar with the keyboard shortcuts, as explained in hint Section 12.3.1. For starters, [image] -left arrow and [image] -right arrow are Back and Forward, respectively. Add the Shift key to the mix, and you'll switch between open tabs instead.

12.3.14 Navigating a Site via the Title Bar

As you dig your way down into a Web site, it can sometimes be a little tricky to return to the original page. You can use the Back button, of course, but you either have to press and hold it to see the list of prior pages, or click it repeatedly to go back one page at a time. Luckily, Safari offers another method for backtracking.

If you [image] -click the title bar (centered just above the address bar), Safari displays a list of folders that contain the current Web page (Figure 12-14). To navigate back, just click the page that you'd like to see.

Figure 12-14. This secret menu shows a hierarchical "bread-crumb trail" of the folders that contain the current page. It even works if you didn't actually burrow here step by step. In other words, if you typed this page's address in its entirety, jumping here directly, Safari would still analyze the URL and generate this "path" menu.

12.3.15 Google Search Features I

Safari has a handy "search Google" box in the main toolbar (if you don't see it, choose View [image] Google Search). To make it even more useful, you can employ these little-known tricks:

  • If you click the small magnifying glass on the left side of the search box, it displays a list of your recent Google searches, as shown in Figure 12-15.

Figure 12-15. Top: The magnifying glass is your portal to Google searches past.

  • If you highlight a word or phrase on any Web site and then Control-click it, the pop-up menu offers an option for "Google search." Choose it to run a search directly.

12.3.16 Google Search Features II

If you run a search via the Google box, the results page lets you conduct an internal search. Just press [image] -F to bring up a small search box that has your search terms in it already, so that you can search the results page itself.

You can even switch to a separate Cocoa program (Mail, TextEdit, and so on), and the search term will be in that program's search window, too.

12.3.17 Google Search Features III

If you search using the search box on www.google.com instead of using Safari's Google search box at the top of your window, you can still view a history of your recent searches. Although there's no magnifying glass (see hint Section 12.3.15), all you need to do is hit the down arrow when the search input box is active. You'll see a drop-down menu listing your recent searches, making it easy to run your "15-minute vegan licorice recipes" search without having to type it out again.

This gambit works on more than just Google—almost any site that has a search input box will display a history of recent entries when you hit the down arrow key.

12.3.18 Google Search Features IV

Shock of all shocks, there's yet another Google/Safari feature you should be aware of. When you select some text on a Web page, you can Control-click the highlighted text and select Google Search to run a—you guessed it—Google search using the selected words. But that's not all.

When you use the Control-click method, the Google search opens in your current browser window, replacing whatever you were reading. If you'd rather not lose your current page, though, hold Shift, [image], andControl before you click the highlighted word. Although the shortcut menu looks identical, your Google results open in a new window. If you use tabbed browsing (Safari [image] Preferences [image] Tabs), this trick is even cooler—the Google results will open in a new tab "behind" the current tab, so there's no rearranging necessary to keep reading your original page.

12.3.19 Bookmark Folders

Safari's bookmark folders can help you keep your Favorites bar organized by grouping multiple sites under a single name. To create a new untitled folder, choose Bookmarks [image] Add Bookmark Folder. Once you type a name for the folder, you can fill it with bookmarks that you drag from either the main bookmark window area (as shown in Figure 12-16), or from other folders in your Collections list (Bookmarks [image] Show All Bookmarks).

Figure 12-16. To place a folder on the Bookmarks bar, drag it from the Collections list to your Favorites bar. If you don't see the Collections list, choose Bookmarks [image] Show All Bookmarks, or click the open-book icon on the left edge of your Bookmarks bar.

You can also drag new Web sites into the folder as you surf.

On the Favorites bar, a folder looks just like regular bookmark, except that a triangle sits to its right. If you click a folder's name, it pauses for a split second, then displays the sites stored within it. If you click the little triangle itself, however, you eliminate the delay, and a list of the folder's contents immediately drops down.

12.3.20 Create Tabs via URL Drag and Drop

OK, so your friend just emailed you a link to his personal antique lightbulb Web site. Problem is, you don't want to lose your place on the tulip gardening page you're reading. Instead of opening a whole new window for the lightbulb link, consider dragging and dropping it right onto Safari's tab bar. (Obviously, you must have tabbed browsing turned on in Safari [image] Preferences [image] Tabs for this trick to work.)

When you drag and drop a URL from another application onto the tab bar, Safari creates a new tab and loads it with the new page. As illustrated in Figure 12-17, this hint also works with links within Safari (although it'd probably be easier to just [image] -click the link to get it to open in a new tab).

Alternatively, if you drag and drop a URL or link onto an existing tab, Safari replaces that tab's contents with the new site.

12.3.21 A Keyboard Shortcut for the Bookmarks Bar

You can easily reach the first nine icons on your Bookmarks bar by using an unusual keyboard shortcut: -1 to open the first bookmark, [image] -2 to open the second, and so on.

This trick doesn't work for folders on the Bookmarks bar, though—it just skips over them.

12.3.22 Searching History and Bookmark Folders

If you bookmark a ton of Web pages but your collection is slightly less organized than, say, the Library of Congress, Safari can help make trips into your bookmarks and history folders less intimidating.

Figure 12-17. When you drag and drop a URL into an empty space on Safari's tab bar, the result is a new tab with the linked site's Web page. You can drag links in from Web pages, or even from other applications.

Simply click the bookmark icon (at the left end of the Favorites bar), choose Edit [image] Find [image] Find (or press [image] -F), and type your search term. Safari highlights the first entry among your bookmarks' names that contains a match. Use Edit [image] Find [image] Find Again (or [image] -G) to find the next occurrence of your term. You can even jump backward with Shift- [image] -G (Edit [image] Find [image] [image] Find Previous).

12.3.23 Bookmarking Folders for Fast Access

If you generally save all your downloads into one particular folder, you can create a toolbar icon for it, giving you one-click access to its contents. The idea is to forever end the annoying "I know I downloaded it—what the heck happened to it?" syndrome so familiar to millions of surfers.

In Safari's address bar, type file:/// (note the three slashes), followed by the path to the folder.

If you have more than one hard drive or partition, type Volumes/ immediately after the three slashes but before the folder path.

Once you've typed in the full path, don't press Enter. Instead, highlight it and drag it onto Safari's bookmark folder, as shown in Figure 12-18.

When Safari presents a dialog box, enter a meaningful short name (something like "Downloads") and then click OK.

Figure 12-18. To bookmark a folder that's right on your hard drive, just type file:/// in the URL bar, followed by the full path to the folder. Don't press Enter at that point; drag the address to the Bookmarks bar and rename it when prompted.

From now on, you can click the Downloads link on the Favorites bar whenever you like. Safari instantly switches to the Finder and opens a new window showing its contents. (Of course, you can stash any folder's icon onto the bar using this method, not just your Downloads folder.)

12.3.24 Status Bar for Full Link Information

When you mouse over a link on a Web page, most Web browsers display its corresponding URL, which is a good way to discover where a click will take you. Safari displays this info in the status bar, a one-line metallic strip at the very bottom of the browser window (Figure 12-19). If your browser has no evident status bar, choose View [image] Status Bar (or press [image] -\).

Figure 12-19. The status bar shows you what will happen when you click the link under the cursor.

When you hover over a link, the status bar puts "Go to http://..." before the URL, which is the program's way of telling you that clicking the link will take you there. But:

  • If you press [image], the status bar says, "Open `http://xyz' in a new window." Click to do so.

  • If you press Shift- [image], the status bar says, "Open `http://xyz' in a new window behind the current window." Click to do so.

  • If you press Option, the status bar says, "Download `http://xyz'." Click to download the file identified by the link to your hard drive.

  • If you press Control, the status bar says, "Display a menu for `http://xyz'." This message just tells you what you already know: Control-clicking a link brings up a useful shortcut menu (from which you can open the link in a new window, download it to your hard drive, copy it to the clipboard, or add it to your bookmarks).

Note that what you see may differ from the above example, depending on how you've set up your window and tab preferences. Regardless, the status bar always tells you exactly what will happen due to modifier keys before it happens—isn't that a refreshing change?

12.3.25 Easily Save Embedded Objects

If you spend hours and hours on the Web, chances are you often visit Web sites that have embedded multimedia files, such as flash animations (.swf files) or QuickTime movies (.mov files). Unfortunately, there's no easy way to download this media from Safari. With this next trick, though, you can save most multimedia files for later use.

Start by loading the page in Safari that contains the item you'd like to save. Then choose Window [image] Activity, to open the Activity window (or just use its keyboard shortcut, Option- [image] -A). This little gem of a window lists every single file that went into the creation of the page, along with its size. To save the embedded content, find the object's name in the Activity window—it'll probably end with .swf or .mov—and double-click it. Safari will open a new window containing just that item, so you can verify that it's the object you wished to save. From there, use File [image] Save As to save the file on your hard drive.

Even quicker, you can simply Option-double click the item directly in the Activity window. This keystroke downloads and saves the file automatically, but, on the downside, you don't get the chance to preview it first.

Note that this hint doesn't work on all content. Some QuickTime movies, for example, may disable the "save" option, while other pages build their content in such a manner that you can't easily find the media files in the Activity window.

12.3.26 Paste Directly into Safari's Downloads Window

You're checking your email one day, and you notice that a co-worker sent you a link to your company's online expenditures spreadsheet. Sure, you could paste the link directly into Safari's Address Bar and hit Enter—if you've got time to spare.

If you actually value your time, though, paste the link directly into Safari's Downloads window. The file immediately begins downloading, and your main Safari window remains unaffected. But here's the best part: you can paste any number of URLs from the clipboard into the Downloads window at once. For instance, this situation would come into play if you receive an email from your planning department like this:

Please download the following templates:

http://www.latexshoelaces.com/budget_actual.xls

http://www.latexshoelaces.com/budget_requests.xls

http://www.latexshoelaces.com/personnel.xls

To grab them all in a hurry, just copy the three lines of "http://" entries, and paste them into Safari's Downloads window. All three downloads start right away.

12.3.27 Get the Web Address of Downloaded Files

A few days ago, you downloaded that amazing demo of Fritz's Grand Surfing Adventure, and now you want to email someone a link to the file. You could, of course, visit the Web site, follow the 32 links required to find the downloaded page, and then copy and paste that address into your email message. Luckily, there's a much easier way.

In Safari, make sure the Downloads window is visible (Window [image] Downloads), and then Control-click the entry in the list for the file whose URL you're trying to discover. As seen in Figure 12-20, the URL is but a menu away.

Figure 12-20. Control-click any entry in your Downloads window to copy the URL of that file easily.

Once you've copied the URL, you can paste it anywhere you like. Paste it back into the address bar in Safari, for example, and the file will begin downloading again. Or paste it into an email to send your buddy the direct download link for Fritz's Grand Surfing Adventures.

12.3.28 Display Safari's Download Speed

Are you a speed freak? If so, you probably hate Safari's Downloads window. Instead of showing you the speed at which you're downloading files, you get an estimate of the time remaining until the download is done—and what fun is that? Try this hidden Safari trick to regain your sense of speed.

In the Downloads window, Option-click the text just below the name of the downloading file. When you do so, the display will change, as depicted in Figure 12-21.

Figure 12-21. Top: Safari's built-in setting shows you the estimated time remaining until your download is complete.

12.3.29 Monitor Download Progress in the Finder

If you've started a huge download, such as the demo for Aspyr's Call of Duty (a whopping 256 MB), you may wish to use your Mac for other stuff until the download is complete. But, being a true power user, you also want to know as soon as possible that your download is done. As seen in Figure 12-22, Safari can help you out with your burning need to know the instant your download is complete.

Figure 12-22. When you have an active download in Safari, the download's Finder icon will be constantly updated with a miniature progress bar, as seen here. So go ahead and work on other tasks while your download progresses. As long as you've set up a small Finder window to look at your chosen downloads folder, you'll know exactly when your download is done.

12.3.30 Open Downloads Directly from Safari

Many downloaded files will self-expand, self-mount, or otherwise unpack themselves without your intervention. Yet other downloads (uncompressed programs, for example) are quite stubborn, and require you to take some action to put them to use. The normal procedure in these cases, of course, is to switch to the Finder, find your downloads folder, find the downloaded file within it, and then double-click it. That's a lot of work for one file.

Save yourself a bunch of work next time: just double-click the completed download in the Downloads window, and the Finder opens the file automatically. Simple, fast, and completely undocumented!

12.3.31 Recover an Accidentally Deleted Downloads List

Safari's Downloads window can be a little confusing to work with. Take the button labeled Clear, for instance. You'd expect that you could highlight a download and then click Clear to remove it from the list. If you were to try it, however, you'd find that your entire Downloads window had been erased. Surprise, surprise...Clear deletes all entries, not just the selected ones.

Don't fear, though; your lifelong history of downloaded files is not lost forever. Just hit [image] -Z right away, and your list will magically reappear.

To prevent this problem from happening in the future, remember that you can remove individual entries from the list by selecting them and then hitting the Delete key—not the Clear button.

12.3.32 Create Temporary Cookies

Cookies are little data files that Web sites use to track various bits of information about your activities on their site. For instance, many sites create cookies to track things such as the time of your last visit, your user name and password for that site, your preferred site layout, and so on. In fact, cookies can store anything that a site designer would like them to store. You can check what cookies have been created on your machine by opening Safari [image] Preferences [image] [image] Security and clicking Show Cookies.

Given that there is some personal data in cookies, you might be concerned about the storage of such information. While Safari lets you delete cookies in the above-mentioned Show Cookies section of its preferences, you'd have to visit Preferences every single time you use the program to get rid of all cookies.

A better solution is to trick Safari into creating cookies that only last until you quit. Make sure Safari isn't running and then, in the Finder, navigate to your Home [image] Library [image] Cookies folder. Inside you'll find a file named Cookies.plist; rename it Cookies_OLD.plist. Create a new folder (Shift- [image] -N) inside the Cookies folder, and name it Cookies.plist. When you hit Return, the Finder may ask you if you're sure you want to append .plist to the name. At this point, click Add; otherwise, this trick won't work.

After creating the folder, launch Safari and browse as usual. By looking at the Show Cookies section of the preferences, you'll be able to see that cookies are still being created. You'll maintain the information in the cookies until you quit Safari. In fact, to prove that this hint works, quit and relaunch Safari, and then look at the Show Cookies section again. You'll see that it's blank, proving that none of the cookies was saved to your hard drive.

To start using permanent cookies again, just delete the folder you created, and set the name of the original file back to Cookies.plist.

If you prefer, you can start from scratch by deleting the original Cookies.plist file. Safari will make a new one the next time you launch it.

12.3.33 Deleting Entries from Safari's History

The ability to delete individual entries from your History list is quite helpful. For example, say your favorite site is EthernetRules.com. You visit often, and you don't have any other bookmarked sites that start with "et," so you usually just type et and let Safari autocomplete the URL. Then you press Enter to load the site.

But one day, someone sends you an email telling you about ETphonehome.com. So you check it out, but it's really not anything you want to visit regularly. A bit later, you decide to visit EthernetRules.com, but your usual et shortcut now autocompletes into ETphonehome.com. The problem: Safari uses the first matching entry in your History list—which, in this case, is a Web site you only visited once.

To solve this problem, click the book icon at the left end of the Bookmarks bar, and then click History. Click the triangle next to today's date, and then select the entry for ETphonehome.com. Press Delete, and Safari removes the URL. Close the Bookmark manager, and you can now use your old et shortcut again.

12.3.34 Clearing Favicon.ico Files

Never heard of a Favicon.ico file? Figure 12-23 tells all.

Figure 12-23. It's all about branding: here's the favorites icon for Slashdot.com. The small logos that appear in the Safari address bar and Bookmarks folder are designed by the Web page creators themselves. They're called favorites icons (or favicons, for short), and they're stored in favicon.ico files. They appear in other browsers, too.

Once Safari gets a hold of favicon.ico files, it's loath to relinquish them. Even choosing Safari [image] Empty Cache doesn't erase them, which makes it quite hard to test a new favicon.ico—a particular problem for Web designers. Safari can also slow down when your favicon cache gets too big—therefore, clearing it out occasionally is a smart idea.

You have two clearing options:

  • Trash them all. favicon.ico files live in your Home [image] Library [image] Safari [image] Icons folder. To force a favorite icon to reload, delete this entire folder.

  • Unfortunately, this action tosses all your favicon.ico files in the Trash. Fortunately, they simply reload when you visit sites that have them.

  • Clear them selectively. A neat piece of freeware, Safari Icon Manager (http://homepage.mac.com/macg3/sim/), lets you choose which favicon.ico files to remove from the cache, one at a time. This program is especially useful if you're testing favicons for your own Web site, because you won't have to clear out all your other favicons just to get your site's icon to reload.

12.3.35 Emailing URLs from Safari I

Some Web browsers include a clever "Mail this page" feature that sends the current URL to a recipient you specify. Not Safari. But if you use Apple's Mail program (Chapter 7), you can simulate this feature.

Start by highlighting the URL in Safari, and then choose Safari [image] Services [image] Mail [image] [image] Send Selection. A new mail message opens with the selected URL in the body. Just type an email address and a subject header, and click Send.

12.3.36 Emailing URLs from Safari II

If you send URLs to your friends every 37 seconds, consider creating a "Mail this page" shortcut for your Safari toolbar.

Get in touch with your inner Web developer, and type the following line of JavaScript (a Web-page programming language) into Safari's address bar—all on one line, with no spaces:

javascript:location.href='mailto:?SUBJECT='+document.title+'&BODY='+escape(location.href)

Now drag the icon next to the word "javascript" into the Favorites bar. Safari asks you to name the bookmark; type something like Mail Link and click OK.

You now have an easy-access button that, when clicked, opens a new message in your email program, fills the Subject line with the title of the page, and adds the URL to the body (Figure 12-24). All you have to do is add a recipient, click Send, and smile smugly.

12.3.37 Add the Missing Print Button

Many browsers have a convenient Print button right on their toolbars for quick access. No such luck if you use Safari, though—you're stuck using [image] -P or selecting File [image] Print. Or so you might think.

Figure 12-24. With a one-line JavaScript bookmark, you can create a "Mail this page" feature that Apple engineers would be proud to call their own. Make this feature even easier to use by dragging the mail link to the leftmost spot on your Bookmarks bar, so that you'll be able to trigger it from now on just by pressing [image] -1 (hint Section 12.3.21).

Using the same JavaScript technique as described in the previous hint, you can create your own Printing bookmark button. As in the previous hint, type the following into Safari's address bar—again, all on one line, with no spaces, and without hitting Enter after typing:

javascript:window.print( )

Drag the icon next to the word "javascript" onto your Favorites bar. When you drop the script, Safari will ask you to name the bookmark; call it something creative, like Print Page.

After you click OK, you'll find a new shortcut on your toolbar. Load up a Web page and click the Print Page shortcut. The Print dialog will appear, from which you can set your options and print the page.

12.3.38 Create Custom Clicked-Link Outlines

If you're switching to Safari from Internet Explorer, one of the things you may miss is the outline that appeared around a link whenever you clicked it, as seen in Figure 12-25.

Figure 12-25. When using Internet Explorer, clicking a link results in an outline box, as seen here. The outline makes it easy to tell if you've clicked the right link, simply by holding the mouse button down for a split second until the highlight appears. With a very simple text file, you can supply this same feature to Safari.

In Safari, you won't see such an outline unless the Web-page author specifically coded his pages to work in that manner. If you like the outline boxes, though, here's how to bring them back for all pages:

  1. Launch TextEdit (in your Applications folder).

    In reality, you can use any pure-text editor you want (BBEdit is a popular choice among Web programmers, for example). However, if you use TextEdit, make sure you've set it to use plain text instead of rich text (Section P.3.5.2).

  2. Enter the following line:

    :link:active, :visited:active { outline: 3px auto; }

  3. Save the file in a convenient location (like your Documents folder), and name it outlinebox.css.

    Technically, the first part of the name doesn't matter at all—the only requirement is that the file end in .css.

    If TextEdit asks you whether it should add .txt to the file name, click Don't Append.

  4. Switch to Safari and choose Safari [image] Preferences [image] Advanced.

    Safari lets you choose your own Cascading Style Sheet (basically, a set of rules about how the browser should display pages). The .css file name extension lets Safari know that you created one such file in step 3.

  5. Click the Style Sheet pop-up menu and choose Other.

    Navigate to the file you created in step 3 and click Choose.

From now on, when you click a link, you'll get an effect very similar to Internet Explorer. If you ever tire of the link boxes, just return to the Advanced section of Safari's preferences, and set the Style Sheet pop-up to None Selected.

12.3.39 The Debugging Menu

It could happen to you: you visit a favorite Web site, which sends out a little invisible signal to find out which Web browser you're using. But because you're using the relatively unknown Safari browser, your otherwise beloved Web site tells you, "Sorry, your Web browser is not supported." (Unfortunately, you frequently see this message with banking sites.)

One quick solution is to turn on the Debug menu in Safari. Its user-agent option makes Safari masquerade as some other browser, successfully fooling some Web sites into letting you in. (Don't worry, it's totally legal.)

To turn on the Debug menu, there's an easy way and a Terminal way:

12.3.39.1 The easy way

Download Safari Enhancer from www.lordofthecows.com/safari_enhancer.php. It offers a simple checkbox that turns on the Debug menu.

12.3.39.2 The Terminal way

First quit Safari, and then open Terminal (Section P.3.5.3). Type this line, and then press Enter:

defaults write com.apple.Safari IncludeDebugMenu -bool true

Quit Terminal. When you open Safari again, the Debug menu appears right next to Help. Most of its commands are designed to appeal to programmers, but a few—like these—are useful for a wider audience:

  • Use Back/Forward Cache lets you turn the cache on and off. (This is a speed trick in which Safari caches each Web page you visit so it won't have to download it again the next time you visit.)

  • Keyboard and Mouse Shortcuts opens up the master page of Safari keyboard shortcuts, saving you the effort of following the steps in hint Section 12.3.1.

  • Populate History fills your History menu with the names of bogus Web sites (wittily called bogus page 1, bogus page 2, and so on). The idea, of course, is to let programmers test the various features of the history list without actually having to visit 10 pages to fill it up.

  • User Agent is the command that lets Safari masquerade as a different browser. Choose User Agent [image] Mac MSIE 5.22, for example, to assume the identity of Internet Explorer for Mac.

If you ever want to eliminate the Debug menu, just repeat the above Terminal command, but replace true with false.

12.3.40 An End to Brushed Metal

Safari joins Apple's tribe of programs, including QuickTime, Address Book, and iTunes, that look like they've been built out of brushed aluminum. If you prefer the Aqua appearance common to most other Mac OS X programs (Figure 12-26), you can alter Safari's look, using one of two methods.

Figure 12-26. Top: Safari wearing Aqua.

12.3.40.1 Method 1: If you've installed Developer Tools

This method only works if you've installed the Xcode Tools CD (Section P.3.5.5).

  1. Quit Safari, if it's running.

    Just in case, make a backup copy in the Finder using File [image] Duplicate (or [image] -D).

  2. Control-click the Safari icon and choose Show Package Contents. In the new window that opens, navigate to Contents [image] Resources [image] English.lproj.

    This folder contains files that tell Safari how to display itself when you launch it. By editing the right file, you can change the look of browser windows.

  3. Double-click Browser.nib.

    You've just opened Interface Builder, a program used by coders to design the appearance of their software.

  4. In the Browser.nib window, click the Window icon. Press Shift- [image] -I to bring up the Inspector window, and select Attributes from the pop-up menu at the top.

    The Inspector window lets you customize the look and behavior of different windows.

  5. Deselect the Has Texture checkbox at the bottom of the Inspector.

    The window transforms to Aqua before your very eyes.

  6. Choose File [image] Save, quit Interface Builder, and relaunch Safari.

    From now on, Safari's browser windows will all be Aqua-colored.

To revert to the old brushed-metal look, simply use the backup copy of Safari you made in step 1. (Or, if you prefer doing things the long way, repeat the above instructions but turn on the Has Texture checkbox.)

12.3.40.2 Method 2: Doing without Developer Tools

If you don't feel like installing the Xcode Tools, or you simply prefer to take the hands-off approach, download Unsanity's free Metallifizer program from http://unsanity.com/haxies/metallifizer/. This little application removes (or adds) the metal appearance for any Cocoa program.


12.4 OmniWeb Hints

The Omni Group, creator of OmniWeb, has been programming for Mac OS X for years—even before there was a Mac OS X. That's because the company developed OmniWeb for the NeXT operating system, on which Mac OS X was eventually based.

OmniWeb is a Cocoa program, so it automatically includes all the nice features like system services, a customizable toolbar, and spell checking that are typical of programs like Mail and TextEdit. In addition, OmniWeb is based on Apple's own Web Core, the same display engine that powers Safari. Many of the features you know and love from Safari, therefore, are automatically available in OmniWeb.

12.4.1 Web Pages as PDF Files

As you know from hint Section 4.3.10, Mac OS X can create a PDF file from anything you can print; just open the Print dialog box and click Save as PDF.

OmniWeb includes a keyboard shortcut to make this procedure even easier, though. If you hold down Option as you choose File [image] Save As, the menu item becomes Save As PDF (you can also press Option-Shift- [image] -S to achieve the same thing). It's a great way to preserve a receipt, driving directions, or other important Web info.

12.4.2 Opening a New Window Containing the Current Page

Every now and then, you might want to open an exact copy of the page you're currently viewing. For example, if a site is filled with links, you may wish to follow a story on the main page—but keep the original page around to revisit when you're done reading.

In OmniWeb, you can double-click the small icon next to the site's name in the URL bar, as shown in Figure 12-27. An exact duplicate of the first Web page opens, ready for link-following.

Figure 12-27. Want to open a new window containing the exact page you're viewing now? If so, just double-click the icon next to the URL, as shown here. (Double-clicking the icon in the title bar achieves the same thing.)

12.4.3 Shortcuts

OmniWeb comes with a few predefined shortcuts designed to save you lots of address typing. One of the best is the shortcut for Google, which, instead of just loading the Google home page, lets you type the actual search terms in the address bar. For example, if you type google Icelandic tomatoes, OmniWeb brings you straight to the Google page for Icelandic tomatoes. (Of course, you could always use the Google search box right next to the address bar, but that's nowhere near as much fun.)

You can see the other predefined shortcuts by choosing OmniWeb [image] Preferences [image] [image] Shortcuts. However, if you're the kind of person who likes to do things your way, you'll be most interested in the + button at the bottom of the panel, which lets you add your own shortcuts.

When you click the + button, OmniWeb creates a shortcut called "somewhere" and associates it with a URL of http://www.somewhere.com on the right side of the window. To make the shortcut your own, simply select each box to rename the shortcut and enter the real URL, as shown in Figure 12-28.

12.4.4 Death to Pop-Up Ads

Sure, everyone knows that ads help to pay for the rich goodness we call the Web. But there's no law stating that annoying and invasive advertising should be allowed to take over your browsing experience. Thankfully, OmniWeb makes it easy to turn off some of the most annoying advertisements: the ones that appear in their own pop-out windows.

Figure 12-28. In this example from OmniWeb 5.0, the shortcut named Apple Home lets you type ApH to load Apple.com. (The name of the shortcut really doesn't matter—it just helps to keep your list organized.)

Choose OmniWeb [image] Preferences, and then click the Ad Blocking icon. In the section marked "Block pop-up windows," select "Only when not requested," as shown in Figure 12-29.

Figure 12-29. When you activate "Only when not requested," you fend off most pop-up and pop-under ads, but you still get to see the pop-ups of your choosing by clicking on links.

12.4.5 Death to On-Page Advertisements

In addition to letting you turn off pop-up and pop-under ads, OmniWeb can also block ads directly on Web pages. Of course, these ads are what keep most free sites free—but if your conscience can handle it, so can OmniWeb.

Choose OmniWeb [image] Preferences, and click the Ad Blocking icon. In the "Block images and other online content" section, turn on the "From blocked URLs" checkbox, and then click the Edit Blocked URLs List button so you can see what's going on behind the scenes (Figure 12-30).

Figure 12-30. OmniWeb includes three predefined filters (the weird-looking lines in the window) that check for anything coming from an "ads" folder on a .net or .com site, as well as a more general filter for anything coming from Doubleclick.net, one of the largest online advertising placement services.

OmniWeb uses a system called regular expressions to figure out what ads to block. Judging by the screenshot, though, they could be more accurately called "totally irregular expressions" unless you're a Unix expert. For more information on regular expressions, see the box on Sidebar 15.7.

Next, consider the other two checkboxes in this section. If you turn on "Matching known ad sizes," OmniWeb compares each image on a Web page with standard advertising image sizes, as defined by the International Advertising Bureau. If an image matches—and it's linked to some other page—OmniWeb blocks it.

If you turn on "From third-party sites," OmniWeb blocks all images coming from sites other than the one you're reading (a common method for showing ads). Although this feature eliminates most ads, it also tends to eliminate many legitimate graphics, since many Web sites today (including Apple.com) reside on multiple servers.

12.4.6 Learning HTML Techniques

OmniWeb is ideal for learning the intricacies of HTML, the behind-the-scenes language of the Web. In fact, the next time a Web page makes you wonder, "How did they do that?" just choose View [image] View in Source Editor. Then click Reformat, which makes the code easier to read.

OmniWeb color-codes the HTML tags and—for the benefit of student Web designers—it flags HTML coding errors (mismatched brackets, misspelled commands, and so on) with colored blocks over the text.

Take your education a step further by making some changes in the HTML code, and then clicking Redisplay to learn what's changed on the page. The beauty of OmniWeb is that it lets you edit the source of real Web pages, not just look at them.

Remember, you're just fooling around with a copy of the original page. You can't actually make changes to a site that's online from within OmniWeb.


12.5 Mozilla, Netscape, Camino, and Firefox Hints

All four of these powerful browsers are built on the same basic code that ran the old versions of Netscape, and therefore have plenty of tricks in common. Unless otherwise noted, all the hints in this section work with all four browsers.

12.5.1 Tabbing Around a Page

When you're filling out an online form, pressing the Tab key moves your insertion point from one text input field to the next, skipping over things like pop-up menus and radio buttons. If you'd rather Tab to those screen elements, too (so you can use the keyboard to complete an entire form, for example), you only need to modify a lone preference file.

This hint doesn't work in Camino, but it's unnecessary there since Camino automatically lets you tab through pop-up menus and radio buttons.

Type about:config in the address bar and hit Enter; your browser will display hundreds of different preference settings, as seen in Figure 12-31. Thankfully, you're just interested in the third item in the list, accessibility.tabfocus.

Double-click this entry to bring up a dialog box; enter 3 to allow tabbing to text controls and form elements.

To add the ability to tab to links as well, enter 7 instead. This setting really isn't recommended, though, as you'll be hitting Tab 14,003 times on the typical Web page. To restore the original setting, just enter 1.

Figure 12-31. The "about:config" page in Netscape, Firefox, and Mozilla displays a huge number of obscure settings. The highlighted one controls how these browsers handle tabbing through elements on a typical HTML page.

12.5.2 Jumping to Your Home Page

To get from your current Web page to your preferred startup page, press [image] -Home (or, if you have a laptop, [image] -fn-left arrow key) if you're using Mozilla or Netscape. Camino achieves the same thing with Shift- [image] -H, but Firefox has no keyboard shortcut for it.

Specify your favorite startup page by choosing Mozilla [image] Preferences [image] Navigator, Netscape [image] Preferences [image] Navigator, Camino [image] Preferences [image] Navigation, or Firefox [image] Preferences [image] General.

12.5.3 Filling Out Forms

This hint only works in Netscape and Mozilla.

Nearly all browsers let you save information for forms that you fill out frequently, making future completion of the same form a snap. It's great for sites whose "Email this page" links request your name and email address each time you click it.

Therefore, the next time you filled out a form manually, just choose Edit [image] Save Form Info. From then on, you can choose Edit [image] Fill In Form to complete the whole thing automatically.

But what if you don't want the whole form filled in with your saved info? Maybe, for example, you want to fill in your name and email address but not your postal address.

The solution is surprisingly easy. Rather than choosing Edit [image] Fill In Form, just click inside (or Tab into) each field that you'd like to fill with your saved value, and then double-click inside it. The rest of the fields remain blank, so you can single-click inside them and fill in whatever you like.

12.5.4 Browser Interior Decoration

You can change the look of Mozilla, Netscape, and Firefox by changing their skins or themes (canned design schemes). If you have a customization compulsion, this feature is not to be missed.

Mozilla and Netscape come with two themes: Classic (the preset choice) and Modern. Figure 12-32 reveals what each skin looks like and explains how to change them.

Figure 12-32. Top: Mozilla's Modern theme.

Not surprisingly, you can download additional skins, too. At the bottom of the Themes pane is the link to Get New Themes. If you click it, Mozilla or Netscape opens a Web page that, in turn, offers two sites for new themes.

These two sites offer many of the same skins, but if you want to ensure that you're familiar with every possible choice, visit them both. On either site, if you click a theme's link (Pimpzilla, for example), you get a window that previews the skin (in this case, lots of leopard print) and an option to install it.

Firefox, on the other hand, has just one theme site available when you click Tools [image] Themes [image] Get More Themes.

Themes are often version-specific. So if you're running Mozilla 1.6, for example, and a theme you want is only available for 1.3, you're out of luck.

Additionally, to look their best, Firefox themes need to be tweaked for Mac OS X. When you're downloading themes, therefore, look for those with "Mac" or "OS X" in their name. Other themes will work with Firefox on the Mac, but you may have visual glitches in buttons and scroll bars.

Once you've chosen a compatible and pleasing theme, simply click Install, wait until the installation finishes, and then quit and restart your browser. That's it!

12.5.5 Using an External Mail Program

If you use Mozilla or Netscape as a browser, you probably experience a small fit of annoyance whenever you click a Send Email (mailto:) link, and your browser launches its own email program instead of the one you've specified in Mail's Preferences [image] General pane.

You can, of course, send a message from the browser's own email program, but it won't have any of your settings (special fonts, signatures, and so on), and it won't file itself in your regular email program's Sent folder. Hey, where's the benefit in that? Luckily, you can change your browser's behavior—and save bottles of Advil over the course of your lifetime—by changing one simple preference setting.

Start by entering about:config in your address bar, and then hit Enter. Netscape loads a special Web page where you can add, delete, and modify some of the less obvious Mozilla/Netscape preferences (hint Section 12.5.1).

The preference field that controls mailto: links doesn't exist yet, so you'll need to add it. Control-click any area of the page, then select New [image] Boolean from the shortcut menu. In the dialog box that appears, type network.protocol-handler.external.mailto and click OK. The next dialog box is used to set the value of the preference, so type true and click OK.

You've just created a flag that tells Mozilla/Netscape to use your preferred external mail program when you click a mailto: link. And you don't even need to relaunch your browser; the changes take effect immediately.

12.5.6 MultiZilla

If you like the tabbed browsing feature in Mozilla and Netscape (hint Section 12.1.9), you're gonna love the open-source MultiZilla add-on. Available at http://multizilla.mozdev.org/installation.html, MultiZilla lets you add a world of cool features to tabbed browsing, including:

  • Renaming tabs.

  • Specifying a group of tabs to open when you launch your browser.

  • Moving the tab bar to the bottom of the browser window or hiding the bar completely.

  • Copying tabs by dragging them to empty locations on the tab bar.

  • Learning the status of any tab just by glancing at the color of the icon on the tab's left edge—a yellow dot means the page is opening, a red dot means the page is loading, and a green dot means the page is ready.

MultiZilla has no uninstaller. Furthermore, MultiZilla may delete your Home [image] Library [image] Mozilla folder when you install it. Therefore, before you rush through the installation process, make a backup copy of this folder, so you can reinstate it if you decide to return to your pre-MultiZilla days.

When you install it, MultiZilla places a toolbar just under your Favorites bar. The new toolbar also includes a QPrefs menu for many preference settings, which you can otherwise reach only by opening the Preferences window and clicking the specific setting you want to change. Figure 12-33 shows this menu in action.

Figure 12-33. Here, Mozilla's options are being modified to only accept images from the same location as the Web site being viewed. Without MultiZilla, you'd have to select Mozilla [image] Preferences, click Privacy & Security, click Images, click the desired setting, then click OK.

MultiZilla also adds small a menu to the right side of your toolbar. With the buttons on this menu, you can close the current tab, all tabs other than the current tab, or all tabs.

12.5.7 MultiZilla and Google

Once you have MultiZilla up and running (see previous hint), consider adding the GoogleBox Widget. This one-line box sits on the MultiZilla toolbar, and lets you search Google without first jumping to the Google Web site (Figure 12-34). Complete instructions for downloading and installing it are at http://multizilla.mozdev.org/features/googlebox.html.

In the unlikely event that you ever tire of the GoogleBox, you can uninstall it by clicking the Google eyeball icon to the left of the search box and then selecting Uninstall.

Figure 12-34. Here, the GoogleBox is searching for "mac os x help" in Google Groups. If you enter a search and click the buttons to the right of the pull-down menu, you can search using specific Google modes—like only searching within the current site, for example. Hover your cursor over one of the buttons for a few seconds to see what it does.


12.6 Camino-Only Hints

Camino, although also based on Mozilla's code, is somewhat different than the other three such browsers. It has a number of unique features, including the most Mac-looking interface of the bunch. Here are a few hints specific to Camino.

12.6.1 Copying Tabs

If you have a bunch of tabs open in Camino, you can do-si-do them around as follows:

  • If you drag an existing tab to the very edge of the tab bar (the empty part), using the small icon next to its name as a handle, you create a new tab of the same site, as illustrated in Figure 12-35.

Figure 12-35. Dragging the Apple tab to an empty area of the Camino toolbar (far left) creates a new tab displaying the same site. The idea of this feature, of course, is that it's now easy to branch off to a second page of that same site, without having to hit the Back button.

  • If you drag the icon of one tab over another, you erase whatever's in the second one and create a copy of the first.

  • If you drag a link from a Web page to the empty edge of the tab bar (or onto an existing tab), you create a new tab that opens the URL you just dragged into place.

12.6.2 Get Quick Access to Bookmarks via the Dock

If you're like most people, you probably have a few Web sites that you visit every day—and wouldn't it be convenient to have them in Camino's Dock menu for easy activation from any program? Luckily, with a few mouse clicks in Camino, you can do just that, as shown in Figure 12-36.

Figure 12-36. Camino displays each site in a specially marked bookmark folder inside Camino's Dock pop-up menu. This menu gives you fast and easy access to any of your favorite sites, regardless of what your Mac may be doing. In short, if you can see the Dock, you can jump right to your favorite site.

The first thing you'll need is a bookmarks folder holding your most-often visited sites. If you don't have one, select Bookmarks [image] Add Bookmark Folder, enter a name for your new folder, set the Create In pop-up menu to Bookmark Bar, and click OK. Next, visit your favorite sites and drag and drop their URLs onto this folder on the toolbar.

The final step is quite simple, as seen in Figure 12-37.

Figure 12-37. To have Camino display the Web sites from a given folder in its Dock menu, Control-click the folder in the toolbar and select Use as Dock Menu, as shown here.

The only downside to this trick is that you can only specify one folder for your Dock menu. When you select another folder, it'll replace the current one in the Dock menu.


Chapter 13. Other Applications

Sure, Mac OS X comes with a slew of iApps and utilities. But it wouldn't be a very impressive operating system if it didn't also run a world of programs from other companies—Microsoft Office, Adobe Photoshop, and so on. Which it does, of course.

This chapter's hints help you take full advantage of BBEdit, Microsoft Office, Photoshop or Photoshop Elements, SnapzPro X, and more. Because these tend to be advanced programs, the following tips tend to be for advanced Mac fans.


13.1 Acrobat Reader 6

Adobe's Acrobat Reader 6.0 is the latest version of the ubiquitous free PDF reader, found on seemingly every version of every major operating system. On Mac OS X, Acrobat Reader 6 has some compelling features that make it a worthy opponent to Apple's own Preview application, including better password support and searches that work on all your PDFs at once (Edit [image] Search).

13.1.1 Greatly Reduce Acrobat Reader 6 Startup Time

One of the not-so-great things about Acrobat Reader 6, especially when compared to its predecessor, is that it takes about a decade to launch. The delay is due to a series of plug-ins that provide additional features to the program. Each plug-in takes time to load, and not just once—they reload every time you launch. And here's the kicker: if you simply download PDFs from the Internet, chances are you'll never need the vast majority of these plug-ins anyway.

To disable individual plug-ins, click once on the Acrobat Reader 6 application in the Finder, select File [image] Get Info, and then look in the Plug-ins section of the dialog box. Here you'll find the whole list of plug-ins that load up when you launch Acrobat Reader 6. You can disable a plug-in by simply unchecking the box next to its name. (If you're not sure what an individual plug-in does, simply launch the program and select Adobe Reader [image] About Adobe Plug-Ins. Using this information, you can decide which plug-ins you'd like to leave active, and which to disable.)

If you're like 99 percent of people, you can safely disable all of the plug-ins except Search.acroplugin (for searching files), Reflow.acroplugin (to make text scale properly to a window size), and PrintMe.acroplugin (for printing files). With all the other plug-ins disabled, you'll find that the launch time for Acrobat Reader 6 decreases noticeably.

Should you ever need a plug-in that you've disabled, simply revisit the Get Info window and turn the disabled checkbox back on. The next time you launch Reader 6, it'll once again be active.


13.2 BBEdit

BBEdit is a text editor that's beloved by power users, Web designers, and programmers the world over. It's designed mainly for nerdy text editing—tasks like making HTML Web pages and writing computer programs in PHP and Perl.

13.2.1 Editing System Files

If you try to edit one of Mac OS X's own system files, you'll quickly discover it's pretty tough. Mac OS X is very protective of its files, and doesn't permit ordinary civilians to alter them.

You can work around this blockade in any of three ways. One way: If you know Unix, you can open Terminal (Section P.3.5.3) and use the chmod command. Another option: In the Finder, you can open a Get Info window for the file, transfer the ownership to your account, edit the file, and then restore ownership to root when you're done.

Or you could use BBEdit, which offers a third, and much simpler, solution.

Since system files are typically hidden, the first thing you need to do is find the file you want to edit. (Duh!) To do so using BBEdit, simply choose File [image] Open Hidden. Then, in the dialog box that appears, select All Files from the Enable pop-up menu, hit Shift- [image] -G to bring up the Go to Folder dialog box, and enter the full path to a hidden folder, as shown in Figure 13-1.

When you press Enter, BBEdit opens the hidden folder in the top portion of the dialog box, revealing all the hidden files inside.

Pick a file to edit by double-clicking it, and then edit away to your heart's content. Just make sure you know your password. Write it across your knuckles if necessary, because the Mac prompts for it before you can save your changes.

Figure 13-1. BBEdit can open files and folders that are normally hidden in the Finder. For example, you can edit Apache's configuration file, which controls Mac OS X's built-in Web server, by editing the file stored at etc [image] httpd [image] httpd.conf.

Use your newfound power with care. If you mess up when editing a system file, you can damage your Web server, FTP server, or even Mac OS X itself.

13.2.2 Listing Files I

As described on Section P.3.5.1, Mac OS X uses an unusual system of packages to store certain programs and documents as a single icon. If you like modifying your programs, it's a safe bet you'll spend a fair amount of time in the Finder, selecting icons and choosing Show Package Contents from the shortcut menu. Luckily, BBEdit offers a simpler way.

Just drag a program (or other bundle) onto BBEdit's Dock or Finder icon. BBEdit thinks for a few seconds, and then shows something similar to Figure 13-2.

This trick works with any regular folder, too—not just with packages.

Figure 13-2. To navigate all the files in a program—including the hidden ones—merely drag the program's icon onto the BBEdit icon. Once you've done that, you can select a file or folder in the upper portion of the window to display its contents, or double-click one to navigate deeper into the package.

13.2.3 Listing Files II

An even more useful variation on the previous hint lets you create a printable list of the entire contents of a folder or disk. That's handy if, for example, you need a printout of your hard drive contents for archival purposes.

If you drag a folder or hard drive icon into a new BBEdit document window, the program goes to work—sometimes for quite a while—and eventually displays all the files and folders inside.

This process can take hours, especially if the folder you're investigating includes Mac OS X itself. (In that case, you could easily wind up with a list of more than 100,000 files.) Buy stock in toner and paper companies before you print the document.

13.2.4 Keyboard Scrolling

If you have a document that is wider or longer than the BBEdit window, the keyboard is the quickest way to navigate:

  • Option-up/down arrow scrolls up or down a full page.

  • -up/down arrow jumps to the beginning or end of your document.

  • -left/right arrow takes you to the beginning/end of the current line.

13.2.5 Scroll Bar Acceleration

When you click one of the scroll bar arrows, BBEdit scrolls a line at a time, as you would expect. If you press [image] while clicking, however, the scrolling speed increases. And if you press Option, you scroll faster still. Keep these shortcuts in mind, for example, when you're scrolling through a list of your hard drive's files (hint Section 13.2.3).


13.3 DragThing

DragThing is a program designed to help organize and launch your most frequently used programs (Figure 13-3). This little shareware gem is one of the most popular downloads by efficiency-nut power users. You can download your own copy from www.dragthing.com/english/download.html.

Figure 13-3. DragThing is something like Apple's Dock, only it allows you to create multiple docks. Each one has a number of additional features, including full AppleScriptability, convenient keystrokes, and multiple tabs.

The following hints use AppleScript to change various hidden settings within DragThing. To use these hints, open Script Editor (in Applications [image] AppleScript), type the script for a given hint (pressing Return at the end of each line), and then click Run. You can reverse the effect of any hint by clicking Run again.

13.3.1 Nix the Fades

When you hide one of DragThing's docks (using Scripts [image] Dock [image] Hide Dock or Hide All Docks) or show one of its docks (using Script [image] Dock [image] Show All Docks), the dock slowly fades out of—or into—sight. All very dramatic, indeed. On the off-chance you're more of a nuts-and-bolts person, the following AppleScript makes it just blink on and off:

tell application "DragThing"

 set shouldFade to do not use fading

 set do not use fading to (not shouldFade)

end tell

13.3.2 Indicate Active Programs

You can tell which programs are open in DragThing by the small triangles on their icons (Figure 13-4, top).

Figure 13-4. Top: DragThing's new way of telling you a program is active: a small triangle in the program's dock cell. Here, Butler and Transmit are active.

Older versions of DragThing, however, indicated that a program was active by darkening its entire dock cell (Figure 13-4, bottom) —a less subtle visual cue. Old-timers pining for the indicator of yore need only run this AppleScript:

tell application "DragThing"

 set useBadge to do not use running app badge

 set do not use running app badge to (not useBadge)

end tell

13.3.3 The DragThing Easter Egg

If you think Easter eggs are pink and yellow ovals that appear in drugstores in the spring, you're right. In the 21st century's digital age, however, Easter eggs also refer to program features, planted in software by its programmers, that do something unexpected or fun. To see a useless but visually interesting Easter egg in DragThing, choose DragThing [image] About DragThing and leave the About box open. After about 10 seconds, the image starts to get woozy and liquid. No, it's not your sense of balance going haywire, it's the Easter egg! (Programmers have all the fun, don't they?)


13.4 Microsoft Office 2004

Microsoft Office is one of the most ubiquitous suites of software anywhere. Especially on Mac OS X, Office 2004 (and its predecessor, Office X) offers features not available anywhere else. Comprised of Word, Excel, PowerPoint, Entourage (an email, calendar, and address book program), and MSN Messenger, Office provides just about everything you could need to conduct personal or business work on a Mac—as long as you can accept a suite of memory- and space-sucking programs. The Professional version even includes VirtualPC, so you can (gasp!) run Windows on your Mac.

13.4.1 Long File Names in Older Versions of Office

Although Mac OS X lets you use up to 255 characters in file names, Office programs (up through Office X) are more limited. If you open a document that has more than 31 characters, edit it, and save it, Office retains the long file name. In other words, Office can understand long file names—it just can't create them. If you rename a document in the Finder, say, Uncle Rumpelstiltskin's Extraordinary Adventure at Fort Ticonderoga, Office will open it and respect its name without batting an eye. However, if you create a new document, you can't give it a name with more than 31 characters.

The permanent solution to this problem is to upgrade to Office 2004, which removes the 31-character limitation.

13.4.2 The Treachery of Damaged Fonts

Office programs are particularly vulnerable to damaged fonts. Even when a particular font plays nicely with other programs, it may cause Office applications to crash when you open them.

Finding a corrupted font, unfortunately, is more an art than a science. The easiest way to start is by moving all of your Mac OS 9 fonts somewhere else (they're in System Folder [image] Fonts) and then relaunching the Office program you want to use.

If moving the Mac OS 9 fonts solves your problem, then you know that one of them was the cause—but you won't know which one. To identify the corruptive font, you can use a program like Font Doctor (www.morrisonsoftdesign.com/fd_mac.html) or FontAgentPro (www.insidersoftware.com/FontAgent/fontagentpro/index.html). Or you can choose to put only a few fonts at a time back into the System Folder [image] Fonts folder, restarting your Office program each time, until you pin down the culprit.

If the Mac OS 9 Fonts folder doesn't seem to be the problem, you may have an issue with one of Mac OS X's own Fonts folders—of which there are three.

  • Your Home [image] Library [image] Fonts folder. This is your own personal stash.

  • The Library [image] Fonts folder. These are fonts added by the Mac's administrators (Sidebar 1.1), and they're available to everyone.

  • The System [image] Library [image] Fonts folder. These are Apple's fonts, the ones Mac OS X requires to run. It's unlikely that the source of the trouble is here, as Mac OS X makes it very hard to modify the fonts in this folder; they're most likely to be untouched and just fine.

Unfortunately, trying to ferret out a bad font from these folders using trial and error is likely to be a lengthy trial, fraught with errors. You may not be able to remove some for testing, for example, because they're owned by Mac OS X. In this case, your best bet is to let Font Doctor or FontAgentPro turn them off and on for your testing pleasure.

13.4.3 Zooming Word Documents

If your mouse has a scroll wheel, you can use it to zoom in or out on an open document. Press Control and scroll up to zoom in; press Control and scroll down to zoom out. Sure beats mousing up to the View [image] Zoom command, wouldn't you say?

13.4.4 Generate Text Strings in Word

When you're testing a particular layout in Word, it can be particularly tedious to fill it up with text just to see how it looks. You can, of course, type a sentence, then copy and paste it over and over again to fill up the document. But who wants to do that? You'd be better off spending that same time learning how to hula dance.

The solution is Word's built-in text filler, the rand command. Just type =rand(3,5), where 3 represents the number of paragraphs to create, and 5 is the number of sentences per paragraph.

As soon as you hit Return, Word will fulfill your request, using that special sentence you know so well from Typing 101: The quick brown fox jumps over the lazy dog.

This nifty stunt doesn't work in Office X and earlier.

13.4.5 Listing Word's Keyboard Shortcuts

Word contains a huge number of keyboard shortcuts, many of which require an odd combination of keys, and some of which control totally esoteric commands (Toggle Master Subdocs, anyone?). Fortunately, Word contains a macro (a preprogrammed process) that creates a new document listing all the program's keyboard shortcuts.

Choose Tools [image] Macro [image] Macros. Near the bottom of the Macros dialog box is a pop-up menu labeled "Macros in"; click it and choose "Word commands." In the new list of macros that appears, scroll down to List Commands (or cheat, and start typing ListCommands in the Macro name box, and you'll jump right there), highlight it, and then click Run (Figure 13-5).

A dialog box now appears, asking what type of list you'd like to create; leave it set to "Current menu and keyboard settings." When you click OK, Word generates a new document with a chart of all its keyboard shortcuts.

13.4.6 Speeding Up Scrolling (Office X)

On not-quite-state-of-the-art Macs, Word documents sometimes scroll at the speed of turtles. In mud. On Benadryl.

If you're using Office X, though, you can speed things up by turning off Quartz Text Smoothing, a Mac OS X feature that smoothes onscreen fonts by softening their edges. Here's how:

Figure 13-5. This special Word macro, which you can find by choosing Tools [image] Macro [image] Macros, generates a list of all Word keyboard shortcuts. Just highlight the List Commands macro and then click Run.

In Word, choose Word [image] Preferences; in the list that appears on the left, click General. Turn off the "Enable Quartz text smoothing" checkbox, and then close the window. As Figure 13-6 shows, your text now looks a bit different, but remains highly readable.

Figure 13-6. On the left is a Word document with Quartz Text Smoothing turned on (the factory setting). On the right, the same document with Quartz Text Smoothing turned off. While they look only slightly different, they scroll much differently.

You can use this same trick to speed up scrolling in Excel and PowerPoint, too. In Excel, the checkbox is in Excel [image] Preferences [image] View. In PowerPoint, choose PowerPoint [image] Preferences, and then click the View tab.

This quick change can result in major speed gains: scrolling one line at a time, a nine-page text document on a 500 megahertz iBook required nearly 30 seconds to scroll from top to bottom with Quartz rendering turned on, but only 12 seconds with it turned off.

This option was removed from Word, PowerPoint, and Entourage in Office 2004. Strangely enough, though, you can still disable Quartz in Excel, which is the program that least needs super-fast scrolling.

13.4.7 The Live Word Count Problem

Word's Live Word Count feature (Figure 13-7) also has a habit of slowing down large documents in Word.

Figure 13-7. Top: The Live Word Count feature displays the total number of words in a document and the number of words up to the insertion point.

It sounds innocuous, but this constant word counting can occupy much of your available computing horsepower while Word sits idly by in the background.

To learn how much of your computer's attention Word commands while it's running in the background, open a long document, and then open Activity Monitor (in Applications [image] Utilities). Scroll down in Activity Monitor until you see the entry for Word, and look at the "% CPU" column. If it's higher than 10 percent or so, Word is probably contributing to your machine's laggardly ways.

Turning off Live Word Count can help immeasurably. You can switch it on and off by choosing Word [image] Preferences, clicking View in the list that appears on the left, and then clicking Live Word Count.

Wait a minute after you turn off the feature before you check Process Viewer. Word needs time to integrate the change, and the CPU usage may spike in the meantime.

13.4.8 PowerPoint 4.0 Files in PowerPoint 2004

Unfortunately, PowerPoint 2004 is unable to open presentations you created just a couple of Office versions ago—files in PowerPoint 4.0 format, to be precise.

They're not necessarily consigned to the dustbin of your hard drive, however. You can salvage them using Office 98 or Office 2001—that is, if you can rustle up a copy.

In PowerPoint 98 (which runs in Classic; see Sidebar 4.2), open the presentation you'd like to convert. Choose File [image] Save As, set the format to Presentation Template, and then save the file. Quit PowerPoint 98, open PowerPoint 2004, and open the converted 4.0 presentation.

If you don't have Office 98, use PowerPoint 2001 for the job. Just open the presentation in PowerPoint 2001, and you should see a message stating that the presentation is being converted to a new format. When it's done, save the file, quit PowerPoint 2001, open PowerPoint 2004, and open the converted 4.0 presentation. Conversion complete.

You may find that you've lost some font information and formatting, but at least you can see and edit most of the presentation.

13.4.9 Importing Entourage 2001 Data into Entourage 2004

Sure, Entourage 2004 can import your old Entourage 2001 data—hey, there's an Import command right in the File menu. There's only one problem: it doesn't work if you don't still have a copy of Office 2001 installed.

Instead of reinstalling Entourage 2001, though, just insert your original Office 2001 CD into your CD-ROM drive. The import program now sees Entourage 2001 on the CD-ROM, and as a result runs the process without any more backtalk.

(This is only half a hint, really: if you no longer have Office 2001, you're truly out of luck.)

13.4.10 Entourage Notes to Stickies

If you want to convert an Entourage note to a new note in Stickies, you could always open the note in Entourage, select all the text, copy it, switch to Stickies, and then paste.

Well, yeah, you could...but why take the long way home, when there's a perfectly good shortcut through the woods. Figure 13-8 maps out the path.

13.4.11 Easy Email Attachments

Normally, to send an attachment, you'd switch to Entourage, open a new email, address it, add some explanatory text, and then attach the file. Life's way too short for that, though.

The next time you want to attach a file, try this shortcut: just drag the attachment onto Entourage's Dock icon. A new message window opens with the file attached, ready for you to enter a recipient and subject.

This hint also works with Mail, Eudora, and many other email programs.

Figure 13-8. Create a new blank Stickies note and switch to Entourage, making sure you can still see the Stickies note. Highlight the Entourage note you want to transfer, but don't open it. Now drag it from Entourage onto the empty note. The contents go along for the ride (albeit without graphics).


13.5 Photoshop and Photoshop Elements

Photoshop is the 800-pound gorilla of the graphics world. It's a complicated, hard-core program best left to trained professionals wearing protective garb. Elements, meanwhile, is a "lite" version of Photoshop, providing about 80 percent of the big program's features for about 15 percent of the cost. These hints apply to both programs.

13.5.1 Zooming with a Scroll-Wheel Mouse

Here we go again with the scroll-wheel mouse: if you press Option as you turn the little wheel, you magnify or reduce your Photoshop document, zooming in (by scrolling down) or out (by scrolling up).

The program is set to zoom in large, jerky increments (you jump from 66.7 percent to 100 percent to 200 percent, and so on). But by pressing Option and Shift, you can do the zoom thing in much finer, smoother increments.

13.5.2 Speeding Up Batch Conversions

Photoshop's File [image] Automate [image] Batch command lets you apply resizing and formatting changes to a large number of files at once, while you sit back and leaf through a magazine.

To accelerate your batch conversions, send Photoshop to the background. That's because when it's not the frontmost program, Photoshop doesn't bother to redraw the screen as it opens and modifies every file in the batch. The result is much faster processing.

13.5.3 Force Adobe Help Files to Open in Another Browser

Adobe's help files are factory-set to open in Internet Explorer, one of the oldest and least powerful of the Mac OS X browsers (Section 12.2). If you'd rather have the help files open in a more modern browser, there are a couple ways to do it:

The brute force method: This change will affect all files on your hard drive whose names end with .html, so use this method only if that's not a concern to you. (If you design Web pages, for example, you may have set .html files to open in BBEdit or Dreamweaver; therefore, this method will eliminate your setting.) In the Finder, open the Photoshop or Photoshop Elements folder, and open the Help folder within it. Click any file whose name ends in .html and select File [image] Get Info ( [image] -I). In the Opens With section, find your browser of choice in the pop-up list, and then click the Change All button. From now on, all HTML files—including the help files—will open in the browser you specified.

The elegant method: If you'd rather not change your HTML preferences on a system-wide level, you can make just the Adobe help files open in a different browser. The key to this trick is to remove the resource fork that makes the help files open in Internet Explorer. Once you do that, the help files automatically open in your preferred browser.

The easiest way to remove the resource fork is to install The Grim Ripper (http://free.abracode.com/cmworkshop), a program that works in the Finder's shortcut menus. With The Grim Ripper installed, select all of the .html files, Control-click them, and be done with the resource forks in one easy step, as shown in Figure 13-9.

Figure 13-9. After installing The Grim Ripper, you can easily delete the resource fork from Adobe applications' help files, as shown here. After deleting the resource fork, Adobe's help files will open in your default browser instead of in Internet Explorer.

The Grim Ripper forces you to confirm your actions (unless you downloaded the Extreme version) through a submenu, since resource forks can be critical to a program's correct functioning. In this case, however, the forks aren't needed; they only serve to confuse Mac OS X as to which program should open the .html files.


13.6 Quicken

Quicken is far and away the most popular personal finance tool for the Mac. It's been around for years and was one of the first native Mac OS X applications available. Since it was first released, it's seen a number of updates, but it still retains the familiar look and feel that made it popular in the first place.

13.6.1 Create Customized Keyboard Shortcuts

Although Quicken has plenty of keyboard shortcuts, it might annoy you that it doesn't have one for account reconciliation (Activities [image] Reconcile). Or it might bother you that [image] -L is assigned to Lists [image] Categories & Transfers instead of Lists [image] Loans.

If you're using Quicken 2002 or newer, you can actually do something about your concerns, as these versions of Quicken allow you to create your own keyboard shortcuts easily. To create a new shortcut, or reassign an existing one, hold down the [image] key and pick the menu item you'd like to change. Quicken displays a small dialog box, as shown in Figure 13-10, which you can use to assign the shortcut key.

If you try to use a key that's already assigned, Quicken will inform you that the key is already in use, and ask if you'd like to reassign it. You can even take over "system" shortcuts such as [image] -C for Copy, [image] -V for Paste, and so on. The only thing you can't do is reassign a shortcut that uses more than just the [image] key—you're stuck with Shift- [image] -P to Print Checks, for instance.

Figure 13-10. To create your own keyboard shortcuts—or reassign existing ones—hold down the [image] key prior to selecting the menu option you want to change. In this dialog box, simply type the letter you'd like to assign and click OK.


13.7 SnapzPro X

SnapzPro X is a shareware program (www.ambrosiasw.com) that lets you create great-looking snapshots—or even movies—of your own screen. It significantly improves Mac OS X's built-in screen-grabbing feature (hint Section 4.3.14) by adding a choice of file formats, naming options, on-the-fly previews, and border creation. It's a godsend for anyone who writes about computers, teaches computers, or manages Web sites about computers. Almost all the screenshots in this book, for example, were taken using SnapzPro X.

13.7.1 Saving Screenshots to Any Location

SnapzPro X lets you save your captured screen graphics anywhere you like—as long as it's the desktop, the clipboard, the printer, or your Pictures folder!

But what if you want to save all your images in another location? Here's a fiendishly simple solution.

Create an alias of the desired folder, and drag it to your Home [image] Pictures folder. As Figure 13-11 illustrates, any folder you place in your Pictures folder shows up in SnapzPro X as a location for saving your screenshots—and this trick works for aliases, too.

Figure 13-11. In this figure, browser movies, DVD screens, and screenshots are all aliases in the Home [image] Pictures folder. If you choose one of them during a SnapzPro X capture, the program saves the screenshot in the specified folder.

13.7.2 DVD Screenshots

It's a strange quirk of computer graphics cards: if you try to take a snapshot of a DVD movie you're playing (by pressing Shift- [image] -3, for example), you'll find that...well, you'll find nothing. Much to your chagrin, Mac OS X disables the screen capture keys while the DVD player is running. The solution: just use SnapzPro X (see hint Section 4.3.14) for DVD captures. Now you can capture screens, portions of screens, or (if you've bought the movie-making version) even capture movies of your DVDs playing.

If you don't own SnapzPro X, see hint Section 14.4.2 for another solution that works for many DVDs.

13.7.3 Going Pro

This hint is courtesy of Andrew Welch, author of SnapzPro X. His sage advice will help you create screen captures that look better in print and on the Web.

  • When taking a picture of an entire window, set the clipping border to Small (in the Object Settings window) and use a Fade to White image border. If you're planning to place the image on a Web page with a black background, then use a Fade to Black image border instead.

  • When capturing just a portion of the screen (like a window, text box, or picture), choose Fade to White (or Fade to Black), and then drag the selection box until it's roughly eight pixels wider than the desired capture area.

13.7.4 Smoother "Follow Cursor" Movie Captures

In SnapzPro X's Follow Cursor movie-recording mode, you select a region of the screen to capture. As you move the mouse during the recording, the selection rectangle moves around, keeping the mouse centered within the window at all times. The idea is a compromise, designed to address the fact that a QuickTime movie of your entire screen would produce a file far too monstrous to email.

To create movies in this mode, you need to move the mouse smoothly and evenly across the screen; any jumpiness in your mouse movements translates directly into jumpiness in your finished movie.

But since it's almost impossible to move the mouse perfectly smoothly, you shouldn't move the cursor with the mouse at all. Instead, use the keyboard. Open System Preferences [image] Universal Access [image] Mouse tab. Then turn on Mouse Keys, and set the Initial Delay slider to Short.

Now, once you've started recording a movie, you can move the cursor around the screen by pressing the eight keys that surround the 5 key on your number keypad. For example, press the 9 key to move the cursor diagonally up and to the right. If you hold one of these keys down continuously, the cursor, after a pause, begins to move smoothly in that direction.

The 5 key acts as the clicker—press it once to "click the mouse," twice to double-click, and so on. Press the 0 key to "hold down" the mouse button, and the period key to unlock it.

If your computer doesn't have a number keypad (laptops don't, for example), press the Num Lock key and then use the keys that have a small number in their lower-right corner. These keys let you fake a number keypad on a keyboard that doesn't have one. For example, on a laptop, you'd press Num Lock, then L, then I to move the cursor down and to the right, and then click once.


Chapter 14. Add-Ons Worth Adding

Mac OS X provides a fantastic experience and a huge number of features right out of the box. Perhaps the most exciting aspect of Mac OS X is the fact that it's based on Unix, an operating system familiar to programmers worldwide. At the same time, Mac OS X is still new, with plenty of holes to be plugged and polish to be added. And that's precisely why there's been an explosion of free and shareware add-ons, each designed to further heighten the system's overall usefulness.

This chapter is a bit of a nonconformist in this book. Rather than providing hints, its purpose is just to let you know that these add-ons exist and to show you how they can enhance—or solve problems in—Mac OS X.

Most of the programs fall into one of these categories:

  • Shareware programs. You pay for these on the honor system, after you download them and try them out. If you like what they do, you send a nominal amount (typically in the $10-$30 range) directly to the programmer. In return, you usually get a code that unlocks more features or turns off nagging reminders to pay up.

  • Freeware programs. These are free. Use them with the programmer's compliments.

  • Donationware programs. These are a lot like shareware, except that the amount you owe the programmer is left up to you. Furthermore, donationware products don't disable features until you pay, and they'll rarely if ever nag you to cough up the dough.


14.1 Make Mac OS X Feel Like Mac OS 9

If you come to Mac OS X from an earlier version of the Mac operating system, you may find your initial foray a little disappointing. Old friends like the Application menu, the customizable [image] menu, and window shades are missing, and other features' behaviors have changed. But with the help of third-party software, you can restore, and even enhance, nearly every feature that you miss from your Mac OS 9 days (except, of course, for the constant crashing).

In addition to the hints in this section, check out hint Section 2.1.21 (for printing Finder windows).

14.1.1 The Mac OS 9 Menu

If you were a big fan of the customizable [image] menu in Mac OS 9, you're probably disappointed by Mac OS X's noncustomizable version. Apple apparently hopes the Mac OS X replacement (the Dock) will suffice. However, if it doesn't float your boat, try FruitMenu from Unsanity Software (www.unsanity.com). See Figure 14-1 for the details.

Figure 14-1. Using FruitMenu, you can easily add your own folders and subfolders to the [image] menu. You can also use a number of useful predefined commands, like "Bring all windows to front."

14.1.2 Sound Sets

A sound set, in Mac OS 9, was a collection of sounds that you could attach to various actions. You would hear a little zip when you scrolled, a little scratch when you emptied the Trash, a little whoosh when you collapsed a window, and so on.

Although Mac OS X's Sound preference pane includes a "Play user interface sound effects" button, it's a very crude affair compared to the options offered by Mac OS 9. For instance, Mac OS X doesn't give you any choice of sound themes—only On or Off—and produces just a few meager sound effects (like when you empty the Trash).

Once again, Unsanity (www.unsanity.com) has an offering to plug this hole. Xounds (Figure 14-2) applies sounds to menus, windows, controls, and the Finder, and includes a tool to help you download, convert, and install older Mac OS 9 sound sets from www.soundsetcentral.com.

Figure 14-2. If you like to hear your machine chirp, hiccup, breep, scratch, and click as you go about your work, give Unsanity's Xounds a whirl. It brings back the best of Mac OS 9's sound sets, so you can distract your co-workers as you merrily conduct your business.

14.1.3 Window Shades

In Mac OS X, clicking the yellow globule in the upper-left corner of a window (or pressing [image] -M) minimizes the window into a Dock icon, thereby removing it as an obtrusion. In Mac OS 9, however, you were supposed to manage window clutter by window-shading windows that were in your way. You would double-click a window's title bar, causing the body of the window to collapse upward into the title bar itself.

WindowShade X, yet another Unsanity product (www.unsanity.com), resuscitates this feature in Mac OS X—with a vengeance. In addition to old-fashioned window-shading, you can specify precisely what happens when you click the Minimize button, double-click the title bar, or press [image] -M. For example, you can make windows semitransparent when you click the Minimize button, make windows collapse when you double-click their title bars, and control how shadows are applied (if at all) to your active and shaded windows. Furthermore, you can control all of these settings on a program-by-program basis.

You can even minimize windows "in place," which creates a postage stamp-sized icon from your window and leaves it on your desktop. Once minimized in place, you can drag the window icon anywhere on your screen for safekeeping.

14.1.4 The Application Menu

In Mac OS X, the Dock serves as a list of all of your open programs. In Mac OS 9, however, the Application Menu in the upper-right corner of the screen took care of this function.

If you miss the Mac OS 9 method of program switching, the solution is a freeware program known as X-Assist (http://members.ozemail.com.au/~pli/x-assist). After you launch X-Assist, it returns the program menu to the top right of the screen (Figure 14-3).

Figure 14-3. With X-Assist, you can once again switch programs from the top-right corner of the screen. Don't you feel better now?

14.1.5 Putting that Old Scanner Back to Work

If Mac OS X has a sore spot, it's scanners—an especially painful fact, considering that the Mac's core audience includes artists and graphic designers. The reality is that many scanner manufacturers simply haven't bothered to write Mac OS X drivers for their older scanner models.

Fortunately, you may not even need them. VueScan, a set of shareware scanner drivers (www.hamrick.com), makes it possible for hundreds of older scanners to work with Mac OS X, including those manufactured by UMAX, Nikon, and HP. Even the Apple Color OneScanner is now compatible. For a complete listing, visit the VueScan Web site listed above.

The full version of the software costs $60—somewhat less than a new scanner (a free trial is also available). So if you spent a lot on your scanner and you're pleased with its scan quality, VueScan may be just the ticket for getting it to work with Mac OS X. (On the other hand, if your scanner is old and slow, a new Mac OS X-compatible scanner might make more sense than using VueScan.)

VueScan offers three levels of complexity, letting you customize each scan to your liking. Depending on your scanner, you may have different options for Basic, Intermediate, and Advanced. In Basic mode, you control very few options; in Advanced mode, as shown in Figure 14-4, you can control them all. (Intermediate mode, logically enough, falls somewhere in between.)

Figure 14-4. Only use Advanced mode (shown here) if you truly want to customize all of your scanner's capabilities. If you're satisfied to simply let VueScan make its best guesses, choose Intermediate or Basic mode instead.


14.2 Program Launchers and Switchers

The Dock is Mac OS X's combined program launcher and switcher. It's also a spot for storing often-used documents and folders, as well as minimized windows (Chapter 3). But that's a lot of tasks for one lonely program. Luckily, a number of highly effective third-party launchers and switchers can take some of the strain off your Dock.

Many competent launcher programs exist, including DragThing (Section 13.3), LaunchBar (hint Section 14.2.1), PocketDock (http://www.pocketsw.com/PocketSoftware/pocket_dock.php), Butler (hint Section 14.2.2), QuickSilver (http://blacktree.com/apps/quicksilver/), and DropDrawers (hint Section 14.2.3). Most of these programs are "try before you buy" shareware, so experiment and find one you really like before emptying your pockets.

Once you've found a launcher you're comfortable with, remove all your stored programs from the Dock (except, perhaps, for the new launcher itself), and use the replacement launcher instead. Most launcher programs also provide a keyboard shortcut to bring them forward, which means you can use them from any application.

14.2.1 Keyboard Launching

If you're a keyboard power user, you'll love LaunchBar (www.obdev.at/products/launchbar/index.html) for its sheer economy of effort. This program launcher lets you open any program or document with only a few keystrokes.

Once installed, LaunchBar places an icon in your Dock, and then hides itself until needed. You can open LaunchBar by clicking its icon in the Dock, but of course the whole purpose of the exercise was to avoid using the mouse. Fortunately, you can also press [image] -Space to open its gate.

Once open, LaunchBar drops a data-entry box just below the menu bar and waits for you to start typing the name of the program, document, or Web site you'd like to open, as shown in Figure 14-5.

Figure 14-5. As you type, LaunchBar displays a list of all the programs and documents whose names match what you've typed thus far. This process continues until you select what you're looking for—at which point you press Enter to open the program or document. Here, typing iDD brings up iDVD.

You can teach LaunchBar your own shortcuts, too. For instance, if you want Te to open TextEdit rather than TextEdit Plus, just use the arrow keys to select TextEdit after typing Te. LaunchBar will learn your preference and, in the future, offer TextEdit as the selection after you type Te.

14.2.2 Can a Butler Help You Use Your Computer?

It certainly can help you if it's Butler (www.petermaurer.de/nasi.php?thema=butler&sprache=english&kopf=labor), the productivity assistant for Mac OS X, that you're talking about. Butler isn't a tool for the faint of heart; due to its power, its configuration interface would probably intimidate even Steve Jobs. However, if you spend a bit of time learning its intricacies, you'll find it combines several separate tools into one useful do-it-all application. In a nutshell, Butler is a program that contains the following: a keyboard program launcher, multiple clipboard utility, Internet search tool, customizable Apple menu, application switcher menu, iTunes keyboard controller, customized pop-up menu, and keyboard macro tool.

Amazingly enough, though, the above list is just scratching the surface of Butler's capabilities. For instance, if you use Fast User Switching to toggle among a few users on your machine, you know that you lose some menu bar space for the display of the current user's full name. If your name happens to be Richard Brockenstiltzer Tharnborough III, Esq., it's even worse, as you quickly realize that you don't even have a menu bar any more. Fear not, Richard and other similarly long-named Mac OS X aficionados: Butler makes it possible to recapture that lost menu bar space! As shown in Figure 14-6, you can replace a huge menu bar name with a simple pop-up menu.

Figure 14-6. To reclaim Fast User Switching's wasted menu bar space, start by disabling Fast User Switching in System Preferences [image] Accounts [image] Login Options. Then use Butler to add a new Fast User Switching Smart Item, and assign it a keyboard shortcut (Control- [image] -F, perhaps). Now, when you need to switch accounts, just hit your new keyboard shortcut. When you do, you'll see the handy pop-up menu at left, allowing you to fast user switch without any wasted menu bar real estate.

If you're the ultimate power user and don't mind working through a somewhat complex configuration panel, you may just find that adding a Butler to your Mac is the best productivity improvement out there.

14.2.3 Storing Stuff in Drawers

DropDrawers (www.sigsoftware.com/dropdrawers) is an innovative launcher and storage program that lets you create "drawers" for storing programs—or nearly any other type of data you can envision (Figure 14-7).

In addition to the launcher drawers (which hold programs), drawers can also hold text clippings, sound files, movie files, graphics, and so on. The program even has a special Process drawer that shows all running programs, so it can also function as a program switcher.

What really makes DropDrawers unique, though, is the way that its drawers stay out of the way until you absolutely need them. As Figure 14-7 illustrates, you see only the tab of a drawer until you need to use it.


14.3 Expanding Your Mac OS X Experience

Another set of popular Mac OS X add-on utilities is designed to turn on hidden preferences, change aspects of the Dock's behavior, help you take full advantage of Apple-provided hardware and software, and provide additional information on running programs. Here are a few tools to get you started on the path of happy tweaking.

Figure 14-7. When you mouse over a tab, its drawer slides out from the edge of the screen, revealing the contents. If you don't want the drawer to slide shut again, click its tab to keep it open. You can position drawers on any side of the screen, and they don't have to be right next to one another.

14.3.1 Hidden System Preferences

Want to move your Dock to a corner of the screen instead of having it centered? Want to remove the zooming rectangle effect when a file opens? Want double scroll arrows at both ends of all your scroll bars? Sure, Mac OS X can accommodate these wishes, but that usually entails typing cryptic commands in the Terminal.

TinkerTool, a free program from www.bresink.de/osx/TinkerTool.html, lets you employ a more Mac-like way of doing things. This program runs right from the Finder, giving you direct access to a multitude of settings without ever visiting the Terminal (Figure 14-8).

14.3.2 Display System Information in the Menu Bar

Sometimes, like an industrious co-worker who makes everyone else look like a bunch of Dilberts, your Mac OS X machine is busy working even when you're not. You may hear the hard drive churning, or see a spinning rainbow cursor during a simple Finder operation—but why it's doing these things you have no idea.

In order to decipher what's going on with your Mac, it's useful to know what its various parts are doing at any given time. That's where MenuMeters (www.ragingmenace.com/software/menumeters) comes in. Using up just a bit of space on your menu bar, MenuMeters can tell you everything you'd like to know about your machine in one quick glance (see Figure 14-9).

Figure 14-8. TinkerTool lets you set a number of hidden Mac OS X preferences from the comfort of a graphical interface. The Fonts section, shown here, lets you change many of the standard Mac OS X screen fonts.

Figure 14-9. MenuMeters provides a quick look at your Mac's overall health and activity level. Starting on the left, you can see the network connection's reception and transmission speeds, a pie chart of memory usage, green and red lights for hard drive use, and finally the CPU meters. As shown here, each icon provides greater detail when clicked.

MenuMeters installs a custom preferences pane that you can use to control what types of information are visible in the menu bar, and how that information is displayed. You can choose to display an icon for CPU, Disk, Memory, and Network activity, or any combination of the four. You can also choose from a number of display styles for each icon (CPU usage as a graph or percentage, for example), as well as modify the update frequency and color schemes.

When you click any of the icons, you'll see more detailed information about that particular area, as shown in Figure 14-9. You may not need or want all four categories to be displayed all the time, but even adding the simple CPU usage meter will give you a quick display of your machine's current state of activity.

14.3.3 Optimize AirPort Connections

Those of you with an AirPort card have, on occasion, probably cursed the general inaccuracy of the AirPort menulet's (Section 1.4) signal strength display. With only a four-level indicator in the menu bar, it's hard to tell whether you're getting a better signal sitting in your kitchen or living room, for example.

There are two ways to secure more information on your signal strength. The first method is to open Internet Connect (in the Applications folder) and click AirPort. Assuming you're currently connected to a base station, you'll see signal strength across some portion of the 15-point connection level. While this display is better than the one in the menu bar, it's still hard to interpret, and it doesn't help you measure changes in signal strength over time (as you move about the house, for example).

The superior solution is to download and install the freeware AP Grapher (www.chimoosoft.com/apgrapher.html). As depicted in Figure 14-10, AP Grapher is a very simple program: all it does is show you the strength of your connection in a constantly moving graph.

Figure 14-10. Using AP Grapher, you can see exactly how strong the connection to your AirPort base station is. Sometimes increasing the signal strength can be as simple as slightly twisting your laptop. By watching the graph in AP Grapher, you can see exactly which locations and orientations lead to the best connections.

There aren't many options in this program; you can graph four different variables (only two on AirPort Extreme-equipped machines), and change the speed of updates and the colors of the graph's lines—but that's it. Although it may not be the most powerful program in the world, it could be invaluable in your efforts to find the best signal.

14.3.4 The Silence of the Dock

As you're probably aware by now, Dock icons bounce up and down excitedly whenever you're opening a program, as though to demonstrate their delight at being chosen. If you find this animation a bit much, you can turn it off in the Dock pane of System Preferences.

Much to your chagrin, however, you may soon discover that you've only stifled these Mexican jumping-beans when applications open. When a background program wants your attention—when the printer jams, when your email program has new mail for you, or when your browser in the background has reported an error, for example—it still tries to alert you with a jumping Dock icon.

Luckily, the free program Dock Detox (www.unsanity.com/haxies/dockdetox) concentrates on only one thing: preventing Dock icons from bouncing.

The downside of Dock Detox is that if a program really needs you to do something like dismiss a dialog box or respond to an error message, you won't know about it until you switch to that program.

14.3.5 Improving Open and Save Dialog Boxes

Default Folder X (www.stclairsoft.com) offers power user features that enhance the Open and Save dialog boxes. For example, it lets you assign keyboard shortcuts for your often-used folders, execute common commands like Move and Rename right in the dialog box, specify which folder the Open or Save dialog box presents first, add and remove documents from your Favorites, and much more (Figure 14-11).

Figure 14-11. Default Folder X's five icons handle tasks like moving, renaming, and creating folders; jumping to a mounted drive on your system; jumping to a predefined Favorites folder; browsing recently used folders; and (as shown here) saving an often-used folder as a favorite.

14.3.6 Hasten the File Renaming Process

Although renaming files and folders isn't the most exciting task you can perform with Mac OS X, it's sometimes necessary. Most of the time, you need to rename only a file or two, so the process isn't especially complicated. But when you have a batch of 50 or 60 files that you want to modify, hand-editing their names can take longer than curing ham.

If you know Unix, you can perform this sort of magic in Terminal. For mere mortals, however, a more Mac-like solution is A Better Finder Rename (downloadable at www.publicspace.net), or ABFR for short.

Once you've installed it, a new menu item called Better Finder Rename appears in the shortcut menu whenever you Control-click icons in the Finder. This command opens ABFR, which offers an array of choices for renaming files and folders (Figure 14-12).

Figure 14-12. In the Change and Action pop-ups, you can specify whether the actions you create should affect the entire file name, just the beginning, or just the end; whether you want numbers added to or removed from the names; whether the change should apply to files, folders, or both; and so on. Once you've specified your renaming criteria, you can save the setup as a Droplet—a desktop icon that memorizes the canned settings you've established. The right-side pane shows a live preview of your changes before you commit to making them permanent.

Next, you need to specify what to change in the selected files' names. As Figure 14-12 shows, the dialog box offers a variety of options, including time and date stamps, replacing all or parts of a file name, and replacing names based on certain criteria.

14.3.7 Access Application Menus Anywhere Onscreen

If you enjoy the benefits of one of the new supersized LCD or CRT monitors, you probably feel like your mouse hand runs a marathon every day—moving from the lower-right corner of the screen to the menus in the top left is a serious trek. It's even worse if you have two monitors, since the File menu can feel like it's a world away when it's on a different screen. As an alternative, you can, of course, use keyboard shortcuts, but not every command has a shortcut. You can also use Full Keyboard Access (in the Universal Access preferences panel) to activate and select menu items using only the keyboard, but that's still a pretty slow solution.

DejaMenu (http://homepage.mac.com/khsu/DejaMenu/DejaMenu.html) a freeware background program, is the perfect remedy for this problem. DejaMenu's bread and butter is displaying an application's menu as a pop-up menu at the cursor location. It performs this feat as soon as you press its activation keys (Figure 14-13).

Figure 14-13. Activated with an assignable keyboard combination, DejaMenu displays the current program's main menu at the mouse location. In this case, the image is being resized in Photoshop Elements—without requiring a trip to the menu bar or memorization of some obscure keyboard shortcut.

Keep in mind that DejaMenu is an application, not some low-level system extension that might cause stability issues. Double-click it to use it; double-click it again and select Quit DejaMenu to exit the program (it runs without a Dock icon or menu bar). All you need to do is assign it your preferred keyboard shortcut, and you're ready to go: DejaMenu is instantly active in all programs (well, at least Carbon and Cocoa ones; it doesn't work so well with Java programs).

If you have a multibutton mouse with programmable buttons, you can make DejaMenu even easier to use. Just open your mouse's customization tool, and assign the DejaMenu keyboard shortcut to one of your buttons. Now, when you click that button, the active application's main menu appears directly under your mouse, ready for your perusal.

14.3.8 Customized Pop-Up Menus

MaxMenus (www.proteron.com/maxmenus) places a small semitransparent circle in each corner of your screen which, when clicked, produces a pop-up menu. The top-left circle displays your recently used programs and the contents of your Applications folder; the top-right corner pops up a list of your active programs, drives, and desktop icons. The bottom left-hand corner displays the contents of your Documents folder and any recently used documents, and the bottom right-hand corner displays the contents of your Favorites folder. Considering that pressing Shift, Option, [image], and/or Control changes the contents of a menu, you actually have dozens of possible menus at your mouse tip.

If these tricks were all that MaxMenus did, it'd be a very useful accessory. But its real power user features lie in its System Preferences pane, where you can either modify the existing menu contents or create your own menus from scratch (Figure 14-14).

Figure 14-14. Top: Here, you're creating a very simple menu by dragging the Mounted Volumes option from the right-side pane to the left-side pane. Once created, the menu will pop up when you press Shift-Control-Option-W to list all your drives directly under the cursor.

By assigning a hot key, you can make your custom menu accessible from anywhere on the screen.

MaxMenus lets you drag files, folders, and programs from the Finder to create your menus. For example, if you're writing a book and want fast access to any chapter, you can create a Control-B menu, and then drag the Word documents that make up each chapter into it. Or you could create a fast-launch menu for your Web browsers by placing each of them into a Control-W customized menu.

MaxMenus has a lot of features, and therefore the learning curve can be steep. Still, it comes with an excellent manual, and it's well worth mastering for all the time it can save.

14.3.9 Replacing the Finder

Path Finder (www.cocoatech.com) is a Finder replacement. It's a Cocoa program with a number of features you won't find in the standard Mac OS X Finder (which is actually a Carbon application): full control over font families, colors, and sizes; window transparency; a preview drawer; a sortable column view mode; and a full selection of shortcut menu options, as shown in Figure 14-15.

Figure 14-15. Path Finder is a Cocoa-based replacement for the Finder, with an array of useful features. It includes the full complement of normal Finder features, including spring-loaded folders, three views, a customizable toolbar, server connections, and plenty of shortcut menu options. As shown here, you can even combine list and column view features (notice the expanded Artwork folder). Since Path Finder is just another Mac OS X program, you can also use it while the Finder is running.

If your love of Path Finder is deep, you can actually use it to replace the standard Mac OS X Finder completely. To do that, start by opening Terminal (Section P.3.5.3). Assuming you've put Path Finder into your Applications folder, the necessary command is as follows:

defaults write com.apple.loginwindow Finder /Applications/Path\ Finder.app

After entering the command, press Enter, quit Terminal, log out, and then back in again. You'll find yourself in the Path Finder world rather than the standard Finder.

Should you ever wish to return to Apple's own Finder, just open Terminal and type this:

defaults delete com.apple.loginwindow Finder

After you log out and log in again, the original Finder is back in action.

Even if you've set Path Finder to open instead of Apple's Finder, certain programs may automatically relaunch the original Finder. If that behavior grates on your nerves, consider adding a Quit menu item to the Finder (hint Section 2.1.19).

14.3.10 More than One Clipboard

If you've spent more than about 10 minutes using a Mac, you're probably familiar with the Clipboard shuffle. This dance occurs when you copy and paste more than one piece of information between two programs.

For example, suppose you want to copy several different sections of a Web page to your word processor. You start in the browser, copy a paragraph, switch to the word processor, paste, return to the browser, copy the next section, return to the word processor, paste, and repeat until you've got everything you want. The reason you must endure this dizzying process, of course, is that Mac OS X has only one clipboard for storing copied items, and the Scrapbook from Mac OS X has vanished in a poof of upgrade smoke.

There are a number of worthwhile programs available that will end this shuffle, including Butler (discussed in hint Section 14.2.2). However, if you're looking for a program that's focused solely on multiple clipboard support, consider CopyPaste-X ($30, www.scriptsoftware.com/copypaste), Clipz ($11.95, www.citrussoftware.com/clipz.php), or Scrapper ($10.00, http://www.imediasw.com/scrapper.php).

Each of these programs has a somewhat different feature set, but they're all shareware, so you can test them all before you buy one. Each allows you to have multiple items stored on a clipboard for easy future use. Some even offer multiple unique clipboards, so you could store a collection of images of your sporty new Winnebago in one clipboard, and a bunch of tidbits from Web pages in another, for example.

In the future, instead of flipping back and forth when you need to copy and paste multiple selections, opt for the path of least resistance: just use one of these apps to copy them all, then switch to your destination program and paste them all in one step.


14.4 Other Programs

As you gain experience with Mac OS X, you may find other things you wish to do that can't be handled by the Apple programs and utilities. For example, you may want a simpler way to copy your existing Mac OS X installation to a new hard drive, or you may want to run a more powerful FTP server. The following programs can solve these problems—and many more.

14.4.1 Creating a Bootable Backup

Everyone agrees that backing up your work is massively important, and yet many people find it too difficult or time-consuming to do regularly. However, if you have an external hard drive (or a spare partition on your main one), Carbon Copy Cloner (CCC) can take care of the difficult part (www.bombich.com/software/ccc.html). This program copies your entire hard drive onto another disk, thereby creating an exact mirror image. As Figure 14-16 illustrates, CCC has a very simple interface.

Figure 14-16. Specify the existing copy of Mac OS X in the Source Disk box and identify the destination disk in the Target Disk box. Click the small lock icon and enter your admin password, then click Clone. CCC is now off to the races. Soon you'll have an exact duplicate of your existing drive.

CCC can even keep two disks synchronized (which means that adding a file to your main hard drive automatically adds it in the same place on your backup drive). CCC does this with a Unix tool called psync and offers a scheduling tool to make sure it gets done regularly.

14.4.2 Free DVD Screen Grabs

For all you Tarantino-wannabes, hint Section 13.7.2 explains how you can capture DVD movie screenshots using the shareware SnapzPro X. On the downside, if you're a college student on a budget, SnapzPro X can be a big hit to the pocketbook. There is, however, a freeware workaround that works for most DVDs.

The VLC media player (www.videolan.org/vlc/) is a program that can easily display MPEG files, like the video from a playing DVD—and doesn't come with the restrictions of Apple's DVD player.

To take a screenshot of a DVD, quit DVD Player if it launched when you inserted your DVD. Next, open VLC, and choose File [image] Open Disc, which opens a dialog box displaying the DVD. (The Media Resource Locator might look somewhat odd, like dvdplay:///dev/rdisk4, but really, that's your DVD drive.) When you click OK, the movie begins playing. Use the controller to fast-forward to the section of the movie you want to capture, click Pause, and then use any of the standard screen capture tools (see hint Section 4.3.14 or Section 13.7.2) to take your screenshot. The result is exactly what you'd expect: a screenshot of the frame you selected.

VLC may not be able to play every disc in your collection. Should you run into a DVD that you can't play in VLC, you'll have to rely on hint Section 13.7.2, and use SnapzPro X and Apple's DVD Player to grab a screenshot.

14.4.3 Installing Individual Programs from the Mac OS X Discs

Ouch. You accidentally erased your copy of Mail, and you need it back—desperately. If you look through your machine's software discs, you'll discover they include no disc for Mail. To rub salt in your wound, it's also not available for download from Apple's Web site. The only obvious solution is to reinstall Mac OS X in its entirety—and that's less appealing than root canal surgery.

Luckily, CharlesSoft (www.charlessoft.com) has developed a program called Pacifist to handle precisely this problem. As it turns out, the Mac OS X CDs are, behind the scenes, composed of many individual installers called packages. Pacifist lets you browse the Mac OS X packages to extract individual pieces as you need them. Figure 14-17 lays it all out.

14.4.4 Installing a Full-Featured FTP Server

If you have a full-time Internet connection—a cable modem or DSL, for example—one click of the Sharing pane of System Preferences can turn your Mac into an FTP server (a software-download site on the Internet). Unfortunately, this built-in feature is fairly limited: only people with accounts on your computer can connect, and without advanced Unix knowledge, it's not easy to permit anonymous connections.

Figure 14-17. To restore the Mail program, first insert the Mac OS X Install Disc 1, and then launch Pacifist. From the main window, choose Open Mac OS X Install Packages, follow the onscreen instructions, and swap your install discs when prompted. After a few minutes of processing, Pacifist opens a window displaying the full set of Mac OS X installation packages. Click the expansion triangles next to Contents of EssentialSystem-Software.mpkg, then Contents of Essentials.pkg, and finally Applications. Now scroll down and select Mail.app. If you choose Install, Pacifist installs the package in its standard location; Extract To lets you specify any folder location you prefer.

The solution: CrushFTP (www.crushftp.com), a full-featured FTP server that lets you configure and manage your server and capitalize on a huge constellation of settings and features for connecting accounts. Figure 14-18 shows one example.

CrushFTP isn't a beginner's FTP tool. If you misconfigure the settings, you might find that your machine is open to intruders from the Internet, which could either be a minor annoyance or a major disaster. If you have a modicum of experience with FTP servers, however, CrushFTP gives you the power of command line variants with a much simpler interface.

Figure 14-18. CrushFTP lets you set maximum login and idle times, download speed restrictions, download-to-upload ratios, expiration dates for accounts, and much more. All of these settings are available for each account you create. Furthermore, CrushFTP account names and passwords don't exist in Mac OS X itself, only in CrushFTP. That's a tremendous advantage over Apple's FTP server, which requires that every person who connects by name have a Mac OS X account.

14.4.5 Teach Your Laptop's Trackpad New Tricks

As Apple doggedly sticks to its theory that anything more than one button on a mouse is too many, the rest of the world has moved on. PC fans—and enlightened Mac devotees—are now using electronic mice with three, four, five, or more buttons, all in the name of increased productivity.

But what's a laptop user to do? You can't very easily replace Apple's built-in one-button trackpad. And carrying an external mouse is a hassle, especially if you've ever tried to use one on an airplane's miniscule tray. If you install SideTrack (www.ragingmenace.com/software/sidetrack), though, you can add a tremendous number of features to the existing trackpad. SideTrack installs a custom preference pane, as seen in Figure 14-19, that looks like Apple's standard Trackpad panel—with a bunch of cool extras.

Using SideTrack, you can easily turn your one-trick trackpad into the functional equivalent of a multibutton scrolling mouse: tap the pad for a "right click," and use the edges of the trackpad as a fingertip scroll wheel.

SideTrack works by installing a new trackpad driver for your machine. This, by necessity, works at a very low level in the OS, and therefore could potentially cause a serious crash. If you experience any issues with SideTrack, removal is very simple—just rerun the installer and select the Uninstall option. After a restart, your trackpad will be back to its stock condition.

Figure 14-19. Using SideTrack, you can give your laptop's trackpad a host of new powers, including the ability to emulate a Control-click (right-click) with a simple tap of the pad. You can also set aside edges of the trackpad to use for vertical and horizontal scrolling. And get this: You can even set each of the four corners of the trackpad to respond to taps in different ways (mouse clicks, keystrokes, and so on).

14.4.6 Professional Charts

Although it's more a presentation tool than a charting tool, many people use PowerPoint to create charts. To be honest, though, OmniGraffle (www.omnigroup.com) is a much better choice for organization charts, network diagrams, and floor plans.

The program's main work area resembles a sheet of graph paper (and as a result, may induce an evil trigonometry flashback or two). Off to the side is a Palettes window that stores premade shapes for easy use in your chart. Figure 14-20 shows the main work area along with the Network palette.

OmniGraffle comes with a slew of object palettes. You can also download additional palettes from the company's Web site.

A dozen different Inspector windows control every aspect of your chart, including object size, shape, style, alignment, shadow, and color. OmniGraffle also includes features for layers, transparencies, lines, and multipage layouts, to make your charts look as professional as possible.

Figure 14-20. OmniGraffle's palettes let you place premade, resizable, professional-grade images in your charts. The program includes about 10 unique object palettes, including Boolean gates, flow-chart symbols, networking symbols, computer images (shown here), and equipment racks. You can download additional palettes from the Web too, or create your own.

14.4.7 Mighty Morphing

Morphing is a special effect in which one face or object magically transforms itself into another. You've seen it a million times—it's how, for example, the cat in Harry Potter and the Sorcerer's Stone visibly transforms into Professor McGonagall.

Morphing is a colorful and effective way to demonstrate the progression of a project from "before" to "after"; think home remodeling, painting your car, changing from Peter Parker into Spider-man, and so on. You probably don't need morphing software every day, but if you ever do, you'll be glad to know a freeware program exists that'll create the intermediate images.

MorphX (www.norrkross.com) is very simple to use, despite the seriously complex math it uses to make your images (see Figure 14-21).

When you're ready to create the morphed images, choose File [image] Save Morph Movie. A dialog box appears, asking questions about the image size, number of frames you'd like to generate, and the playback rate (in frames per second). If you want a two-second morph that plays at 20 frames per second, you need to create 40 frames (20 frames times two seconds). The more frames you create, the longer the morph-creation process takes.

Once you've set your options, click Save, and then wait. Morphing calculations are very complicated, and if you've asked for a lot of large images, the calculation process can literally take hours. The resulting imagery can be well worth it, however, especially as you watch Aunt Ruth morph into Uncle Gary.

Figure 14-21. As you outline an area in the left-side image, the program automatically adds the same lines to the right-side image. Once you've outlined a region in the "before" image, adjust the lines as necessary to outline the same region in the "after" image. Outline a few major areas of the image, lining up the "before" and "after" sections as closely as possible.

14.4.8 Mouse Gestures

A mouse gesture is an action that's triggered by a specific movement of the mouse, usually in combination with dragging and/or a modifier key. For example, an up-down-up drag motion could open a new window, save a file, or scroll a window. For some people, mouse gestures feel more natural than choosing commands from menus or memorizing obscure keyboard shortcuts.

Cocoa Gestures (www.bitart.com/CocoaGestures.html) is a program that lets you add mouse gestures to any Cocoa program, including Mail, Camino, TextEdit, and so on.

Once you've downloaded Cocoa Gestures, drag the Input Managers folder to your Home [image] Library folder (or to your hard drive's Library folder, if you want everyone who uses your Mac to have access to the program). From that point on, any newly launched Cocoa program will have a Cocoa Gestures command in its program menu, usually just below Preferences. When you open Cocoa Gestures, the panel shown in Figure 14-22 appears.

Gestures start out turned off in every program, so your first step should be to turn on "Enable mouse gestures in this program" (Figure 14-22). "Make mouse gesture with" lets you define which combination of mouse buttons and modifier keys create the gestures. You can even specify no mouse button by choosing the "Modifier only" setting from the pop-up menu.

If you love the freeware Cocoa Gestures, consider springing for the $30 CocoaSuite, which adds a ton of new features, such as a virtual "jog dial" (like the iPod's). There's even a free 30-day trial, so you can try it out to see if it's worth the extra cash over its free counterpart.

Figure 14-22. The Cocoa Gestures panel lets you turn mouse gestures on and off on a program-by-program basis, and lets you define keyboard modifiers for the gestures. And for the cherry on top, you can even create your own gestures to boot. When you execute a gesture, the standard arrow cursor changes to an orange G, as shown in the upper-right corner.


14.5 Explore the Possibilities

Although plenty of problem-solving programs are described in this chapter, the universe of programs is vast. Mac OS X is a young operating system, and new software is introduced for it every day. The best way to keep up with the latest and greatest is to visit regularly one of the software tracking sites (www.versiontracker.com, www.macupdate.com, or www.macshareware.net, for example) and see if there are any interesting new releases. If you install a program you don't like, you can always delete it.

A final note: if you wind up using any shareware programs, be a good doobie and pay the authors the requested fee for their efforts. Doing so will inspire those programmers to create even cooler stuff for you—and millions of others!


Chapter 15. Useful Unix Hints

For some, the Unix engine at the heart of Mac OS X may seem completely foreign, intimidating, and even unnecessary. To this end, you're forgiven if the presence, in this day and age, of a command line—a system of controlling the Mac by typing cryptic commands instead of using menus—strikes you as a blast from the DOS-ridden past.

And you'd have good company. The vast majority of Mac OS X fans live long, happy lives without ever touching Terminal or even realizing that the Mac OS X sports car rides on Unix, a venerable, highly polished, 30-year-old chassis.

But an extremely important minority lives, eats, and sleeps in Terminal. This program is where the more advanced crowd of major-league geeks compiles open-source programs, connects to remote computers, and performs magic with strings of commands like grep, sed, and awk.

These people enjoy a world of power and control usually enjoyed only by dictators and Hollywood stars. They're the people who, admiring the handsome plumbing of Mac OS X, are writing cool new programs for it, introducing it to corporations, and getting their own work done much faster.

This chapter and the next are dedicated to helping you maximize the many benefits of Terminal (which awaits in your Applications [image] Utilities folder). Some of the tricks are simple enough for anybody; others require some experience in Unix. All of them, however, involve Terminal.


15.1 Unix Basics

The first time you see it, you'd swear that Unix had nothing in common with the traditional Mac OS (Figure 15-1).

Figure 15-1. Top: What most people think of when they think "Macintosh" is a graphic interface—one that you control with a mouse, using menus and icons to represent files and commands.

What the illustration at the bottom of Figure 15-1 shows, of course, is a command line interface, a place where you can type out instructions to the computer itself. This is a world without icons, menus, or dialog boxes. Even the mouse is almost useless.

When you open Terminal, you'll notice that there's not much in its window except the date and time of your last login, a welcome message, and the command line prompt (Figure 15-2). It breaks down like this:

  • tiniscule: This is the name of your Mac (at least, the Unix name of your Mac).

  • ~ The next part of the prompt indicates what folder you're "in" (Figure 15-2). It denotes the current working directory—that is, the current folder. (Remember, there are no icons in Unix.) In other words, this notation tells you where you are as you navigate your machine.

  • The very first time you try out Terminal, the working directory is set to the symbol ~, which is shorthand for "your Home folder." It's what you see the first time you start up Terminal, although you'll soon be seeing the names of other folders here (/Users or /System/Library, for example). The slashes reveal the progression of folders-within-folders, much as the [image] notation has in the rest of this book.

"Directory" is Unix-ese for "folder."

Figure 15-2. On the Web, Mac OS X's Terminal is one of the most often discussed elements of Mac OS X. Dozens of step-by-step tutorials for performing certain tasks circulate online, usually without much annotation as to why you're typing what you're typing. It works on a call-and-response system. You type a command (often pertaining to the files in the working directory), and press Enter; Terminal either performs something or types something back to you.

UP TO SPEED Of Terminal and Shells

One Unix program runs automatically when you open a Terminal window: bash, or the Bourne Again Shell. This is a change from previous versions of Mac OS X, which used the tcsh shell by default.

Technically, a shell is a Unix program that interprets the commands you've typed, passes them to the kernel (the operating system's brain), and then displays the kernel's response.

Speaking more practically, the shell is the Unix equivalent of the Finder. It's the program that lets you navigate the contents of your hard drive, see what's inside certain folders, launch programs and documents, and so on.

The bash shell has one of the most extensive manuals of all time. If you type man bash, the program produces more than 100 pages, covering topics such as basic interaction,

customization, date and time formats, and programming. Reading these manual pages will help you understand many elements of the Unix operating system.

There are actually several more shells available in Unix, each with slightly different command syntax. A few others (like tcsh, which was the default shell under Mac OS X before Panther; sh, the Bourne shell; zsh; and csh) come with Mac OS X. Read the man pages for each shell to determine which one you might like to use, and see hint Section 16.5.13 for instructions on how to change from bash to one of the others.

You can open additional Terminal windows by choosing File [image] New Shell. Each window runs independently of the others. For proof, try opening several windows and then running the cal command in each.

  • robg% This part of the prompt begins with your short user name. It reflects whoever's logged into the shell, which is usually whoever's logged into the Mac at the moment. As for the % sign (it may be a $ sign on your machine): it's a prompt, the Mac's way of saying, "OK, I'm ready. Tell me what to do."

This isn't a book about Unix, though. A gentle, two-chapter introduction appears in Mac OS X: The Missing Manual, and a full-length exploration of Terminal appears in O'Reilly's Learning Unix for Mac OS X. For a basic understanding, though, here's the absolute minimum you need to get by:

  • Unless you've fiddled with Terminal's preferences, the insertion point looks like a tall rectangle at the end of the command line. It trots along to the right as you type.

  • The ritual: type a command at the $ (or %) prompt—capitalization matters—and then press Enter. Terminal does what you asked and then shows another prompt.

  • You can't see any icons for your files and folders, so you're supposed to work with them by asking Unix to tell you what folder you're looking at (using the pwd command), what's in the folder (using the ls command), and what folder you want to switch to (using the cd command).

  • For example, if you type pwd and press Enter, Terminal may show you something like this:

/Users/kirk/

  • Terminal is revealing the working directory's path—the progression of folders-within-folders, separated by slashes, that specifies a folder's location on your hard drive. /Users/kirk/ pinpoints Kirk's Home folder, for example.

  • If you now type ls (for list) and then press Enter, Terminal responds by showing you the names of the files and folders inside, in a horizontal list like this:

Desktop Documents Library Movies Music Pictures Public Sites

  • In other words, you see a list of the file that, in the Finder, you'd see as icons in your Home folder.

  • To make Terminal "think about" a different folder, type the cd (for change directory) command, like this: cd /Users/kirk/Pictures.

  • As you can tell by the cd and ls examples, Unix commands are very short. They're often just two-letter commands, and an impressive number of those use alternate hands (l-s, c-p, r-m, and so on).

  • The reason has partly to do with conserving the limited memory of early computers and partly to do with efficiency, since most programmers would just as soon type as little as possible to get things done. Sure, user-friendly it ain't, but as you type these commands repeatedly over the months, you'll eventually be grateful for the keystroke savings.

15.1.1 The Lowdown on the Mac OS X Filesystem

Did you ever wonder exactly what bin, var, and tmp mean, or cogitate on the difference between bin and sbin? If you look at the lowest level of your hard disk, you'll find lots of cryptic folders with names like these.

There's a simple way to learn what these directories do and what kinds of files they're meant to hold, though. Just type man hier, and you'll see a page explaining the basics of the filesystem:

NAME

     hier - layout of filesystems

DESCRIPTION

     A sketch of the filesystem hierarchy.

     /             root directory of the filesystem

     /bin/         user utilities fundamental to both single-user

                   and multi-user environments

     /dev/         block and character device files

     /etc/         system configuration files and scripts

While this help file is not totally up to date, most of the basics don't change: The main directories, such as bin, dev, etc, and var are exactly the same as described. You will find some subdirectories that Mac OS X doesn't use, but don't worry about them; the point of this exercise is to feel more comfortable when navigating your filesystem, not to have a full catalog of every file.


15.2 Terminal Shortcuts

The hints in this first batch are so safe and easy, you'll wonder why anyone ever used "Terminal" and "intimidating" in the same sentence.

Many of the hints in this chapter work only if your Mac OS X installation includes the software chunk known as the BSD Subsystem. The only reason you wouldn't have that is if you explicitly turned its checkbox off when you installed Mac OS X.

15.2.1 Say Hello to Your New Shell: bash

In Panther, Apple changed how you approach the Unix part of the system. Previous versions of Mac OS X used the tcsh shell as the default shell (Sidebar 15.1); this was the shell that opened in Terminal the first time you launched it. With Panther, Apple changed to the bash shell.

Many Mac OS X veterans had become familiar with tcsh, and didn't necessarily want things to change. Fortunately for them, if they upgraded a previous version of Mac OS X to Panther, they didn't see a difference: Terminal still used the shell they had before. However, when you create a new account under Panther, or if you perform a clean install, Mac OS X automatically sets bash as your default shell.

Unless specified, all the hints in this and the following chapter assume that you're using bash. If you are still using tcsh, or another shell, most of them will work just fine. However, you'll need to use different configuration files for any hints that tell you to change settings, aliases, or variables.

If you need to know which files to edit, just type man shell (where shell is the name of your shell—bash, zsh, and so on) and look for information in the help page about which files are used for settings.

Unless you're a Unix pro, though, it's probably easier to just use the bash shell for all the hints in these two chapters; that way, there won't be any confusion about which files to edit. See the next hint for instruction on changing shells.

15.2.2 Change Your Shell in Panther

Let's say you've come to terms with the bash shell, the default in Panther, but you're pining for the old days when you used tcsh. Or maybe you'd like to switch to bash, so you can follow all the hints in this book more easily. No matter what your reason, the chsh command, available in Panther, lets you change shells without having to muddle through the confusing NetInfo Manager program.

Just run the command like this to change your default shell:

chsh -s /bin/bash username

Replace bash with the name of the shell you want to use from now on, and replace username with the person whose shell you'd like to change. If you replace username with someone else's account, though, you must use the sudo command (Sidebar 15.5).

For more on the benefits and disadvantages of different shells, check out www.softlab.ece.ntua.gr/facilities/documentation/unix/shelldiff.html.

15.2.3 Specify a Path by Dragging

Instead of using the geeky cd command to tell Terminal what folder you want to work with, try this: drag the icon of your desired folder directly into the Terminal window. Figure 15-3 shows how.

Figure 15-3. This may be the quickest way of all to identify a folder or file you want to manipulate: don't type anything at all. Instead, when you drag icons directly from the desktop into a Terminal window, the icon's pathname appears automatically at the insertion point. Terminal even adds backslashes to any special characters in these pathnames for you (a necessary step known as escaping).

15.2.4 When to Use the Mouse

The mouse isn't very useful at the command line. You generally move the cursor with the left and right arrow keys. You can use the mouse, however, to select text from anywhere in the window (or another program) and paste it in at the prompt.

Furthermore, you can use the mouse to position the insertion point. You'll find this to be an enormous convenience when you make a typo in the middle of a long line and realize that you would have otherwise had to use the arrow keys to return to it.

To use the mouse to position the insertion point, start by choosing Terminal [image] Window Settings to open the Terminal Inspector. From the pop-up menu at the top, select Emulation. Turn on "Option click to position cursor" and close the Inspector.

Unless you click "Use Settings as Defaults" in the Inspector, this preference will be lost the next time you open a new Terminal window.

Now, you can Option-click inside any command to plant the insertion point there.

15.2.5 Tab Completion

If you're a power user, you already know you can highlight an icon in a Finder window by typing the first few characters of its name. Terminal's tab-completion feature works much the same way; likewise, it can also save you miles of finger movement.

This feature kicks in whenever you're about to type a pathname. Start by typing the first letter or two of the path you want, and then press Tab; Terminal instantly fleshes out the rest of the directory's name. As shown in Figure 15-4, you can repeat this process to specify the path's next directory-name chunk.

Some tips for tab completion:

  • Capitalization counts. If you're in the lowest level of your hard drive and type s and then Tab, the shell will complete it to your sbin folder. On the other hand, if you're in the lowest level of your hard drive and type S and tab, the shell will complete it to your System folder. (See hint Section 16.1.6 for how to disable this case-sensitivity.)

  • Terminal will add backslashes automatically if your directory names include spaces, $ signs, or other special characters that require backslashes. Bear in mind that you still must insert your own backslashes if there are any irregular characters in the "hint" characters that tip off tab completion.

  • If Terminal can't find a match for what you typed, it beeps.

  • If it finds several files or directories that match what you typed, Terminal beeps and then shows you a list of them. (You may have to press Tab again to convince the choices to appear.) To specify the one you want, type the next letter or two and press Tab again.

Figure 15-4. Top: Type cd /U and then press Tab.

15.2.6 The History

You may find yourself at some point needing to run a previously entered command, but dreading the prospect of re-entering the entire 103-letter monstrosity. Retyping it, however, is never necessary. Terminal (or, rather, the shell it's running; see Sidebar 15.1) remembers the last 500 commands you entered. At any prompt, instead of typing a command, just press the up or down arrow keys to walk through the various commands in the shell's memory. For your convenience, they flicker by, one at a time, much like using the back and forward commands in a Web browser.

15.2.7 Kill Your Command History

The bash shell stores a record of the commands you've run in Terminal (see the previous hint). However, you may want to delete this history because you want a clean record or because you've got so many duplicate commands that it's easier to start from scratch. To delete your history, just delete the .bash_history file located inside your Home folder by using the Terminal command rm -i ~/.bash_history.

15.2.8 Wildcards

Wildcards are special characters that represent other characters—consequently, they're huge timesavers.

The most common wildcard is the asterisk (*), which means "any text can go here." For example, to list the files in the current directory that end with the letters te, you could type ls *te. Terminal would show you files named Latte, BudLite, Dynomite, and so on, but hide all other files in the list.

Likewise, to see which files begin with "Old," you could type ls Old* and press Enter. If you add the asterisk before and after the search phrase, you'd find items with that phrase anywhere in their names. Typing ls *jo*, for example, will show you the files named Johnson, Mojo, Major Project.doc, and so on.

15.2.9 Directory Switching

A hyphen (-) after the cd command means, "take me back to the previous working directory." For example, if you changed your current directory from ~/Movies/EngagementParty to ~/Documents/Letters, simply enter cd - to change back to ~/Movies/EngagementParty. Use cd - a second time to return to ~/Documents/Letters. (Note the space between cd and the hyphen.)

If you're constantly switching between directories, it'd probably be easier just to open and switch between two Terminal windows, each with a different working directory.

15.2.10 Special Keys

The bash shell (Sidebar 15.1) offers dozens of special keystroke shortcuts for navigation. You may recognize many of them as useful undocumented shortcuts (see Table 15-1) that work in any Cocoa application (see Sidebar 4.2).

Table 15-1. Undocumented keyboard shortcuts in bash

Keystroke

Effect

Ctrl-U

Erases the entire command you're working on.

Ctrl-A

Moves the insertion point to the beginning of the line.

Ctrl-E

Moves the insertion point to the end of the line.

Ctrl-T

Transposes the previous two characters.

Esc-F

Moves the insertion point to the beginning of the next word.

Esc-B

Moves the insertion point to the beginning of the previous word.

Esc-Delete

Erases the previous word. You have to press and release the Esc key and then the Delete key; repeat for each word.

Esc-D

Erases the word following the insertion point.

Esc-C

Capitalizes the word following the insertion point.

Esc-U

Changes the next word to all uppercase letters.

Esc-L

Changes the next word to all lowercase letters.

To see all of the available key combinations, type bind -P, which generates a list something like this:

abort can be found on "\C-g", "\C-x\C-g", "\M-\C-g".

accept-line can be found on "\C-j", "\C-m".

alias-expand-line is not bound to any keys

arrow-key-prefix is not bound to any keys

backward-byte is not bound to any keys

backward-char can be found on "\C-b", "\M-[D".

backward-delete-char can be found on "\C-h", "\C-?".

... ... ...

\C denotes the Control key, and \M is the Esc key. As you can see above, some of the functions offer more than one preset key combination.

You can change key bindings by setting the value in your .bash_profile file, as described on Sidebar 15.3.

15.2.11 Inserting Boilerplate Text with bash

Some word processors come with an autotext function, which expands preset character combinations into longer text strings. These strings can be words, sentences, or entire paragraphs, or they could be commands or directory paths. For example, in some word processors you could set the sequence "mlb" so it expands into "Major League Baseball."

The bash shell lets you do this too. While you probably won't be typing very long text in Terminal, you may have a few specific strings that you need to use when editing Web pages, creating shell scripts, and so on.

The special part of bash that lets you set these texts is called readline, which is a collection of text functions. To match a text string to a key combination, you need to create an .inputrc file in your Home folder and add a line to it. (See Sidebar 15.2 for more on editing files like this.) For example:

"\C-b": "What a long, strange trip it's been."

The first part (\C-b) specifies the key combination: Control-B. The second part, in quotes, is the text that bash substitutes when you press that combination. This setting will take effect in all new Terminal windows you create.

15.2.12 Using Directory Name Autocorrection

In bash, when you make a typographical error in the name of a directory, the shell can try to fix it for you, but only if you turn on a special function called cdspell. To do so, run the following command:

shopt -s cdspell

Now, if you mistype a directory name, bash will try to resolve it:

Walden:~ kirk$ cd Dcuments

When you make a mistake like the one above, bash displays the corrected name, then runs the command using that name:

Documents

Walden:~/Documents kirk$

This correction is limited, though. The bash shell can only correct errors if there are transposed characters, one missing character, or one extra character. If bash finds a suitable correction, it replaces the correct name and runs the command.

FREQUENTLY ASKED QUESTION What Do These Periods Mean?

As you fiddle with your Mac's files in Terminal, you'll notice that some of them have names that begin with periods. Hint Section 15.2.11 tells you to create a file called .inputrc, for example. So what's the point of these periods?

It's simple: in Unix systems, a period at the beginning of a file name tells the system not to display the file all the time. Not only won't you see these files in Terminal (unless you

use a special option to show invisible files), but you won't see them in the Finder either. In fact, there are probably several invisible files in your Home directory right now. You can see them by running the ls -a command (the -a option tells the ls command to list all files, including invisible ones).

If you want this function to be activated permanently, however, you need to insert the following line into your .bash_profile file (Sidebar 15.3):

shopt -s cdspell

15.2.13 File Names that Contain Spaces

If you spend much time with Unix, you'll sooner or later have to deal with a file whose name contains spaces. For example, if you type cd Summer Design Sketches to see what's in that folder, Terminal responds with cd: Too many arguments. That's because, in Terminal's strict little head, anything after a space is another section of a command.

You can deal with this annoyance in three ways:

  • If you type cd and a space, you can drag a folder from the Finder into the Terminal window (hint Section 15.2.3). Terminal displays the full path to the dragged folder, with all the spaces taken care of. Press Enter, and you've now navigated to that folder in Terminal.

  • Precede each space with a backlash, like this: cd Summer\ Design\ Sketches; or enclose the entire thing in quotes, like this: cd "Summer Design Sketches".

  • Use autocompletion (hint Section 15.2.5). Start typing the directory name and then press Tab before you reach the first space, like this: cd Summ [Tab]. Once you press Tab, Terminal automatically completes the folder name, including the backslashes. Then press Enter.

If you work in Terminal regularly, keep your file names simple. Avoid spaces and other characters that have special meaning in Unix, like ~, !, @, #, $, %, &, *, parentheses, and brackets. That way, you'll avoid confusing Terminal—and yourself—when you have to enter file names.

15.2.14 Going Back Home

You've been exploring Terminal and navigating various folders and subfolders for hours. You're miles from where you started, but you want to return to your Home directory quickly and easily. Here are your options:

  • The long way: Type cd /Users/kirk/ (cd is the change directory command, and kirk is your Home account).

  • The quicker way: Type cd ~ (the tilde is shorthand for Users/yourUserName).

  • The quickest way: Type cd and press Enter.

Another option is to simply open a new Terminal window (File [image] New Shell). When you do that, you'll receive a fresh new command prompt, preset to your Home folder.

15.2.15 Save Time Typing

While most Unix commands are short, containing only two or three letters, some of them are longer, especially the ones you don't use a lot. Fortunately, bash has a command completion function, which works like the file name and directory completion trick explained in hint Section 15.2.5. This command-completion can both save you time, and help you remember a complex command name.

Just type the beginning of a command and press the Tab key:

$ soft [Tab]

$ softwareupdate

If bash finds more than one possibility for the completion, it displays the results after you press Tab again:

$ cvs [Tab][Tab]

cvs               cvs-make-branch   cvs-revert        cvsbug

cvs-diff-branch   cvs-merge-branch  cvs-view-diffs

$ cvs

In this case, type another few characters after the list of commands. In the above example, after typing cvs, adding -me, and then pressing Tab, the shell would expand the command to cvs-merge-branch.

UP TO SPEED Editing Shell Preference Files

Unix comes in many flavors, each of which has a slightly different method of establishing settings for its Terminal program. Mac OS X is no exception; it lets you establish your settings in a number of different ways. "Settings," in this case, means important Unix concepts like these:

  • The prompt. When you first open up Terminal, the $ or % symbol is the prompt—the sign that tells you, "I'm ready to do your bidding; type something." But it doesn't have to be a punctuation symbol; you can set it to anything you like (hint Section 16.5.9).

  • Paths. Terminal needs to know where it's supposed to find all of Mac OS X's Unix programs.

  • Aliases. In Unix lingo, an alias isn't the same thing as a Mac OS X alias. Instead, it's a text shortcut for a longer command.

When you first install Mac OS X 10.3, however, no preference files (or shell configuration files) are installed. If you

want to customize the shell, you'll need to create one or more such files to contain your personal settings.

The bash shell, for example, reads a series of files when it starts up:

  • /etc/profile. This file contains important system-wide settings that let the shell know where to find programs.

  • /etc/bashrc. This file contains system-wide commands and aliases, as well as settings for the prompt.

bash then goes on to read the first of three files that it finds in your Home folder:

.bash_profile, .bash_login, or .profile.

Because the shell only looks at the first of these that it finds, ~/.bash_profile is the best one to use for your personal settings. For information on editing this file, see Sidebar 15.4.

15.2.16 Mouse-Free Copying

Say you're working in Microsoft Word when you realize that you need to paste a Unix file listing (ls) into the document. You could, of course, switch to Terminal, type ls -al, carefully select all the ls output, copy it, switch back to Word, and press [image] -V to paste.

Wait a minute: there are only 24 hours in a day, and you still have to squeeze in that 20-minute aerobic workout. So instead, just use the pbcopy command to load the clipboard, like this:

ls -al | pbcopy

This command takes the output of the ls command and sends it to the pbcopy command, which places the output on the clipboard. When you switch back to Word, simply press [image] -V to paste the clipboard contents. There, done. Now it's time to slip on the Day-Glo spandex!

15.2.17 Mouse-Free Pasting

The previous hint illustrates how to copy the result of a Terminal command, but what if you want to paste instead? Conveniently enough, Mac OS X includes the pbpaste command for moving clipboard contents in the other direction. It's a terrific tool if you want to paste the clipboard straight into a new file.

Open a document in a Mac OS X program, select the text that you'd like to use, copy it, then switch to Terminal and type pbpaste > somefile.txt. (Replace somefile.txt with a file name of your choice.) This command creates a text file called somefile.txt in the current Terminal directory, filled with the current Clipboard contents.

If you're not sure what directory you're in, type pwd and press Enter.

15.2.18 Remove Formatting

Using the above commands, pbcopy and pbpaste, you can accomplish another useful task: removing the formatting from the clipboard. If you're trying to copy heavily formatted text into a plain text editor like BBEdit, for example, this can be a big help.

Just run the command:

pbpaste | pbcopy

This pastes the text from the clipboard back into the clipboard, removing all formatting along the way.


15.3 Window Administration

The Terminal has some tricks up its sleeve to make your time at the command line a little less black-and-white, a little more productive, and even a little more fun.

15.3.1 Changing Window and Font Colors

If you ever find yourself hemming and hawing about how boring your life is, this next tip is a surefire remedy. With just a few mouse clicks, you can change the window and font colors in Terminal. All you have [image] to do is choose Terminal [image] > Window Settings, then in the pop-up menu at the top of the dialog box, select Color. Now just change the settings to the colors you want. Presto! Your life is beaming with new color.

The above method is your only choice if you want to change the color of selected text. For changing all other color settings, however, Terminal provides another method.

First, make sure you can see normal text, bold text, some of the screen background, and the Terminal cursor, all at once in your Terminal window. The easiest way to see everything in one window is to view the manual pages for a program—for example, man bash.

UP TO SPEED Editing Environment Variable Files

Many of the hints in this chapter and the next direct you to modify one of the key shell setup files described in the sidebar on Sidebar 15.3. The .bash_profile setup file, for example, is often used for shell settings. However, it's important to know how to modify such files, since editing mistakes could cause your shell to behave erratically.

Mac OS X's Unix side comes with three different text processors—like the Unix versions of TextEdit or BBEdit. Of course, in Terminal, you won't be using your mouse, you won't see any graphics, and you won't have a choice of fonts and sizes. But you'll still be perfectly equipped for making changes to text files like those setup files.

The three Terminal text editors are known by their Unix-command names: emacs, vi, and pico. Of these three, pico is by far the easiest for beginners.

To use pico, make sure you've used the cd command to direct Terminal's attention to the proper directory, and then type pico groceries.txt (or whatever the file name is).

To edit a document, move the insertion point by pressing the arrow keys. (If you're a mouse diva, see hint Section 15.2.4.) Then just type to insert text, press Delete to erase existing text, and so on.

Once you're finished editing, pico lists the important commands right at the bottom of the Terminal window. After you've entered or edited the text as directed, hit Control-O (Write Out—that is, Save) to save your changes. Lastly, hit Control-X (Exit) to quit the editor and return to the Terminal window.

In this book, you'll need to edit the main customizable file called ~/.bash_profile. In other words, you'd proceed like this:

  1. type cd to make sure you're in your Home directory.

  2. type pico .bash_profile (make sure you type the period at the beginning of the file name). Edit the text in this file as described in the relevant hint.

  3. press Control-O to save your changes, and Control-X to quit pico.

  4. type source .bash_profile to activate the changes.

Now choose Font [image] Show Colors (or press Shift- [image] -C) to bring up the color wheel. Change the color of anything in the Terminal window by setting the color you'd like to use in the color wheel, and then dragging that color from the sample swatch (next to the magnifying glass, above the wheel) onto the text or background you want to change, as shown in Figure 15-5.

Once you have a color scheme you like, choose File [image] Use Settings As Defaults to make your eye-popping colors appear in all new Terminal windows.

Figure 15-5. Here, a color swatch is being dragged onto the bolded word SYNOPSIS. When the mouse is released, all bold text will take on the dropped color. You can also drag color swatches onto normal text, the background of the window, or even the block representing the cursor.

15.3.2 Instant Double-Clickable Terminal Commands

If you rely on the Terminal, you may come to resent all the red tape involved in preparing to run a simple command. For example, suppose you want to run top -u 20, a handy command that lists the 20 most processor-intensive programs running at the moment. For openers, you have to open Terminal (or open a new Terminal window if you don't want to lose what you're currently working on); then resize and place the window; set its background and font colors if you'd like; and, finally, type the command. Geesh! Wouldn't it be easier to just double-click a file in the Finder to do the exact same thing?

You can. Once you've adjusted a window's fonts, colors, and sizes, you can use Terminal's special Save command to enshrine them as an icon on your desktop. Then you can open a customized window at any time by double-clicking that saved file in the Finder.

This feature makes it easy to customize windows for various commands. For instance, you can create a blue and white window for ssh sessions (hint Section 6.3.3), a yellow and black window for top sessions, and a green and black window for text-editing sessions (Sidebar 15.4). Then, even when you have 20 windows open on your screen, you can tell at a glance which has the command you want to jump to.

Here's how it works:

  1. Open a new Terminal window and set it up to your satisfaction.

    Position it where you want it onscreen, set its width and height, and choose Terminal [image] Window Settings. Change the display, color, and window settings to your liking.

  2. Once you've set all your options, choose File [image] Save As, and then pick a location and name for your Terminal window.

    Terminal wants to save the file in your Application Support folder, but you may find it easier to locate if you save it, say, on your desktop.

  3. Choose "Execute this command," and type the command you want Terminal to execute.

    For example, top -u 20.

  4. Turn on "Execute command in a shell" and save the file. Test your new command launcher in the Finder by double-clicking the new Terminal file.

    If all went well, Terminal opens with the settings you specified, in the screen location you chose, and with your preset command intact.

If the program doesn't start as expected, try including the full command path ( /usr/bin/top) instead of just the command name (top).

15.3.3 Opening Saved Terminal Windows in the Dock

Using the same methods described in the previous hint, you can create a saved Terminal session that opens pre-minimized in the Dock instead of opening a new window. This arrangement is handy if, for instance, you use Terminal to download email from a separate computer, but you use Mail to read your messages on your current machine. In that case, you really don't need to see the Terminal window—you just want to know it's running.

Create the saved session as you did in the previous hint, and then open the file in TextEdit. Search the file for this section:

<key>IsMiniaturized</key>

<string>NO</string>

Replace NO with YES and save the file. Your Terminal session now starts automatically minimized in the Dock.

15.3.4 A Library of Terminal Windows

Terminal comes with a very useful menu, File [image] Library, grayed out. This menu can provide easy access to the customized windows you created using the previous two hints, as shown in Figure 15-6.

To turn on this menu, quit Terminal and open your Home [image] Library [image] Application Support folder. Create a new folder here called Terminal. Then, in the Terminal program, choose File [image] Save As for the current window (hint Section 15.3.2), and make sure the save location is your newly created Terminal folder.

Figure 15-6. The Library menu in Terminal, when used with the previous hints, can save you a lot of time when loading saved Terminal windows.

The File [image] Library menu now turns on, and its submenu displays the name of the file you just saved. To make this submenu really handy, use your new Terminal folder to store the customized windows you created in the previous hints.

For easier access to the folder (and, therefore, the contents of the menu), consider putting the Application Support [image] Terminal folder right on your Dock. That way, you can add saved Terminal windows without having to navigate deep into your hard drive.

15.3.5 Open a New Terminal Window in the Current Directory

Sometimes, after you've moved around your filesystem for a while using the cd command, you realize you want another Terminal window in the current directory so you can perform two different tasks in the same location. Rather than open a new window and cd into it, it would be much easier to run a single command that takes you there.

The following script does just that. Simply enter it into a new document in TextEdit (or any other program that can edit plain text), like so:

#!/bin/sh

 osascript<<END

 tell app "Terminal"

 do script "cd \"`pwd`\""

 end tell

The two characters that surround pwd (backticks) are created by pressing the ~ key.

Using the osascript command tells Terminal to create a new window showing the current working directory. Simply save this script wherever you store shell scripts, giving it a memorable name such as nt, then run chmod 755 nt to make it executable. From now on, you can run your shortcut to create a new window in the same directory.

15.3.6 Dragging Text Between Terminal Windows

You can easily drag and drop text from one Terminal window to another. For some strange reason, however, the first window remains in front the whole time.


15.4 Manipulating Commands

The Unix shell can make your command time more productive in a slew of different ways. The shell can keep track of the commands you've run, help you fix typos you've made, and even let you create entirely new commands with ease.

15.4.1 The Master List of Commands and Programs

Want to see a list of every Unix command Terminal knows about—its master vocabulary of magic words? (Well, read on anyway.)

At the prompt, press the Tab key (you may need to press it twice). Terminal asks if you want really want to display all 983 possibilities (your number of commands may be different) and asks you to type y (for yes) or n (for no). If you type y, Terminal displays a list of every executable program on your computer—hundreds and hundreds of them, most of which explain themselves when you use the man command (hint Section 15.9.1).

15.4.2 Create a List of All Your Files

Really, all of them. Every single one, in one list, with just one command in Terminal. This way, if you're on the hunt for a particular file, you don't have to search until you're blue in the face. It's the ultimate in one-stop viewing.

Navigate to your Home folder in Terminal (type cd and press Enter if you're not already there), then type:

ls -RF

The -R flag drills down into all subfolders. The -F flag, meanwhile, writes a trailing slash (/) after folders, and a trailing asterisk (*) after programs, to make it easy to see what kind of files you have at a glance.

This list can be very, very long. If you have lots of files, you might as well go make a few cups of coffee while you wait for them to display.

But wait—there's a better way. Have Terminal pour the list into a file, so you can examine it at your leisure. Run the command like this:

ls -RF > file_list.txt

When you're done, you'll find a file called file_list.txt in your current directory, which you can open with TextEdit or any other text editor.

You can create a listing like this for any folder, not just your Home folder. Simply use the cd command to navigate to the folder you want to list before you run the ls command.

15.4.3 Searching Your History

When you execute commands in the bash shell, Mac OS X adds them to a file named .bash_history, which sits in your Home folder. As explained in hint Section 15.2.6, the History file gives you access to a powerful set of tools that let you quickly locate previous commands—even if you quit Terminal and don't return to it until days later.

However, there's more to this feature than just navigating your history: you can actually search it. Just press Control-R at the prompt, and Terminal displays a search indicator below the current line, like this:

(reverse-i-search)`':

Then as you begin to type a command, Terminal searches for it in your history. If it guessed correctly, you can run the command by pressing Enter. If not, simply type a few more letters until Terminal comes up with the match you want.

For example, if you had recently run both a cd ~/Documents command and a cat recipes.txt command, pressing Control-R followed by c causes Terminal to display cd ~/Documents on the command line. If you then type a, however, the command changes to cat recipes.txt.

15.4.4 Browsing Your History

While the previous hint showed you how to search your Terminal history, sometimes you just want to casually look through it...to figure out what you typed before you erased your entire Home folder, perhaps.

As it happens, the bash shell has a command that lets you see the last 16 commands you've typed. Run this command in Terminal:

$ fc -l

If you want to check out even more commands, you can add a number to the fc command, too. Running fc -l 25, for example, displays all the commands, starting with the twenty-fifth most recent. Watch out, though: since bash stores the last 500 commands, that command can display a very long list.

15.4.5 Running the Previous Command as the Superuser

Sooner or later, you're going to execute a command as your Normal account that you intended to execute as the superuser (via sudo; see the sidebar below). Instead of hitting the up arrow and editing the previous line to insert the sudo command, just type sudo !!. The two exclamation points (!!) are a shortcut for the previous command.

UP TO SPEED Meet the sudo Command

Normal and Administrator aren't the only kinds of accounts in Mac OS X. There's one account that wields ultimate power...one person who can do anything to any file anywhere. This person is called the superuser.

Unix fans speak of the superuser account—also called the root account—in hushed tones, because it offers absolute, unrestricted power. The root account holder can move, delete, rename, or otherwise mangle any file on the machine. One wrong move—or one Internet hacker who manages to seize the root account—and you've got yourself a doorstop with an Apple logo on it. That's why Mac OS X's root account is completely hidden and, in fact, deactivated when you first use Mac OS X.

In Terminal, you can enjoy most root-like powers without actually turning on the root account. There's a simple command—the sudo command—that simulates root powers without you actually having them.

sudo is a great command name. Technically, it's short for superuser do, which means that you're allowed to execute any command as though you had logged in with the root (superuser) account—but without actually having to turn on the root account, log out, log back in again, and so on.

It's also a cool name because it looks as though it would be pronounced "pseudo," as in, "I'm just pretending to be the root user for a moment. I'm actually here under a pseudo-nym." (In fact, you pronounce it "SOO-doo," because it comes from superuser do. In the privacy of your own brain, though, you can pronounce it however you like.)

The first time you run sudo, you're treated to the characteristic deadpan humor of programmers worldwide: "We trust you have received the usual lecture from the local System Administrator. It usually boils down to these two things: 1) Respect the privacy of others. 2) Think before you type."

In other words, sudo is a powerful tool that lets you tromp unfettered across delicate parts of Mac OS X—you should therefore proceed with caution. At the outset, at least, you should use it only when you've been given specific steps to follow, as in this chapter.

Now sudo asks you for your usual login password, just to confirm that you're not some seventh-grader up to no good. If you are indeed an administrator, sudo gives you a five-minute window in which, by prefacing each command with sudo, you can stomp about as though you're the all-high, master root account holder. (If you don't use sudo again within a five-minute span, you just need to input your password again.)

For more tricks based on previous commands, search the Terminal shell manual for History expansions (type man bash, press Enter, type /History expansion, and press Enter again). You'll find a section describing all the shortcuts you can use to repeat sections of previous commands.

15.4.6 Fixing Minor Errors in the Previous Command

Play along for a moment. While trying to change to the Web server's documents directory, you goof and type cd /Library/WebbServer/Documents. Uh oh...typo city. The shell tells you nicely that no such directory as "WebbServer" exists, so you press the up arrow to recall the previous command, use the left arrow to move back, delete the extra "b" from WebbServer, and press Enter again.

Here's how to save a bunch of keystrokes the next time you need to fix a typo. Just type ^bb^b, and then press Enter. The shell pulls up the previous command, finds the first instance of bb, replaces it with b, and then executes the resulting command.

Granted, you wouldn't want to fix numerous complex typos with carets, but they're perfect for fixing simple mistakes.

15.4.7 Editing Commands in Your History

One of the most powerful features of the bash shell is its ability to edit your command history (hint Section 15.2.6). bash offers a direct link to any command line editor, including pico, vi, and emacs, so you can fire up your favorite text tool and make corrections to even the longest commands in your history.

There are a couple of different ways to accomplish this, but the easiest is to use the fc command, which uses the text editor specified in the FCEDIT setting. You can set this variable by adding the following to your .bash_profile file:

FCEDIT=/usr/bin/pico

The above example sets the default editor to pico (the easiest command line editor available), but you could also set it to vi or emacs if you're familiar with them.

If you don't set this variable at all, vi remains the default editor.

Once you're done with that, run this command to trigger your changes:

$ source .bash_profile

As you discovered in hint Section 15.4.4, you can use the fc -l command to list your most recent commands. If you want to edit the last command, though, just run fc with no options. This command opens the previous command in the text editor you specified, letting you make any changes you want. When you exit the editor, the previous command in your history is run.

To edit a command further back in your history, run the fc command as follows, where n is the number of the command you want to edit—counting backward:

$ fc -n

For example, if you want to edit the third-to-last command you ran, you'd use fc -3.

To edit the last command you ran that contains a specific string, run the fc command like this:

$ fc <string>

This string could be part of a command name, the name of a directory, or anything else contained in the command. The fc command then opens the last command it finds that matches the string, so you can make changes and run the command again.

15.4.8 Manage Your History File

When using the History file, you may be bummed to find that it doesn't quite remember enough, or that it stores too many commands. Fortunately, thanks to this next hint, the bummer is only temporary.

By default, bash stores the last 500 commands you run. That number may seem like a lot, but if you cd and ls around your Mac for a while, you'll easily end up with that many in your History file.

You have two controls to make your history more efficient. The first changes the size of your History file (the number of commands it stores). If you find that 500 commands are too many—or too few—then this number is what you want to change.

Using the pico editor, as described in the sidebar on Sidebar 15.4, add the following line to your .bash_profile file, where n is the number of commands you want to record. You could choose a smaller amount, such as 100, or several thousand if you're a command packrat:

export HISTSIZE=n

Unfortunately, this command still records every cd and ls command you type. Luckily, you can weed out the duplicates, so only unique commands are stored, by adding this line to your .bash_profile file:

export HISTCONTROL=ignoredups

With this set, bash never records a command that's the same as the previous one. So while you may have lots of cd commands, you'll never have the same two in a row, therefore making your history a bit more manageable.

15.4.9 New Commands Using Aliases

As described in the sidebar on Sidebar 15.3, Unix aliases aren't the same thing as Mac aliases. They are shortcuts, but instead of serving as shorthand for files and programs, Unix uses them as shorthand for existing commands.

For example, if you frequently open certain programs from the command line, aliases can make the process easier. The long shadowGoogle launch command described in hint Section 15.6.3, for instance, can be reduced to sg—just two keystrokes.

Aliases can also be handy for combining commands you often use together. For example, suppose you have a remote computer that you frequently connect to using ssh (Section 6.3.2). Some computers require that you specify a particular port number (networking keyhole) as part of the ssh command. So your ssh line becomes rather lengthy, something like this:

 ssh -p 5022 kirk@10.0.1.210

Well, instead of typing this line every time you want to connect, you can create an alias called sshwork that runs the whole command.

TROUBLESHOOTING MOMENT Help! My Terminal History File Stopped Working!

You're making great progress learning the shell, and you've created some customized environment files to help make the shell work for you (Sidebar 15.3). But, alas, now your History file isn't working. You can no longer use the up arrow key or Control-R to access previous commands—and even worse, you can't figure out why.

More than likely, the problem is an error in one of the environment files in your Home folder. Try turning off these files temporarily (one way is to quickly rename them using, for example, the command mv .bash_profile .bash_profile.bad), then close and open the Terminal window and see if your History file works as expected.

If it does, you need to figure out which section of the file is causing the problem. And you have to do it the old fashioned way: trial and error. Start by making sure only one script is loading (leave the others disabled), and then comment out (by placing a "#" sign at the front of each line) one line at a time to see if your History file remains functional.

Test the changes by opening a new Terminal window while leaving the editing window open. Repeat the process until you find the culprit line, and then either remove or fix the offending command. Repeat as necessary through any other environment files you use with bash.

Here's how to create your own alias:

  1. Switch to your Home folder, by typing cd and pressing Return. Then, using the pico editor, as described in the sidebar on Sidebar 15.4, open .bash_profile.

    The pico text processor opens an alias up onscreen.

  2. Add the alias as a new line anywhere in the file.

    To add this line, note that the first word must be alias; next is the name of the abbreviation you want to create; and then, in single quotes, is the longer command or commands that you want to execute.

    For example, if you were to create the shadowGoogle alias described above, you'd type:

    alias sg='open -a /Applications/My\ Utilities/shadowGoogle.app'

    You need the backslash to remind the shell that the space is a special character here.

    To create the ssh alias described above, you'd type:

     alias sshwork='ssh -p 5022 kirk@10.0.1.210

    Of course, you would substitute the real port number and user name.

Avoid giving one of your aliases the same name as an existing Unix command (ls, for example). If you did that, you'd be missing out if Apple ever quietly updated the "official" version with a new one. Your alias would continue to intercept your typing of ls (or whatever), and you wouldn't receive any new goodies.

15.4.10 Creating a Safety Net for Dangerous Commands

You've probably heard that using the command line can be dangerous. Well, it's true; certain commands, such as rm (remove, the equivalent of dragging a file to the Trash and deleting the Trash in one fell swoop) or mv (move, which can overwrite other files having the same name as the one you're moving), have no undo feature. Once you've run these commands, you can't go back, and any files you delete are gone for good.

Unix mavens often advise beginners to use the special -i (interactive) option when running these commands. When they're run with the -i option, these commands ask you, by displaying a line in Terminal, if you really want to delete the files. This little letter can be a lifesaver, especially if you ran the rm command and made a typo, thereby deleting your Great American Novel instead of that old log file. Here's how it looks when you run the rm command in interactive mode:

$ rm -i soupCollection.txt

remove soupCollection.txt?

When you run the command, Terminal asks you if you want to remove the old file. You can type y, or yes, to remove it, or n, or no, to keep it. (Funny how that works, isn't it?) The one day you type n, you'll be happy you used this option.

But why bother to type -i every time? You can set aliases so that whenever you run the rm or mv commands, the interactive option is automatically used. In the previous hint, you saw a note that advised you not to use an existing command name for an alias. In this case, though, that's exactly what you want to do. Set up two aliases (hint Section 15.4.9) like this:

alias rm='rm -i'

alias mv='mv -i'

Now, whenever you run the rm or mv commands, the -i option will be used so you don't need to type it yourself.

You should still be careful, though. While you have a safety net, it's easy to become used to it and mechanically type y every time the confirmation message displays.


15.5 Administering the Mac

The Unix shell can help you keep a close eye on the performance of your Mac—in ways that no graphical Mac OS X program can. For example, did you know you can pause an application that's running in the background so that it won't take any of your processor cycles while you're not using it? After reading this section, you'll know how to do that and much more.

15.5.1 Your Mac's True Unix Heritage

During the normal boot-up sequence for Mac OS X, you see a gray logo in the middle of the screen with a spinning progress wheel just below it. Hey, that's all well and good from a cute icon standpoint. But if you ever want to see what really happens when your machine boots up, hold down [image] -V just after you press the power button or the reset switch. This key combo, known in Geekville as verbose mode booting, reveals all the underlying Unix processes at work.

Some ugly white text on the black background shows you exactly what Unix is doing to boot your machine. The messages flicker by very quickly while the computer starts up, but you can still read them once it's finished. (Unfortunately, the messages aren't likely to make any more sense when you can actually read them.) If you're curious to see what happened when your computer started up, launch Terminal and type dmesg | less. (The less command makes the long dmesg results scroll one page at a time.)

15.5.2 Log Files in Real Time

Enough of the past tense. If you like to see what's going on with your machine as it happens in the present, you can use the tail command.

Type tail -f /var/log/system.log, for example, to watch the system log being recorded in real time. The system log is a file that records information that other applications send in its direction. Although much of what you see looks like technical gibberish, studying it might lead you to discover that a certain program is constantly logging things—a sign that it's misbehaving, slowing down your machine, and probably worth troubleshooting.

The -f flag tells tail to read the end of the log file and then keep reading it as the log is updated. Without the -f flag, tail would just display the last lines of the file and then quit.

You can also watch the Apache logs, which track visitors and activity on any Web pages you serve with Personal Web Sharing. To do that, open a Terminal window, type tail -f /var/log/http/access_log or tail -f /var/log/http/error_log, shrink the Terminal window, and position it so that you can see it while you work on other things. Now you have an omnipresent real-time activity monitor (Figure 15-7).

15.5.3 Pausing CPU-Hungry Background Programs

Many Carbon programs, including Internet Explorer, iTunes, Acrobat, and the Office applications, eat up a ton of computing power when they're merely running in the background. Even while it's doing nothing, for example, Microsoft Word can scarf down 10 percent or more of your processor's attention all by its big, fat self.

Figure 15-7. Tail-ing the Apache logs helps you see what's happening on your site in real time. For instance, on May 8 at 17:21:52 (the first line), somebody whose IP address was 65.179.48.175 loaded the geeklog.rdf file. You can even see that this person's MacReporter program asked for the page.

If you want to leave such a program running when you're not using it, but you need the CPU's energy for other tasks, you can simply pause the offending program. While paused, the program's CPU usage drops to zero. Although its windows remain open, you can't use it when it's in this comatose state. Unpausing is easy, too—and it doesn't require relaunching the program and its windows.

To pause a program, you need what's called its process ID (PID). You can find a PID by typing ps ax | grep "Microsoft Word" (or whatever the program's name is). When you press Enter, the PID is the first number on the line that appears.

Suppose the program's PID is 791. You can pause the program by typing:

 kill -STOP 791

To restart the paused program, use:

 kill -CONT 791

15.5.4 Maintenance Scripts on Demand

Mac OS X runs a series of maintenance scripts designed to clean out system logs, update important system databases, and perform a number of other tasks. These scripts are scheduled to run on a daily, weekly, or monthly basis. You can see what they're set to do by typing these commands:

cd /etc

cat daily | less

cat weekly | less

cat monthly | less

After each cat command, the contents of the corresponding file go flowing by on the screen. If you're new to Terminal, you probably won't understand most of what scrolls up your screen, but, in essence, the scripts' purpose is to keep Mac OS X performing well.

Each task, however, is set to run on a different schedule. To find out exactly when these scripts are scheduled to run, type cat /etc/crontab. The end of the resulting output looks something like this:

...

#min hour mday month wday command

...

#

# Run daily/weekly/monthly jobs

15 3 * * * root periodic daily

30 4 * * 6 root periodic weekly

30 5 1 * * root periodic monthly

Although you might not realize it at first glance, the last three lines reveal the times at which the maintenance scripts run—for example, the daily script runs at 3:15 a.m.

Here's how to read it: the first column is minutes, the second column is hours (in 24-hour mode), and the asterisk in the third column means every day. Similarly, the weekly script runs at 4:30 a.m. on Sunday morning (in the fifth column, days are numbered from 0 for Monday through 6 for Sunday). Finally, the monthly script runs at 5:30 a.m. on the first day of every month. (For more information on the crontab command, see hint Section 16.1.1.)

If you leave your Mac on (and not sleeping), the scripts run at their appointed times. But a constantly running computer is not necessarily good for your Mac or your energy bill. If, like most people, you put your Mac to sleep when you're not using it, you can run the scripts on your own schedule. So, if your Mac sleeps when you do, it's a good idea to occasionally run the maintenance scripts by hand—although you don't need to do it every day.

You can use a graphical Mac OS X program for this task—Cronnix, for example (www.koch-schmidt.de/cronnix)—or you can do it from Terminal. At any rate, you simply need to execute the scripts in the /etc directory. Just type:

sudo periodic daily

sudo periodic weekly

sudo periodic monthly

Each command runs for a while and then returns you to the command prompt. Obviously, there's no need to run the monthly script any more often than monthly, the weekly script any more often than weekly, and the daily script any more often than daily.

However, if you don't run them for a while, you can roll all three commands into a one-liner like this:

sudo periodic daily weekly monthly

To be sure, this sequence will take longer to run than each individual command, but it neatly wraps up all the various maintenance tasks in one shot.

15.5.5 Complete Backups

If you want a complete backup of your files, it's not enough just to drag your Documents folder onto a backup disk. You also have to worry about endless invisible files and settings: resource forks, Ownership & Permissions, Unix aliases, and so on. If you don't get all of that into a backup copy, your documents and programs might not work properly when restored.

The two obvious options, copying files in the Finder or using the cp (copy) command in Terminal, just don't cut it. If you copy a folder in the Finder, you copy the resource forks (hint Section 15.6.8) but not the hidden files. If you use cp in Terminal, though, you copy the hidden files but not the resource forks. Either way, some of your data won't come along.

Happily, Mac OS X includes a program called ditto that can make an exact duplicate of a folder with all its contents—even the settings and invisible files. This program is wicked awesome for completely backing up your Home folder, which is where most of your personal documents and preferences live.

Just use the command in this format:

sudo ditto -V -rsrcFork /folder /Backupdrive/folder

It breaks down like this:

  • -V tells ditto to spew out one line of output for each file. (If you don't want a full log of what's copied, use the -v option, which displays just one line, "Copying", followed by the name of the folder being copied. Or just don't use either option at all, and you won't get any feedback until the copy is finished and the next prompt displays.)

  • -rsrcFork tells ditto to copy the Mac's resource fork data (hint Section 15.6.8) as well as the files themselves.

  • folder is the folder you want to back up (it can be any folder path).

  • Backupdrive is the path of the backup drive and destination folder.

For the sake of discussion, let's suppose you have another hard drive named Backup, your name is Kirk, and you want to back up your Home folder. You'd type:

sudo ditto -v -rsrcFork /Users/kirk /Volumes/Backup/kirk

Mac OS X thinks of all its disks as being in the invisible Volumes folder.

Like washing your hands before dinner, when backing up is this simple, you have no excuse not to do it regularly.

Type man ditto for more information on the ditto program and its options.

15.5.6 Securely Delete Files from Terminal

Panther added a new Secure Empty Trash feature to the Finder, so you can delete files and overwrite them at the same time for better security. This feature, however, only works for files in the Trash; when you work on the command line and delete files with the rm command, you don't put them in the Trash first.

So, what if you want to delete files from the command line, but do it securely? The srm command does so for you. Here's how you run it:

srm -m -z filename

The -m and -z options give you maximum security. The -m option overwrites the file with seven U.S. Department of Defense compliant passes (0xF6, 0x00, 0xFF, random, 0x00, 0xFF, and random, for those of you counting at home), and the -z option writes a bunch of zeroes to the section of the hard drive used by the file. In other words, you're file is totally, completely, and irrevocably erased.

The srm command offers other options, such as a recursive option for deleting directories, an interactive option that asks you before deleting each file, and much more. Type man srm to discover all the options.

15.5.7 Find Out What's Filling Up Your Hard Disk

You thought that hard disk would be big enough, didn't you? When you bought your latest Mac, you probably thought you'd never fill up your disk. But suddenly you discover that there's no disk space left, and you're scratching your head trying to figure out why. Join the club...line forms at the left.

There are two possibilities: either it's your files (music, photos, movies, and so on) that are hogging the space, or else there are hidden temporary files that have managed to fill up your hard disk.

The command line comes to the rescue again, with a simple way to help you locate all those files. Start by going to your Home folder in Terminal (if you're not there, type cd and press Return). Then issue this command:

du -ksh *

The du command returns disk usage information, while the three options do the following: -k tells du that results should be displayed in 1-kilobyte blocks; the s option causes it to give a list of the size of each item rather than a total for all of them; and h returns "human-readable" output (K for kilobytes, M for megabytes, G for gigabytes and so on). Here's what the command returns when run in a typical Home folder:

184M    Desktop

394M    Documents

346M    Library

302M    Movies

 74M    Music

211M    Pictures

 32K    Public

5.1M    Sites

As the OCD-inclined amongst you may have noticed, the above display is in alphabetical order, which is fine for short lists. However, if you're running this command in a directory where there are lots of files or folders, you may want to sort the output by size:

du -ksh * | sort -nr

This line returns a list in decreasing size order, displaying the largest directories at the top. Unfortunately, it only sorts by number, not really by size; for instance, the results show 32 K as being bigger than 5.1 M.

394M    Documents

346M    Library

302M    Movies

211M    Pictures

184M    Desktop

 74M    Music

 32K    Public

5.1M    Sites

Both of the above examples show the du command run on a Home folder, but that's not always where the most files are lurking. Of course, this command isn't rocket science, since the Finder can do the same thing in List View. But using this command, you can examine a remote Mac when connected via ssh (Section 6.3.2), or look at directories that you can't normally see in the Finder.

If you ever need a full list of all your files, run du -ksh /. This command generates a full catalog of everything on your hard disk, as well as any other mounted disks. Be patient, though; it can take a long time. You might prefer dumping this to a text file instead:

du -ksh / > filelist.txt

This way, you can examine it at your leisure.

15.5.8 Identifying Generic Files

The file command can help you identify any file you have, whether you created it or downloaded it from the Internet. file uses a combination of methods to ascertain the type of file you've asked about, and naturally responds if it finds a match. For example, the command

file download.php

...might return this information:

download.php:gzip compressed data, deflated, last modified: Fri Jul 12 18:17:34 2002, os:

Unix

In this case, the file was compressed with a program called gzip, and should be expandable by StuffIt (or the command line if you prefer, using gzip -d).

To learn how file matches your unknown files to known file types, check out man file.

15.5.9 What Version of Mac OS X?

When connecting to another Macintosh via ssh (Section 6.3.2), you might want to uncover which version of Mac OS X the machine uses. Type sw_vers to get a short readout of the relevant information that looks something like this:

ProductName: Mac OS X

ProductVersion: 10.3.4

BuildVersion: 7H63

You can also find out which version of the Darwin kernel it has (that is, which version of the underlying Unix) by typing uname -a. You get something like this:

Darwin Walden.local 7.2.0 Darwin Kernel Version 7.2.0: Thu Dec 11 16:20:23 PST 2003;

root:xnu/xnu-517.3.7.obj~1/RELEASE_PPC  Power Macintosh powerpc

In the above example, the Darwin kernel version is 7.2.0 and the system updated it on December 11, 2003.

15.5.10 Managing Type and Creator Codes

Mac OS X has no built-in tool for changing your files' type code or creator code (hint Section 4.3.15). But if you've installed the Developer Tools (Section P.3.5.5), you can use GetFileInfo and SetFile to view and modify this file information.

For example, the command /Developer/Tools/GetFileInfoMyHomework.cwk might yield:

file: ""/path/info/for/MyHomework.cwk""

type: ""CWWP""

creator: ""BOBO""

attributes: avbstclinmed

created: 6/09/2002 07:41:19

modified: 8/13/2004 20:54:46

The type code is CWWP (ClarisWorks word processing document), and the creator is BOBO (that is, AppleWorks).

Using SetFile, you can easily change any of these attributes. The command on its own (/Developer/Tools/SetFile) explains how it is used:

SetFile [option...] file...

-a attributes # attributes (lowercase = 0, uppercase = 1)*

-c creator # file creator

-d date # creation date (mm/dd/[yy]yy [hh:mm[:ss] [AM | PM]])*

-m date # modification date (mm/dd/[yy]yy [hh:mm[:ss] [AM | PM]])*

-t type # file type

... ... ...

For example, to change a downloaded TIFF image file so that Mac OS X will recognize it as a Photoshop file when double-clicked, you'd type SetFile -c 8BIM -t TIFF imageName.jpg.


15.6 Finder-Terminal: A Joint Venture

Mac OS X includes a number of deft integration tools that make the transition from the Terminal to the Finder (and back) as easy as possible—as you're about to find out.

15.6.1 Opening the Current Directory in the Finder

If you type open . (note the trailing period) in Terminal, the Finder opens the directory you were perusing in Terminal. If you type open .., the Finder opens the directory's parent folder (the one that contains it).

You can also type open plus the full path to any directory; once again, the actual Finder folder pops open. This trick is especially useful for opening folders that are typically hidden from view in the Finder, like /var/etc or /var/httpd (although you could always open such folders using the Go [image] Go to Folder command).

15.6.2 Opening URLs from the Command Line

You're working along in Terminal when you suddenly remember that you want to check the new QuickTime trailers on Apple's Web site. You could always grab the mouse, move to the Dock, click your Web browser's icon, click in the address bar, and then type the URL.

Or, if you're feeling particularly smug, you could also pull a power-user move and just type open http://www.apple.com/trailers/. Your Web browser opens and loads the page whose address you typed.

-double-click any Web address that appears in Terminal to visit that page in your default Web browser.

15.6.3 Opening Files from the Command Line

The open command performs many tricks beyond simply opening URLs (see previous hint). You can also use it to open programs as if you had double-clicked them in the Finder. For example, try one of the following:

open -a Mail

open -a iChat

open -a Microsoft\ Excel

The -a flag means you're referring to an application.

If typing just the program's name doesn't work, however, specify the full path to a program like this:

open -a /Applications/Utilities/shadowGoogle.app

Using the -e flag, you can tell open that you'd like to use TextEdit to edit a file:

open -e RatatouilleRecipe.txt

Mac OS X attempts to open the file with an appropriate program for the file name you specified (according to its file name extension). For example, if you type open Employees.doc, the system launches Word and opens your Employees document; open Salaries.xls, meanwhile, launches Excel and opens your Salaries spreadsheet.

15.6.4 Open a New TextEdit File from the Command Line

The open command (see previous hint) is full of surprises. Not only can it open files and applications, it can even decompress zip archives (hint Section 15.6.15). Sure, that's impressive, but here's another trick that makes the open command a valuable tool.

When you're working in Terminal, you sometimes want to move into the GUI side of Mac OS X, if only because it's faster and easier for some tasks. While you can easily create a new, empty text file in the command line, for example, the open command lets you create a new file in TextEdit.

To follow up hint Section 15.5.7 (where you saved the contents of your Home folder to a text file), you can send a file list directly into a new TextEdit file, all with a simple command. All you need to do is send the output into the open command, rather than redirect it into a file:

ls -RF | open -f

The -f flag tells the open command to create a new file with TextEdit. You'll notice that this file has already been named (with a long, incomprehensible series of numbers and letters), and saved. But it's saved in a Temporary Items folder, hidden deep in the entrails of your startup volume. Select File [image] Save As to save it under a new name in a new location.

15.6.5 locate I

While the Mac OS X Finder includes a highly effective search tool, it's sometimes more convenient to search in the Terminal if you're already there. To find any file anywhere on your hard drive, use the locate command, like this:

locate filename

Of course, type the name of the file you want instead of filename.

When you press Enter, Terminal immediately starts listing files that match. If Terminal produces a blank list, but you're positive the file exists, the locate database may not yet have been created on your machine. The next hint explains how to overcome that glitch.

locate returns any file whose pathname includes your search string. Thus, if you have a folder named HTML, and you run locate HTML, you receive a list of every single item in the folder. If this result is not what you wanted, use a filter to narrow the search results, like this:

locate HTML | grep "/Users/kirk/HTML/Client_WebSites"

The locate command returns files whose names contain HTML, and the pipe (vertical bar) combines that search with the grep command, which restricts the search to files that live in the inner Client_WebSites folder. Got it? Good.

15.6.6 locate II

The same weekly maintenance script that updates the whatis database (hint Section 15.9.7) also updates the locate database. So if the locate command isn't working on your machine, try forcing Mac OS X to make an appropriate database with this command:

sudo /usr/libexec/locate.updatedb

Depending on the size of your hard drive, the system may take a while to establish the locate database. Go get yourself a bowl of cereal, and don't be surprised if you hear the drive spinning for several minutes. Once the command prompt has returned, the locate command should work as expected.

As you add programs and files to your system, run the above command again to update the locate database with the new information. If you don't, the locate results will only contain data that was present when you first established the database. However, if you run the weekly maintenance routine regularly, as explained in hint Section 15.5.4, the maintenance script takes care of updating this database.

15.6.7 grep: A Text String

To find any text string (sequence of characters) in a text file or command output, use grep, the beloved Unix search program. grep stands for "global regular expression print"—a thoroughly confounding name for an amazingly powerful program.

The basic format for using the command is as follows:

grep -options "text to find" "files to look in"

For instance, take a look at this command:

grep -l "font" *.html

The -l option builds a list of any file or files in the current directory that contain the text "font," and whose name ends in ".html."

If you have some spare time and want to see how grep can search your entire hard drive, type the following (and replace "text to find" with something you'd actually like to look for):

cd /

grep -lr "text to find" *

These commands send grep looking for "text to find" in every file in every directory on your machine—and then lists the results. The -r flag tells grep to recursively search directories (that is, to search all directories inside the specified ones), which it does starting with your hard drive's lowest level.

This search understandably takes a while, given that Mac OS X is made up of over 25,000 files. (Many of these files are programming code and appear as a bunch of meaningless characters when grepped.) When the command is finished, however, you'll have a comprehensive list of every file that contains the search string.

grep really shines when you use it in conjunction with other commands, as it can help narrow the output from another command to just the specific data you want to see or use.

15.6.8 Checking for Resource Forks

If you could inspect certain traditional Macintosh files with the software equivalent of a CAT scanner, you'd see that their single icon might actually house two chunks of computer code, which geeks call the data fork and the resource fork. (Data refers to, well, data—stuff you type or the programming code that comprises an application. Resources are components like icons, windows, toolbars, and other pieces of an application or document.)

POWER USERS' CLINIC Regular Expressions

grep, along with many other Unix and Mac OS X programs, understands a system known as regular expressions, or regex for short. A regex is simply a certain pattern of text. In hint Section 15.6.7, for example, "text to find" is the regex.

Regex strings can be complex and powerful. For instance, here's one that checks to see if a certain blob of text is a correctly formatted email address (by checking for spaces, illegal characters, the @ sign, and so on):

[a-z0-9_-]+(\.[a-z0-9_-]+)*@[a-z0-9_-]+(\.[a-z0-9_-]+)+

And here's a regex string, used with grep, that searches all .htm and .html files in the current directory for references to either a serif font or a 12-point font, and then produces a list of those files:

$ grep -irl ']*(face="serif"|size="12")' *.htm *.html

The -i option tells grep to ignore case, -r triggers searching in subfolders, and the text between the two single quotes is the regex.

To learn more about regex, try man regex or consult a book like O'Reilly's Mastering Regular Expressions.

This fork business is news to Unix, however. When you use the cp command (or mv), Unix copies or moves only the data fork—the only one it knows about. Therefore, many non-Cocoa programs' files (AppleWorks, Word, and so on) will be rendered useless, having lost many of their essential resources.

To see if the files in your current directory have any resources, type tcsh at the prompt. Doing so opens the tcsh shell in Terminal (this hint doesn't work with bash). Then, just type ls -al */rsrc for a list. If any resource forks exist, Terminal returns a message something like this:

-rw-r--r-- 1 robg admin 0 Aug 27 06:48 Internet

Explorer.app.sit/rsrc

Once you know you have resource forks in the current directory, you may opt to switch back to the Finder to move or copy those files.

Quit tcsh when you're done by typing exit at the prompt.

Alternatively, you can use the Unix programs CpMac and MvMac, which are just like cp and mv except that they copy or move all forks that come with the file. The standard Mac OS X installation doesn't include these commands, however; they're available only if you install the Developer Tools (Section P.3.5.5).

The ditto -rsrcFork command also ensures that you don't lose resource fork data when backing up, as explained in hint Section 15.5.5.

15.6.9 Screenshots from Terminal

Just as you can capture screenshots in the Finder, you can also take them from Terminal. Simply type screencapture for a list of options.

For example, if you type:

screencapture ~/bigpic.pdf

you'll capture a full-screen PDF graphic, which gets saved as a file named bigpic in your Home folder. The program also lets you capture regions or windows onscreen using screencapture -i.

For information on these and other options, just type screencapture - -help.

15.6.10 Downloading Files from Terminal

If your home Mac has a permanent connection to the Internet, and you've turned on Remote Login (System Preferences [image] Sharing [image] Services tab), you can pull off a sneaky file maneuver that will likely save you a trip in the car. Namely, you can connect to your home machine via ssh while you're away at, say, the office, and start downloading large files from the Web that would otherwise have to wait for you to arrive home. Just imagine the possibilities...instead of waiting an hour after arriving home for that new 150 MB Castle Wolfenstein Multiplayer demo or the 200 MB Illustrator 10 demo to download, you can start them during your lunch break at the office by remote control.

And curl makes it all happen. Use it like this:

 curl -O ftp://name.of.site/name_of_file.ext

curl works with any kind of address that you type into a Web browser, including ftp, http, and telnet. The -O option tells curl to write the file to the same name as that of the provided URL. For instance, if the demo you wished to download comes from www.megagames.com and was named 3d_ultramaze.dmg, you would grab it with this command:

curl -O http://www.megagames.com/3d_ultramaze.dmg

When the download finishes, you'll have the .dmg file saved on your home Mac. Now just disconnect your ssh session with exit, drive home, and start playing the new demo within minutes of walking in the door. (See hint Section 16.5.7 for a related trick using the screen command.)

The curl command is quite powerful and can perform many other functions; type man curl to check out all its features. As an example, if you need to download 100 sequentially numbered image files from an FTP server, it's as easy as curl -O ftp://ftp.somesite.com/filename[1-100].txt.

15.6.11 Software Update in Terminal

Software Update is a handy way of keeping your computer up to date. But if you happen to use or administer more than one Mac—and you prefer to test all software updates yourself before installing them on other computers—you can't just use the "Automatic update" option. Instead, you have to test the updates, then walk to each machine to physically install them.

If you don't have time for that, there's still a glimmer of hope: provided you have remote access to all your Macs, you can run all the updates from Terminal (although still only one Mac at a time).

Use ssh to connect to the other Mac (see hint Section 6.3.3) and then type softwareupdate -l. If the remote machine has any updates to be installed, Terminal displays something like this:

Software Update Tool

Copyright 2002-2003 Apple Computer, Inc.

Software Update found the following new or updated software:

   ! iSync-1.4

        iSync, 1.4, 6720K [required]

To install an update, run this tool with the item name as an argument.

 e.g. 'softwareupdate <item>...

Thinking you can follow the instructions, you promptly type sofwtareupdate iSync-1.4, only to be informed "softwareupdate: Must be run as root." Plus, the other thing stopping you cold is that you need to use the -i (install) option. Therefore, the correct command is sudo softwareupdate -i iSync-1.4.

You can use the softwareupdate command on your own machine, but it doesn't have any particular advantages over the graphical Software Update program.

15.6.12 Check Software Update Every Day

As outlined in hint Section 5.7.1, the Software Update preference pane lets you set up a frequency to automatically check whether Apple has updated any parts of Mac OS X. Conveniently, you can do the same thing from Terminal, if you'd rather have your computer check for updates whenever you start a shell. All you need to do is add the following line to your .bash_profile file:

softwareupdate -l

This line makes it so that every time you fire up Terminal, or open a new session with bash, your Mac checks if there are any updates awaiting you. Checking this often might be overkill for some folks (it does take a few seconds, and it requires an active internet connection), but if you have a remote Mac that you connect to via ssh, it's a good way to make sure that you're dutifully notified of any updates available.

15.6.13 Which Files Did Software Update Modify?

Occasionally, you may run Software Update and find that it has fixed something on your machine, but you don't get much detail on exactly what it's done. For example, you might want to know what files a Security Update modifies.

Luckily, Mac OS X keeps track of installed packages, including everything that comes in through Software Update. You can find details by looking in the /Library/Receipts directory, which is where Software Update keeps a record of the various patches that it has installed.

Move into this directory by typing cd /Library/Receipts. If you issue an ls command, the system displays a list of installed packages, like this:

$ ls

AirPortSW.pkg                           QuickTime65.pkg

AsianLanguagesSupport.pkg               SETI@home_OSX.pkg

BSD.pkg                                 Safari_1.2.pkg

BSDSDK.pkg                              SecurityUpd2003-10-28.pkg

Each of the .pkg items is a directory containing additional directories, at least one of which should contain a file name that ends in .bom. BOM (which stands for Bill of Materials) files provide details on what you've installed.

To find all the .bom files in your Receipts folder, you can use the find command (hint Section 16.1.4) by typing:

find . -name "*.bom"

Once you've secured this list of files, you can read any one of them by typing lsbom name_of_bom. For example, to see what was installed in the Mac OS 10.3.4 update, you'd type:

lsbom MacOSXUpdate10.3.4.pkg/Contents/Archive.bom | less

The | less at the end is not required, but it helps; most .bom files are rather lengthy, and the less command affords you paging control to make them easier to read. Widening your Terminal window can help too, since each line in the file can be quite wide (see Figure 15-8).

The output of the lsbom command shows one line for each file modified during the update. By studying the names and paths, you can get a decent understanding of just which files were modified by the installer.

15.6.14 Create Finder-Compatible Zip Archives from the Command Line

The built-in zip archive function in Panther (Control-click a file or folder in the Finder and select "Create Archive of [file name]") is a welcome addition to Mac OS X. In short, it makes compressing files a snap. However, if you're a command-line addict, you'd probably prefer another way to do it.

Those suffering from acute command-line-itis could use the bzip or gzip commands—available in all forms of Unix—but they delete resource forks and HFS metadata, which are important to your files' integrity. If you're sure your files don't have any of this metadata, then go ahead. Otherwise, you can use the ditto command to create archives that are exactly like those you make from the Finder. Run the command as follows:

ditto -c -k -keepParent -rsrc source destination

Figure 15-8. As you can see, a narrow Terminal window and lsbom output don't make for easy reading. Widen the window, reduce the font size, and you'll be able to see exactly what was installed (and where) by the chosen update.

In this case, source is the file or directory you want to archive and destination is the name you want to give the new archive file. For example, to create an archive of a directory named Swimsuits to a file named Swimsuits.zip, use:

ditto -c -k -keepParent -rsrc Swimsuits Swimsuits.zip

You'll now have a perfectly compatible zip archive that you can expand by double-clicking in the Finder.

15.6.15 Fast Unzipping from the Command Line

No, this hint isn't about opening your fly. It's about expanding a zip archive from the command line. As you saw in the previous hint, you can create zip archives from the command line as well as from the Finder. When in the Finder, you simply double-click a zip archive to expand it.

There are several different ways to unzip in Terminal, but by far the simplest is the Swiss-Army knife open command. After all, it's the command-line equivalent of a double-click.

open Swimsuits.zip

That's all. Your archive expands magically, and you can now access all its contents from Terminal, or from the Finder.

15.6.16 System Preferences

If you're curious about how Mac OS X stores preferences, then use the defaults command to view a list of programs with preference files. Just type:

defaults domains

This command inelegantly displays every program for which the system has stored preferences—a massive blob of text that scrolls on forever. To just view the preferences for a certain program in the list, type:

defaults read com.apple.iChat

Replace com.apple.iChat with whatever example you like from the massive blob that appeared when you used the defaults domain command.

Although you can change preferences using defaults write in Terminal, you're better off using a program's own Preferences dialog box (or System Preferences) when you can. That way, you won't accidentally set some setting incorrectly.

You might find Terminal useful, however, for changing settings that don't appear in the program's preferences area at all. For example, if you wanted to display the normally "invisible" files in the Finder, you could just type defaults write com.apple.finder AppleShowAllFiles true, and restart the Finder. Later, if you get sick of seeing all those normally hidden files, just rerun the command with false replacing true at the end.

The real trick, of course, is figuring out all these hidden preference settings. The best sources for these are the various Mac OS X Web sites—and the pages of this lovable book.

Before you go crazy changing settings via Terminal, review man defaults for details on how the system works.

15.6.17 A Quickie Batch File Renamer

When you operate on your files and folders in Terminal, you can use wildcard characters—asterisks that, in a search-and-replace operation, mean, "any characters can go here." For example, a search for pea* would reveal a list of files containing the words pea, peas, peak, peaks, pearl, pearls, peat, peats, and so on.

It would stand to reason, then, that you could use wildcards to rename a bunch of files. For example, you'd expect that the mv command, whose syntax is:

mv oldfilename newfilename

could change the word hand in all JPEG files (handball.jpg, handsome.jpg) to foot (football.jpg, footsome.jpg) like this:

mv hand*.jpg foot*.jpg

Ah, but you'd be wrong. The mv command isn't designed to rename more than one file at a time. Trying to manipulate multiple files in this way either produces an error message or, worse, erases some of the files you're trying to rename.

Using a mix of commands, however, you can build a file renamer that works on a bunch of files simultaneously. Alas, it doesn't work right if your file names have spaces in them; if you have space-free names, though, it can save you a wealth of time.

The command looks like this:

ls hand*.jpg | awk '{print("mv "$1" "$1)}' | sed 's/hand/foot/2' | /bin/sh

Granted, the above is a complex, compound Unix command, but its basics are actually easy to comprehend. Here are the specifics:

  • ls hand*.jpg outputs the list of files that start with "hand" and end with ".jpg."

  • | awk passes this list to awk, a very powerful, very complex pattern-matching language that identifies patterns and take actions accordingly. Here, it takes the results of the ls command (symbolized by "$1") and builds a new mv command out of them.

  • sed 's/hand/foot/2' is a simple search and replace. The command means, basically, "find the occurrences of hand, and replace occurrence number 2 with foot."

  • /bin/sh passes the string of commands to the shell, which then executes each command one at a time. You won't see any output from the command at all, though a quick ls (which presents a list of the files in the folder) will prove that it worked to rename your files:

ls foot*

foot1.jpg foot2.jpg foot3.jpg

If you're using this command for yourself, of course, replace the file names "hand" and "foot" with those that match your needs, but keep everything else the same.

If you find yourself using this hint often, consider creating an alias for it (hint Section 15.4.9).


15.7 Cool Commands

If all you knew of Unix was what you'd read thus far in this chapter, you might assume that it's a pretty utilitarian, programmery sort of language. And that would be a fair assumption. In truth, though, lurking deep within its exhilarating code, there's actually a fun, hidden side just waiting to bust loose.

15.7.1 View the Hidden Lord of the Rings Timeline

Your Mac OS X system contains many hidden tools and features, but it also contains its share of timewasters. Deep in the bowels of Mac OS X resides a list of major world events and the days on which they occurred. And within this list is a chronology of the steps that Frodo, Gandalf, and the others took in the Lord of the Rings. (No kidding.) To gaze at this timeline, run the following:

cat /usr/share/calendar/calendar.history | grep "LOTR"

You'll see a list that begins like this:

01/05   Fellowship enters Moria  (LOTR)

01/09   Fellowship reaches Lorien (LOTR)

01/17   Passing of Gandalf (LOTR)

02/07   Fellowship leaves Lorien (LOTR)

02/17   Death of Boromir (LOTR)

If you're curious, and want to see the rest of the historical event list, run this command:

cat /usr/share/calendar/calendar.history | more

The command above is sent through the more pager so you don't see the entire span of history pass before your eyes in a split second. Press the Space bar to see more (get it?), and press q when you've finished and want to quit the pager.

15.7.2 Checking Dates

Unix also has a handy-dandy calendar command, cal. It's ideal for times when you're in Terminal and want to know which day of the week a given date falls on.

On its own, cal displays a calendar for the current month, like this:

February 2005

 S  M Tu  W Th  F  S

       1  2  3  4  5

 6  7  8  9 10 11 12

13 14 15 16 17 18 19

20 21 22 23 24 25 26

27 28

If you add a year (cal 2006), cal displays a 12-month calendar for that year. If you add a month and year (cal 4 2006), cal displays a calendar for that particular month and year. OK, it's not much, but it's a lot faster than opening iCal.

15.7.3 The Command-Line Calculator

Say you're working in Terminal and you need to calculate how much that stone lion for your villa in France is going to cost you with tax. You could always switch to Apple's Calculator program, but that requires using the mouse and leaving Terminal—hence, a big waste of time.

Instead, use Terminal's freeware calculator, bc. Type bc to start the program, and then type your expressions on the blank line.

For example, try something like this: 3+4*(5-2)+10, and then press Enter for the result: 25. Try 50/4*(10*10) to get 1200. Finally, type quit to end the program.

Type man bc for a very detailed explanation of the program and its features.

15.7.4 How Long Has Your Machine Been Running?

Barring any restarts, Mac OS X is perfectly happy to run for weeks or months at a time. To find out just how long your machine has been running since you last rebooted, use the uptime command—just uptime, nothing more—which generates something resembling this:

11:50AM up 19 days, 17:33, 3 users, load averages: 0.83, 1.08, 1.10

The "users" figure tells you how many people are logged in, although having multiple Terminal windows open will inflate this figure. The "load average" figures give you a rough measure of how hard your computer has been working over the last 1, 5, and 15 minutes, respectively; it can range from nearly 0 all the way up to 4, although load averages under 2 are much more common.

15.7.5 A Simple Benchmark Test

The openssl program is a cryptography toolkit for scrambling top-secret information, but that's not what you'll use it for in this hint. Instead, you can use it for its built-in benchmarking program—perfect for comparing different machines' speeds. (Unfortunately, the program doesn't take into account different operating systems, so you should use it only to compare Macs running the same OS.)

Open Terminal and type openssl speed. Then wait...and wait...and wait. The openssl program generates encrypted keys (passwords). Truth is, you don't actually care what it's doing; you're just happy that it's giving your Mac's speed a real workout, and that you can repeat the exam on another machine.

After half an eternity, the program displays its final results, which look like this:

  sign verify sign/s verify/s

rsa 512 bits 0.0034s 0.0003s 296.4 3138.9

rsa 1024 bits 0.0197s 0.0011s 50.7 921.5

rsa 2048 bits 0.1306s 0.0039s 7.7 256.8

rsa 4096 bits 0.8850s 0.0140s 1.1 71.4

  sign verify sign/s verify/s

dsa 512 bits 0.0032s 0.0039s 313.7 256.1

dsa 1024 bits 0.0109s 0.0126s 91.7 79.4

dsa 2048 bits 0.0373s 0.0456s 26.8 21.9

The higher the number in the far right side of each row, the faster your machine is.

15.7.6 top and Other System Speed Indicators

When you type top and press Enter, you get a neat little table that lists every process (program and background operation) that's currently running on your Mac, including the obscure background ones you may not even know exist (Figure 15-9). You also get statistics that tell you how much memory and processing power they're sucking down.

Figure 15-9. The top display remains onscreen, automatically updating itself as you work, until you type q to quit the program. (The plain-English program names are listed on the left.)

top boasts a number of command-line options. For example, if you type top -u, you get a list sorted by CPU usage, meaning the power-hungry programs are listed first.

You can also include a number at the end of the command, which restricts top to displaying only that number of processes. So if you want to view the top 15 CPU-hungry processes, just type top -u 15.

Processes:  69 total, 2 running, 67 sleeping... 228 threads  12:14:39

Load Avg:  0.80, 1.14, 0.97   CPU usage:  22.3% user, 20.0% sys, 57.7% idle

SharedLibs: num =  116, resident = 28.3M code, 2.83M data, 7.79M LinkEdit

MemRegions: num =  9441, resident =  229M + 21.4M private,  157M shared

PhysMem:  77.1M wired,  358M active,  189M inactive,  625M used, 14.9M free

VM: 5.12G + 80.5M   56491(0) pageins, 11369(0) pageouts

  PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  VSIZE

 2241 Microsoft   17.7% 21:20.08   5   105   392  39.2M  47.7M  46.4M   214M

 3462 top         15.3%  0:05.11   1    16    26   332K   324K   708K  27.1M

 2425 Terminal     2.4%  1:16.67   5    78   198  2.84M  15.2M  16.0M   117M

 3327 SystemUISe   2.4%  0:13.16   2   123   319  2.95M  12.1M  9.36M   121M

 1512 WindowServ   1.6%  9:56.76   3   341   735  7.70M+ 53.4M+ 57.6M+  167M+

    0 kernel_tas   1.6%  4:08.10  41     2  1696  12.9M     0K  62.6M   623M

 1583 Microsoft    0.8%  5:21.01  10   215   333  18.6M  53.1M  44.9M   202M

 1580 Safari       0.0%  6:36.51   9   260   631  72.8M  24.1M  91.1M   203M

 ... ... ...

Obviously, the display has a lot of information buried in it, some of it about as interesting as the ingredients in a can of Raid. Skip the header and look at the list of running programs to see what's eating up your computing power.

In this example, a Microsoft program is taking up 17.7 percent of your processing energy (how typical), the top command itself is hogging 15.3 percent, and so on.

As the display updates, keep an eye on processes near the top of the list that may be taking up more than their fair share of the CPU's attention. For example, Mozilla (Section 12.5) occasionally slows down as it processes text and displays pages. But if top tells you that Mozilla is using more than 60 percent of the CPU when it's sitting idle, you know something is wrong. Quit and restart Mozilla to clear the problem, and check top to make sure the browser's CPU usage is back to normal.

15.7.7 Set a Reminder with leave

You've got to go. No, wait, just a few more minutes. If you don't hurry you'll miss the train.

Rats. It's too late.

If you're a Terminal addict, this situation probably happens a lot: you're slaving away at the command line and you forget what time it is. You miss your train, your movie, a ball game, or your first date. If only you could set reminders for important events, so even if you don't glance at the menu bar clock, you'll still know when it's time to go. How clutch would that be?

Well, your prayers have been answered, as the leave command was designed for this precise purpose. Just type leave and press Enter.

When do you have to leave?

Now, type the time you need to leave in a 24-hour format (1520 would be 3:20 p.m., for example). The leave command then displays a confirmation of your alarm:

Alarm set for Wed Mar 24 15:20. (pid 623)

The process ID (PID) in parentheses is important. Since the leave command runs in the background, the only way to stop its inexorable countdown is to kill the process using the PID.

Five minutes before your alarm time, and again one minute before, leave tells you how much time is left. Then, when your time is up, the command displays Time to leave! and beeps. If you're not in front of the Terminal window, it keeps displaying these words and beeping until you come back.

But leave doesn't stop there. In fact, it won't stop beeping until you actually leave—by logging out or quitting Terminal—or by finally killing the process (if you really have to stay a few minutes more and finish that project).

15.7.8 Erase Rewritable Optical Disks Easily

In Panther, it's a real pain to erase optical disks. You need to open Disk Utility, insert a disc, click the Erase tab, and finally click Erase. Here again, the command line comes to the rescue. Apple has included the drutil command, which contains a full suite of functions for working with optical discs. (Type man drutil to see everything it can do.)

Now, when you need to erase one or more optical discs, simply run this command:

drutil bulkerase quick

This command opens your CD-ROM drive tray if you have one, or waits for you to insert a disc in your slot-loading drive, then starts erasing the disc. You'll see feedback like this:

Bulk RW Eraser

Please insert erasable media in MATSHITA CD-RW  CW-8123.

As the command erases the disc, a progress bar displays:

Erasing... [**************************       ] 64%

And when it's been wiped, the disc ejects and you can insert another one. When you've finished, just press Control-C to stop the command.

If you want to perform a full erase (which takes longer but erases every single spot on the disc), use the drutil bulkerase full command.

15.7.9 Eject CDs from the Command Line

Using the drutil command in the previous hint, you can also eject CDs. Why would you want to do that, you may ask? Well, say you have two CD drives—one internal and one external FireWire drive. If you press the F12 key to eject a CD, only the internal drive reacts, and you can't eject a disc from an external drive without manually dragging it over the Trash icon or clicking the Eject button.

With the drutil command, however, you can eject any disk, and you can even open or close the tray of a drive. Here are commands to do so to an external FireWire drive:

drutil tray eject -drive firewire

drutil tray open -drive firewire

drutil tray close -drive firewire

See man drutil for all the other neat things you can do with this command.

15.7.10 The Incredible Talking Terminal

For some, a talking computer can be a totally rad practical joke; for others with visual impairments, it can be a lifesaver. The say Terminal command uses Apple's speech synthesis feature to speak any text you type into a Terminal window out loud. Try this for starters:

say "hello $USER"

You'll hear your Mac say hello to you, using your user name, and with the default voice. (You can set your favorite voice in System Preferences [image] Speech.)

For those times when "hello" just isn't enough, you can have the say command recite longer texts as well, as long as everything's on one line:

say "Four score and seven years ago our fathers brought forth on this continent a new nation,

conceived in liberty and dedicated to the proposition that all men are created equal."

For long texts like the one above, however, it's easier to have your Mac read them from an existing plain text file, like this:

say -f Walden.txt

The -f option here tells the say command to read the contents of the file. If you don't include this option, it'll just say, "Walden dot t x t."

You can also send the result of any command into the say command, so your Mac speaks the results of the command. Try this:

ls | say

But there's more. You can also specify a voice (with the -v option) and tell the say command to save its output in an AIFF file, using the -o option (a great choice for saving spoken files on your iPod, for example).

say -v Agnes -f Gettysburg.txt -o Gettysburg.aiff

The say command even has correct pronunciation. Remember when Mac OS X first came out, and you weren't sure whether it should be pronounced as "X" or "Ten"? Well, say pronounces the letter "x" as "eks" in most cases, but if you tell your Mac to say "Mac OS X," it pronounces it correctly: "Mac Oh Es Ten."

Want to have some more fun with say? Try this, and the Mac will correctly speak the number (starting with "four hundred ninety-three octillion"):

say "493357190019862065623064333240"

say is also a must for practical jokes. Log in remotely to another user's Mac via ssh (Section 6.3.2), then send a say command to him, something like this:

say "I'm watching you, Dave"

He'll hear the text but won't know why it's being spoken. Now that's comedy!

15.7.11 Merge MP3 Files with the cat Command

You may be familiar with the cat command which—contrary to popular belief—does not meow, but instead concatenates files, or glues them together. While most people use this command to merge text files, you can also use it for MP3s. Suppose you have an audio book in many small files and want to join them into one long one. Send cat to the rescue:

cat Chapter1.mp3 Chapter2.mp3 Chapter3.mp3 > new_file.mp3

If your files are all in one directory, you can even use a wildcard (Section 15.2.8) to merge them (just confirm they're in the correct alpha-numeric order):

cat Chapter*.mp3 > new_file.mp3

If the MP3 files you merge have ID3 tags (identifying the artist, album, and so on), you may receive unexpected tags in your final merged file. To be on the safe side, remove ID3 tags before cat-ing your MP3 files.

You can also use the same command to merge .mov files (QuickTime files). Use the same syntax, just make sure the output file ends in .mov too.


15.8 Troubleshooting via Terminal

Because it offers a direct connection to the Unix core of Mac OS X, Terminal can help troubleshoot problems that may not be resolvable on the graphic side of the system.

15.8.1 Help! I Can't Empty My Trash!

If you happen to have a file stuck in the Trash—say, one that's locked and you can't unlock—it can be quite a pain to get rid of. The problem is usually related to permissions ,and Mac OS X doesn't like you messing with those.

You could, of course, head over to www.versiontracker.com to download any of several free tools for fixing the problem (Force Empty Trash, Super Empty Trash, and so on). You could also boot into Mac OS 9, if you have a pre-2003 Mac, and delete the file there.

Thankfully, a much easier alternative lies in the Terminal. Try this command:

 sudo chflags nouchg ~/.Trash/*

The nouchg keyword in the command instructs chflags to turn off the user immutable file flag, thereby unlocking the file. Once you've done that, you should be able to delete anything in the Trash through normal means.

If this command doesn't work, the problem file is not in the Trash on your boot disk. Rather, it was trashed from another drive or disk. In that case, you must remember which disk you trashed the file from, then execute the above command—but within that disk's Trash folder.

For example, if you have a disk named MyMusic, and that's where the file in question lives, the command would be sudo chflags nouchg /Volumes/MyMusic/Trash/*.

15.8.2 Finder or Dock Problems

On occasion, your Finder or Dock may stop responding. The Finder may not respond to mouse clicks (or even the Option- [image] -Esc "force quit" keystroke), or the Dock may refuse to add new items. If you have a Terminal window accessible, you can force either program to restart, which often clears up the problem.

In order to kill (exit) either the Dock or the Finder, you need to know its process ID number, or PID. In Terminal, type ps -ax | grep Finder, or ps -ax | grep Dock, depending on the program you want to quit.

ps (the "process status" command) shows the state of open programs on your machine. The -a option asks ps to display information on everything the Mac is doing. And the -x asks specifically for jobs that aren't associated with an active Terminal window—including the Finder or Dock.

You might see something like this, using the Dock example:

1522  ??  S      0:13.64 /System/Library/CoreServices/Dock.app/Cont...

3529 std  S+     0:00.01 grep Dock

The Dock process is the first line; the PID for the Dock is the first number displayed in the output (1522 in the example).

Now you can force the Finder or Dock to restart by typing kill 1522 (replace 1522 with the PID you just located, of course). Whatever you do, make absolutely sure you type the correct number, as the kill command terminates whatever process is associated with the PID you provide.

After you enter the kill command, the Finder or Dock restarts and—you hope—runs just fine.

If you can't access Terminal, and your Finder is unresponsive, your only recourse may be to press the Reset button on your Mac—which causes you to lose any unsaved data. For that reason, it's a smart idea to keep Terminal in your Dock all the time. This way, if your Finder locks up, you can still get to the Terminal through the Dock, and vice versa.

15.8.3 ^M Characters in Text Files

The cat command offers an easy way to open up a text file to read it (cat ~/Documents/README.txt, for example).

But if you ever cat a file and discover a whole bunch of ^M characters, chances are someone forgot to save the file with Unix line breaks (special characters that indicate the start of a new line). These characters can cause lots of problems with text files and scripts, since you may not even realize that the line breaks are wrong if you use a program like vi or emacs.

You can always use BBEdit to convert the line breaks (Choose File [image] Save, click Options, then set Line Breaks to Unix), but if you're working in Terminal, you can do the same with a one-line command:

 perl -pi -e 's/\r\n?/\n/g' file_name.txt

This one-line script (in the Perl programming language) searches the file whose name you specify, and converts all the Mac line breaks to Unix line breaks. It even works on batches of files, so you can fix a bunch of files in one pass by using a wildcard (Section 15.2.8) like *.txt or *.php.

You don't have to know why it works—but if you're interested, here's the breakdown: translated into English, the command reads, "Substitute every Mac return or line break-combination in the named file with just a new-line character."

The -p option tells perl to take action on every line in the file; the -i option tells perl to send the output of the command back to the same file it came from; and the -e option tells perl to execute the text, surrounded by single quotes, as if it were a script.

Since it's a pain to remember and type this command continually, consider creating an alias in your .bash_profile file (hint Section 15.4.9) as a means of simplifying the process. Be sure you get the quotes right, though:

alias alias_name='perl -pi -e "s/\r\n?/\n/g"'

You can, of course, name the alias whatever you wish. If you name it "fixit," for example, you could modify future files by simply typing fixit file_name.txt.


15.9 Terminal Help

An enormous number of programs have been written for Unix, with literally hundreds of them using Mac OS X. Funny thing is, you never see their icons, because they don't have icons; they're Unix programs, invisible until you type their names into Terminal and press Enter.

Each Unix command generally calls up a single one of these programs (or processes, as geeks would say) that opens, performs a task, and closes.

The most important way to learn about them is to try them out—although the following tips can help a little bit, too.

15.9.1 The Built-In Unix Manual

If you're new to Unix, the most powerful command you can put to immediate use is man. Man, which stands for manual, displays the Unix system manuals (that is, help files). For example, you can type man uptime to find out what the uptime command does. That's the good news.

The not-so-good news is that the manual pages for some commands are missing, incomplete, or confusing. Still, in most cases, the manual provides you with at least the basic information required to use a command.

The first manual you should read is probably the one for the man command itself, which explains the various command-line options available and, moreover, provides a couple of simple examples:

man man

One of the first things you'll notice is that the manual stops at the end of the first screen with a : character. You can scroll a page at a time with the Space bar (or see the next hint for other scrolling options).

If you ever need to refer to the ASCII character set (for programming or Web sites) man ascii is Johnny-on-the-spot with a helpful character chart.

15.9.2 The less Pager

When you read man pages (see previous hint), each screen scrolls by and then stops at a : character. The program controlling this paging activity is known as less, and its options can come in handy for reading text documents slowly.

Some of the more useful commands include b for moving back one page, f for skipping forward one page, and /, which searches for whatever text you type after the slash. During a search, n takes you to the next occurrence, and N returns you to the previous one. When you want to quit the pager—even if you haven't reached the end of a document—just press q.

As far as getting help for less, there are two methods: either type h while sitting at a colon prompt, or just type man less in the shell. The h command provides a Reader's Digest version of the manual; man less gives you the full story.

15.9.3 Printing Unix Manual Pages I

If you have a PostScript printer, you can print a nicely formatted man document from the command line using lpr. For instance, to print the man page for the ftp command, you'd type:

 man -t ftp | lpr

The -t option passes the manual through a second program named troff, which converts the pages into PostScript format for your printer. The pipe symbol (or vertical bar) takes the result of the man command and passes it onto the lpr command for printing. If your PostScript printer is on and connected, it now generates a nicely formatted hard copy of the manual page you specified.

UP TO SPEED Pipes

A pipe is a method of stringing two or more independent commands together to perform a desired action. In the printing example (hint Section 15.9.4), two commands (man and lpr) are combined to send a manual page to a printer.

You can actually use pipes to combine more than two commands, though. For example, occasionally you may need to quit and restart the Dock (hint Section 15.8.2). In Terminal, you do so by finding the process ID of the Dock (that is, the ID number given to it, behind the scenes, by Mac OS X) and then executing a kill command. This process normally requires two commands. By using a pipe, however, you can do pull off this trick with one command:

kill `ps -axc | grep "Dock" | cut -c1-6`

This command uses two pipes to send the output of ps (a list of running programs) to grep (a powerful search program), which searches for the word Dock. The result of these first two commands is then sent to cut, which clips everything except the first six characters on the line. Finally, the kill command is executed on the remaining six characters, which make up the job number of the Dock.

The backticks (`) around the piped commands (which you get by pressing the ~ key), send the results of the entire backticked sequence to the kill command. Without these backticks, the shell would try to run "kill ps -axc ...", which is an invalid command. With the backticks, however, the program first evaluates the commands inside them, and then sends the results of those commands to kill.

15.9.4 Printing Unix Manual Pages II

If you want to print a manual page, but don't have a PostScript printer (see previous hint), you may think luck's run out. Thankfully, though, you can download a non-Unix program to take care of the job.

Several freeware programs can open and print Unix manual pages. ManOpen (www.clindberg.org/projects/ManOpen.html) does a fine job of maintaining the original page's formatting and spacing when printed. Just launch either program, type in the name of the manual page, and select Print.

15.9.5 Help for Programs Without Manual Pages

If you've tried executing a man command for a given program and received a response like "No manual entry," all hope isn't lost. There are still a couple tricks remaining up the proverbial sleeve.

First, try typing the name of the program by itself, which may generate a simple help file. If not, try either of the following commands:

 program_name -help

 program_name --help

Most likely, one of these methods will give you help—or at least direct you to an appropriate Web site.

15.9.6 The Developer Tools

Whether you dabble with Terminal or do your lion's share of work in it, you may wish to install the Developer Tools (Section P.3.5.5). Although intended primarily for programmers, the Developer Tools let you convert a large library of Unix source code (the raw computer code) into compiled programs (versions particular to your computer, so you can run them). In addition, the Developer Tools include some useful programs for the non-Terminal side of Mac OS X.

Once you've installed Developer Tools, you wind up with a Developer folder on your hard drive. Inside, there's a Tools folder (containing programs that you use in Terminal) and an Applications folder (for regular, double-clickable Mac OS X programs).

After the installation, you may want to add the folders from the Developer Tools' installation to your path settings in order to use the additional Unix tools without having to type out their full names. This way, you could type MvMac instead of /Developer/Tools/MvMac, for example.

The path settings let your shell know where you keep the Unix programs on your hard drive—usually in various invisible folders like /bin, /usr/bin, and /usr/sbin. Terminal doesn't yet know about the Developer Tools folder, though.

To solve this problem, you must edit the path variable in the /etc/profile file, using the pico editor as described in the sidebar on Sidebar 15.4. But since this is a special file, owned by the system, you'll need to use the sudo command first (hint Section 15.4.5):

$ sudo pico /etc/profile

Once you've opened this file, you'll see the following:

# System-wide .profile for sh(1)

PATH="/bin:/sbin:/usr/bin:/usr/sbin"

export PATH

[ -r /etc/bashrc ] && source /etc/bashrc

Add the following to the section in quotes, right after /usr/sbin:

:/Developer/Tools:/Developer/Applications

For everything to function properly, make sure you insert colons, as shown above. Next, press Control-O (the equivalent of the Save command), press Enter to accept the file name, then press Control-X to exit the editor.

Back at Terminal's command line, type source /etc/profile to activate your modified settings. From now on, you'll be able to use the programs in the Developer Tools package just by typing their names.

15.9.7 Whatis I

Should you ever need to find a certain Unix program, try the whatis command—a command that explains other commands. In other words, whatis determines which command would be best for a particular task, based on the words you provide. For example, if you were interested in programs that dealt with printing, you might type:

 whatis print | grep "(1"

The whatis command looks for stuff related to print, since that's the word you plugged in. The grep "(1" bit restricts your results to section 1 of the man pages. Here's what each section contains:

  • Section 1 covers commands people can execute.

  • Sections 2-4 cover C libraries, system calls, and error numbers.

  • Section 5 covers configuration files.

  • Section 6 covers Terminal games.

  • Section 7 covers miscellaneous documentation.

  • Section 8 covers system manager's commands.

Of all of these, the only one the typical Unix fan is likely to be interested in is section 1. That's the section that contains information on commands that you can run from the Terminal prompt.

In essence, the purpose of grep "(1" after the pipe is to restrict the answers to commands that you, the user, can actually use.

When you hit Return after typing in the command above, you see output like this:

arch(1) - print architecture type

bpwhoami(1 - print the output of a bootparams whoami call

cat(1) - concatenate and print files

diffpp(1) - pretty-print diff outputs with GNU enscript

domainname(1) - set or print YP domain of current host system

... ...

This is a list of all commands that you can run whose short description contains the word print.

You can achieve the same explanations by using two other commands: apropos keyword or man -k keyword. Either one should return identical results; if they don't, refer to the next hint for a fix.

15.9.8 Whatis II

If you try to use the apropos command (see the previous Note), but receive an error message that says, "apropos: no whatis databases in /usr/share/man," then you don't have the whatis database installed. The fix is simple.

The list of words that whatis understands is built by your system from the programs installed on your machine. When you first install Mac OS X, this list doesn't exist. If you leave your machine on for at least a week, though—without turning it off at all—a weekly maintenance script quietly creates the database in the background. But if you'd like to create it immediately, type:

sudo /usr/libexec/makewhatis

After you enter your administrator password, your Terminal window sits for a couple of minutes before returning the command prompt. Thereafter, whatis should work as expected.


15.10 Fun Stuff

You've been working hard, and now it's time for a break. Welcome to the lighter side of Terminal.

15.10.1 Customizing Terminal's Welcome Message

When you open Terminal, it displays a friendly "Welcome to Darwin!" message every time (Darwin is a reference to the particular flavor of Unix that Mac OS X uses). You might prefer to have it say something more meaningful or entertaining, though, like "Cower in Fear, All Ye Who Enter Here."

The trick is to edit the file /etc/motd, using the pico editor as described in the sidebar on Sidebar 15.4. Because Mac OS X officially owns this file, however, you're not allowed to edit it—unless you blast past the security by using the sudo command (Sidebar 15.5). The complete command, then, is this:

sudo pico /etc/motd

Enter your administrative password when asked. Then replace the stock wording in the file with a message of your choice, and save your changes. Now, you can connect to "Tina's Terrific G5 Tower of Terror!" instead of Darwin.

In today's age of hackers, constant Internet connections, and big litigation over very small things, you may wish to consider a warning message, too. Something like this might do nicely: "This computer system is private. Unauthorized usage is strictly prohibited, and all activity is logged. If you are here by mistake, please close your connection window now."

While this message may not do much to stop a hacker, it may be useful if you were ever to reach litigation with someone who had hacked your system.

15.10.2 Removing Terminal's Welcome Message

If you'd prefer not to see any message when you open Terminal—even a customized one—type touch ~/.hushlogin.

Now, the next time you launch Terminal, the first thing you see is the command prompt. To return to the normal startup message, just delete the .hushlogin file in your Home folder by typing rm ~/.hushlogin.

15.10.3 Terminal as a Reference

Ever wondered where the 12345 Zip Code is? Or the airport code for Charlotte, North Carolina? Or the birthstone for August?

Normally, you'd use Google or some other search engine to find your answers. But bizarre as it may seem, Mac OS X includes, as part of Unix, files filled with much of this information. Plus, as an added informational aid, you can easily download and install files for other informational tidbits. If you're working in the Terminal anyway, you may find that it's faster to use the tools right under your nose. Simply type cd /usr/share/misc.

Now use the grep command—which searches the specified folder—to find the information you want. Type grep -i July birthtoken, for example, to find that month's birthstone and flower:

July:Ruby:Larkspur

The -i option tells grep to ignore capitalization.

If you want to look up Zip Codes, airport codes, country codes and more, you can find additional files to add to the directory by visiting here: www.openbsd.org/cgi-bin/cvsweb/src/share/misc/.

Click the version number of any file, and then click the download link to transfer the file to your machine.

The /usr folder is owned by root (Mac OS X itself), so you have to use sudo to copy the file after downloading, like this:

 sudo cp ~/Desktop/zipcodes /usr/share/misc/zipcodes

With these additional files, you'll be able to look up Zip Codes by using the command, grep 12345 zipcodes, which in turn produces the following:

zipcodes:12345:Schenectady, NY

And there's your answer.

Similarly, once you've downloaded the airport information, the command grep -i Charlotte airport produces this:

CLT:Charlotte/Douglas International

There's also a full table of ASCII character equivalents in this directory. Just type cat ascii to view it.

15.10.4 Converting from Meters to Feet

Ever need to convert 73 inches to centimeters? Or want to know how many kilometers there are in 648 miles? You could open up the Calculator program (hint Section 11.3.4), of course...or you could do it the macho way.

Here's a typical "conversation" with the units command. (What you type is shown in bold; what the Mac types back appears in regular type.

$ units

500 units, 54 prefixes

You have: 4 inches

You want: cm

*10.16

 / 0.098425197

The first line of the output is the result: 10.16 cm. (The second line is a factor that, when divided into 1, produces the same answer.)

In this example, units can work with 500 different measurements, covering categories like time, distance, mass, volume, length, wet and dry volumes, and much more. (The file even includes currency conversion rates, but they're not current, of course.) To see a list of all 500 units, type less /usr/share/misc/units.lib at the command prompt. For added fun, you can find out what wacky prefixes like yotta-, zetta-, and zopto- mean in this file.

One limitation of units is that it only performs conversions that work by simple multiplication (feet / 3 = yards). Temperature conversions (like Fahrenheit to Celsius—a conversion formula involving both multiplication and addition) are therefore out of the question.

15.10.5 A Really Big Banner

If you have a couple minutes to blow on some meaningless fun, try creating a new Terminal window with a very small font size (9 pts or so). Choose File [image] New Shell, and then choose Terminal [image] Window Settings. Set the top pop-up menu to Display, click the Set Font button, and then pick a small font size.

Make the window as tall as possible, and at least 135 columns wide. (As you drag the Resize box in the lower-right corner, Terminal shows you how wide the window is in the title bar of the window.)

Now type banner Hello world!, and see what happens.

You can control the font size of the banner message with the -w option; banner -w 50 Hello world! displays a more reasonably sized banner. What you choose to do with your newfound banner-creation skill is up to you.

15.10.6 Renaming the Trash Can

When you move your mouse over the wastebasket icon in the Dock, the name "Trash" pops up. If you'd like to change Trash to something more suitable ("Garbage," "The Bad and the Ugly," or "What Was I Thinking?"), you can do so without even breaking a sweat.

  1. In Terminal, type the following commands, one after another:

    cd /System/Library/CoreServices/Dock.app

cd Contents/Resources/English.lproj

sudo cp InfoPlist.strings InfoPlist.bak

sudo cp InfoPlist.strings ~/Desktop/InfoPlist.txt

    The first two lines switch you into the directory that contains the file you need to edit. The next line creates a backup copy just in case anything goes wrong (enter your administrative password when prompted).

    The last line copies the file to the desktop, where you can work on it with a friendly, non-Unix text editor like TextEdit.

    Leave the Terminal window open, switch to the Finder, and proceed.

  2. On the desktop, double-click the icon called InfoPlist.txt.

    It launches in your preferred text editor (usually TextEdit).

  3. Change the word "Trash" to whatever you'd like to call the icon instead.

    Don't make any other changes.

  4. Save your changes.

    TextEdit tells you that the file is write-protected, but also offers to try to overwrite the file. Choose Overwrite.

  5. Switch back to Terminal, and type the following commands:

    sudo cp ~/Desktop/InfoPlist.txt InfoPlist.strings

sudo chown root:wheel InfoPlist.strings

    These commands copy your modified file back to the proper location, and set the ownership back to the proper owner (root—that is, Mac OS X itself).

    Now quit and restart the Dock (hint Section 15.8.2) and test your changes by dragging the mouse over the Trash can. If everything worked, the new name for the Trash can pops up.

If you'd like to get the original name back again, return to 1-fm2xml, make sure you're in the right directory (as listed in the first step of this hint), and then type:

sudo cp InfoPlist.bak InfoPlist.strings

You might have thought that you could edit the InfoPlist.strings file with a command-line text editor; that sure would have been easier than going through the whole rigmarole above. Unfortunately, since .strings files are stored in Unicode (a special character set that offers more than just the basic alpha-numeric characters), the usual command-line editors can't read them. That's why you need to use graphical programs, such as TextEdit, to make changes.

15.10.7 The Secret Emacs Adventure Game

Emacs is a powerful text editor that you run from the command line. In addition to editing text with it, you can also use the program to launch an old-fashioned text-based adventure game.

Just type emacs -batch -l dunnet at the command prompt, and you'll soon be engrossed in a small but fun adventure game. If you grew up with text-based games like Adventure and Zork, you'll feel right at home. If not, type help and hit Enter.


Chapter 16. Intermediate Unix Hints

Chapter 15 describes some basic hints for working directly with the Unix foundations of Mac OS X. In this chapter, the hints are more advanced—sometimes very advanced—and assume more Terminal experience. In fact, the technical level of these hints may approach nosebleed territory for the Unix novice.

This chapter is for people who:

  • Are comfortable in Terminal and possess a strong working knowledge of commands like ls, mv, cp, cd, and sudo (all of which are described in Chapter 15).

  • Can create a new file from scratch using a text editor, like pico, vi, or emacs, add data to the file, save it, and then quit the editor (Sidebar 15.4).

  • Can open a file in a text editor (given only the file's name and path) and insert or delete lines in it (Sidebar 15.4).

  • Understand the concept of paths and placing programs in your path settings to ensure that the shell can execute them.

  • Understand the location and use of .bash_profile, /etc/profile, and the other related configuration files for the bash shell (Sidebar 15.3).

Many of these hints explain how to add stuff to the Unix side of your system—new utilities packages, scripts to accomplish certain tasks, a Web log analysis package, and even a package for running a Web forum.

You're not expected to retype all of the various scripts and commands described in this chapter. At www.macosxhints.com/book/103scripts.html, you can download a tidy text file that contains all of these commands and scripts already typed, for your copying and pasting pleasure.


16.1 Terminal for Productivity

While you may consider Terminal merely a tool for tweaking the guts of your system, the tools in the Unix side of Mac OS X can perform some tasks that are much more difficult—or even impossible—in the Finder.

16.1.1 The Unix Task Scheduler

The cron program is a daemon (background program) that's always working, even when you're logged out. For example, you can use cron to automate things like backing up files, updating a Web site, or cleaning up your desktop. You can even make your Mac serve as an alarm clock.

Basically, cron can schedule anything you can type at the command line. Unfortunately, it's cryptic, even for a Unix program. Here's how to bend it to your will:

  1. Decide what you want to schedule.

    For example, if you're trying to build a Macintosh alarm clock, decide when you want it to sound. Say you need it to blast twice each weekday, once at 6:15 a.m. and then again at 6:45 a.m. On weekends, you want it to go off at 7:30 a.m. Can't decide whether you'd like to wake-up to a shrill or a bleat? How about that old standby, the droning buzz? You have the wake-up sounds you want to use stored in MP3 files right on your hard drive.

  2. Using your favorite command-line editor (Sidebar 15.4), create a new empty file.

    Since cron can run even when you're logged out (it runs as root and doesn't know anything about paths or shells), you must explicitly tell it which shell to use, where files are, and where its Home directory is. The good news is, the settings are the same for every cron job you wish to create, so you don't have to remember anything other than these defaults:

    SHELL=/bin/sh

PATH=/bin:/sbin:/usr/bin:/usr/sbin

HOME=/var/log

  3. Add a comment line (beginning with #) as a reminder of the structure you want to use for the cron task itself (which will be the next line in the file).

    Structures adhere to the following format: minutes, hour, day of the month, month, day of the week, and the command to be followed. The comment line should always look like this:

    #min hour mday month wday command

    This step isn't necessary, but it'll help remind you how to enter cron tasks.

  4. Fill in the task's structure.

    The data corresponds to the headings in the comment line above, with tabs (not spaces) between each column entry, like so:

    15,45 6 * * 0-4 open /MyDisk/Users/MyName/Music/weekdays.MP3

30 7 * * 5,6 open /MyDisk/Users/MyName/Music/weekends.MP3

    You need two different tasks because you have two different sounds you want to play. Here's how to read the lines:

    The first column is for minutes, so in the alarm clock example, 15,45 runs the weekday task at 15 and 45 minutes past the hour. 30, meanwhile, runs the weekend task on the half hour.

    The next column is the task's hour, in this case 6 (for 6:00 a.m.) and 7 (for 7:00 a.m.).

    If you want an alarm to sound at 3:00 p.m., for example, you have to type 15. That's because cron uses a 24-hour, military format, where every hour after noon is greater than 12.

    The next two columns are for day of the month and the month of the year; an asterisk indicates that your task runs every day of the month and every month of the year.

  • The wday column indicates the days of the week your task runs; the days are numbered from 0 (Monday) to 6 (Sunday). Your weekday alarm runs Monday through Friday, 0-4. Saturday and Sunday alarms are 5 and 6, respectively.

  • The command column is the actual command you want cron to perform; it should be entered on one row. For your alarm clock, the open command is used to play the weekdays.MP3 file. (You must specify a full path in cron commands.)

  1. Save the file, give it a memorable name (like MyCronAlarms), and quit the editor.

    Now, it's time to feed your file of tasks to the cron program.

  2. Type crontab MyCronAlarms (or whatever you named the file), and then press Enter.

    To verify that the jobs are scheduled, type crontab -l. You should see your file echoed (printed) back to the screen.

    To set the alarm clock for other times, just change the settings in MyCronAlarms and then resubmit it to cron.

16.1.2 Comparing Two Text Files

From time to time, you may find yourself with two versions of a file and no memory of why you have both or how they're different. You could open them up in an editor and try to decipher what you changed from one to the other. But that requires half a day, tons of flipping back and forth, and the patience of a yogi. Instead, try using the diff command in Terminal.

The diff command figures out the key differences between two files. For example, consider the command diff foxes.html foxes2.html. The first file name after the diff command, foxes.html, is the "from" file; foxes2.html is the "to" file. In other words, diff looks at foxes.html and attempts to recreate the differences between it and foxes2.html.

That command might produce a display like this:

24d23

< <a href=\"foxes.php?op=editcomm\"><imgsrc=\"$uimages/conf_comments.gif\" border=0></a>&nbsp;&nbsp;\n

41d39

< if (mysql_num_rows(mysql_query("select uname from users where uname='$uname'")) > 0) $stop = "<center>".translate("ERROR: Nickname taken")."</center><br>";

54a53

>    # subroutine next week!

The first line, 24d23, breaks down as follows: 24 is the line number in foxes.html on which you took an action, d (for delete) is the action that resulted in the change in foxes2.html, and 23 is the corresponding line number in foxes2.html.

On the second line, the < symbol indicates that the rest of the line is in foxes.html but was deleted from foxes2.html.

The third and fifth lines (41d39 and 54a53) follow the format of the first line ("a" means text was added), and the fourth and sixth lines follow the format of the second. On the sixth line, the > symbol indicates that the row was added to foxes2.html. ("Who's on first? I dunno. Third base!")

Diff does not work on files that have Macintosh line breaks (hint Section 15.8.3).

16.1.3 Modify Power Management Settings with pmset

The Energy Saver preference pane gives you access to most of your Mac's power management settings, while the pmset command lets you tweak certain hidden settings and also gives you the ability to change settings on remote Macs.

First, use this command to view your current power management settings:

pmset -g

Currently in use:

 womp           1

 dps            0

 dim            0

 reduce         0

 autorestart    0

 spindown       10

 sleep          0

 acwake         0

 lidwake        1

 ring           0

Some of these settings have bizarre names. For instance, womp means "wake on magic [Ethernet] packet," and dps means "dynamic processor speed." You can learn what they all mean by typing man pmset.

These settings use two types of values: some settings, such as womp, use a 0 or 1 value, with 0 meaning off and 1 meaning on. Others, like spindown, use a number of minutes, which can be numbers other than 0 and 1.

You can find out what settings your Mac can use by running pmset -g cap; this command returns a list similar to that above, showing only those settings that you can change. For example, if you're not using a laptop, you won't have the lidwake setting.

Here are some examples of what you can tweak with pmset:

  • Set the disk spindown timer or the system sleep timer.

sudo pmset spindown 3

sudo pmset sleep 5

The first example sets your hard disk to spin down after three minutes (which is something you can't do in the System Preferences [image] Energy Saver pane). The second command sets your Mac to nod off to sleep after five minutes. As you can see, you need to preface pmset with sudo to run the command with appropriate privileges (Sidebar 15.5).

  • Deactivate the sleep function when pressing the power button.

If your Mac goes to sleep when you press the power button, you can turn off this behavior with the following:

sudo pmset powerbutton 0

Most laptops don't have the power button setting. To see which of these pmset functions your Mac has, run pmset -g, as just described.

  • Change useful settings for PowerBooks and iBooks.

Here are two settings that are well-suited for portables. The first tells your portable not to wake up when the lid is opened:

sudo pmset lidwake 0

The second prevents the machine from waking when its power source is changed (when you plug it in, for example):

sudo pmset acwake 0

Check out the pmset manual page for other settings you can change, including options for machines with an uninterruptible power supply (UPS).

16.1.4 Setting Permissions on Multiple Files

Some Web-based Unix programs, like phpnuke (a Web site management system) or phpbb (a forum software package; see hint Section 16.7.12), require that you set the permissions on a large number of files before you can use the application. Phpnuke's instructions, for example, direct you to "Set all files to 666 permission; set all directories to 777." If you had to change them by hand, you'd have to modify literally hundreds of files and dozens of directories.

Fortunately, you can use two Unix commands, find and xargs, to make the changes in a hurry.

For example, if you've installed phpnuke in Library [image] WebServer [image] [image] Documents, you can set the required permissions with the following two commands:

cd /Library/WebServer/Documents/phpnuke

find . -type f | xargs chmod 666

find . -type d | xargs chmod 777

The find command searches in your current directory (and all its subdirectories, as specified by the "."), for files (-type f ) or directories (-type d). The results of the search are then sent to xargs, a program that passes settings onto another program. In this case, that utility is chmod, a command for changing file permissions. In other words, all the specified files end up with 666 permissions, and all the directories wind up with 777 permissions.

These commands can be disastrous if you're in the wrong directory! If, for example, you were in your main hard drive folder instead of in the phpnuke folder, these commands would attempt to change the permissions on every file and directory on your hard drive, leaving them vulnerable to strangers.

The process does have some protection built-in, though, because you aren't running the command as root (with sudo; see Sidebar 15.5). Still, be sure you're in the right directory before executing these commands. (You can always run the pwd command to display the current directory, just to be safe.)

16.1.5 Create a Disk Image from a Directory in Terminal

Apple's Disk Utility program, located in Applications [image] Utilities, lets you create disk images (hint Section 11.5.1). But to create a disk image from a folder, you need to dig into its menus, which can be an annoyance if you're a true speed demon. Luckily, you can accomplish the same thing from the command line. Here's how you can do so from Terminal, using, as an example, your Sites directory.

  1. First, you need to find out how much disk space the directory holds:

    du -s ~/Sites

10432   /Users/kirk/Sites

    The du -s command returns the number of sectors for the directory. This information tells you how big the disk image must be. In the above example, there are 10,432 sectors. Add about 10 percent to this number to account for metadata; this rounds up to 12,000.

  2. Now, create the disk image file:

    hdiutil create -sectors 12000 -fs HFS+ -volname Sites ~/Sites

    This command creates a disk image called Sites in the current working directory. The disk image is formatted in HFS+ format and has 12,000 sectors.

  3. Next, mount the disk image file:

    hdiutil mount Sites.dmg

    You can check in the Finder to make sure it's mounted on the Desktop.

  4. Copy the contents of the directory to the disk image.

    Use ditto and the -rsrcFork option to maintain any resource forks that may exist:

    ditto -rsrcFork ~/Sites /Volumes/Sites

  5. Now that you're finished, you can unmount the disk image:

    hdiutil unmount /Volumes/Sites

    Although this process takes a few more steps than the method in Disk Utility, you can automate these Terminal commands with a shell script to make things move faster next time. Plus, the command- line method lets you create disk images over a network using ssh (hint Section 6.3.2).

16.1.6 Hide an Application from the Command Line

Picture this, if you will: you're working in Terminal, and you've got lots of other windows behind the Terminal window. Now, imagine you want to move some of them out of the way, and you want to do so from the command line. Here's a script that fits the bill:

#! /bin/sh

# hide an application in the Finder

osascript <<END

    tell application "Finder"

    if exists application process "$1" then

            set visible of application process "$1" to false

    end if

    end tell

Save this script, with a name such as hide, in a directory that's in your path settings (Sidebar 15.3). Make it executable by typing chmod 755 hide. From now on, you can run it as follows:

hide application_name

You'll need to type the actual application name that the Finder recognizes; for example, Microsoft Word (not just "Word") is the full name of the Office word processor. Remember to use quotes around any application name that contains spaces:

hide "Microsoft Word"

If this sort of script piques your interest, download the more powerful version from www.macosxhints.com/book/103scripts.html. This beefed-up script also lets you show applications, hide applications, and more.

16.1.7 Run System Profiler from the Command Line

Many command-line tools are useful when you're in front of your Mac but are even more valuable when you connect remotely, via ssh (Section 6.3.2), to another Mac. If you administer a pack of Macs, and you need to check certain information, it's a hassle going to each computer to do so.

You can use the command line to extract essential system information from any Mac you can connect to (as well as your own). Apple includes an application called System Profiler with Panther, which examines your Mac and returns information about its hardware and software. For administrators, this is nothing short of a dream come true. Thanks to the reports generated by this program, administrators can quickly and accurately check the computer's characteristics, how much memory it has, what peripherals are connected, which versions of applications are installed, and even how much disk space is used.

The system_ profiler command is the Terminal equivalent. It offers several options that determine how detailed its reports are. For example, the shortest version of the report looks like this:

system_profiler -detailLevel -2

Hardware:

    Hardware Overview:

      Machine Model: iBook G4

      CPU Type: PowerPC G4  (3.3)

      Number Of CPUs: 1

      CPU Speed: 933 MHz

      L2 Cache (per CPU): 256 KB

      Memory: 640 MB

      Bus Speed: 133 MHz

      Boot ROM Version: 4.77f0

      Serial Number: XXXXXXXXXX

Software:

    System Software Overview:

      System Version: Mac OS X 10.3.3 (7F44)

      Kernel Version: Darwin 7.3.0

      Boot Volume: Mac OS X

      Computer Name: Kirk's iBook

      User Name: Kirk (kirk)

The next level of detail delves much deeper. Running system_ profiler -detailLevel -1 adds detailed information about network communication (including the current IP address, memory), PCI and AGP cards, hard disks (including how full they are), optical disk drives, USB devices currently connected, and more.

Because this level of detail provides so much information, you may wish to run it through the less pager, which pauses the output after each screen output, in order to control how quickly it scrolls by.

Finally, you can run system_ profiler without specifying a detailLevel, which returns a very long report detailing the applications installed, frameworks and kernel extensions in use, and all the current system.log and console.log entries. This scheme can be quite handy for diagnosing problems remotely.

When running system_ profiler at this level of detail, though, it's generally not helpful to have its output displayed in Terminal. The output just runs for dozens of screens, and it's difficult to sort through. Instead, just redirect the profile into a text file, so you can open the file in your preferred text editor later:

system_profiler > profile.txt

Or you can save it as an XML file, making it even easier to examine:

system_profiler -xml > profile.spx

Double-clicking this .spx file opens your System Profiler application—a helpful trick if you secured the file from a remote Mac.

16.1.8 Fast User Switching from the Command Line

Fast User Switching is one of the most spectacular features in Panther—well, it is if your Mac has the appropriate video card to display the rotating cube effect. It allows you to switch from one active user account to another—without logging out. You can then return to the first account when you want to. What's more, you don't need to quit any applications to do this: just select the name of another user in the User menu (at the top right of the menu bar), enter the appropriate password, and you're in a different account.

Because the user menu takes up a lot of space, however, it'd be nice to have another way to switch, if possible. Naturally, using Terminal, you can do so with a simple command (enter it all on one line, with a space between Menu\ and Extras):

/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend

This command immediately rotates your account out of view and displays the Login window. Once there, you can select another user account, enter the password, and start working in a new session.

It's even more useful if you roll it into an AppleScript and add it to your Script Menu (hint Section 4.3.13). The appropriate AppleScript is as follows:

do shell script "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/

CGSession -suspend"

Once you have this script, you can turn off Fast User Switching in the Accounts preference pane to save precious menu bar space. Then you can just select the command from your Script Menu to switch user accounts.


16.2 File Sharing Hints

Mac OS X comes with a full set of tools and utilities for file sharing, but that's only the beginning. Much more flexibility awaits in Terminal.

16.2.1 File Sharing from the Command Line

You are the featured speaker at a food industry conference, and you've been asked to give your famous speech, "Soggy in Seattle: Why Salad Dressing Should Always Be Served on the Side," along with an accompanying PowerPoint presentation. You stride confidently to the podium, laptop tucked under your arm, ready to boot up and knock everyone out of their socks.

But then, wouldn't you know it...as soon as the laptop starts humming, you realize you forgot to transfer your presentation from your desktop computer. Initial response: you'll just hop online and grab your presentation via Personal File Sharing, which you activated on your home machine before you left. Or did you?

Alas, when you try to reach your desktop's files, you are summarily thwarted: you never switched on Personal File Sharing.

Fortunately, using ssh (hint Section 6.3.2) in Terminal, you can connect to your home machine, type sudo /usr/sbin/AppleFileServer, then enter your administrator password at the prompt and press Return. This command launches Personal File Sharing on your home machine. Congratulations! You can now access your home computer through the Go [image] Connect to Server command in the Finder.

If, for some reason, you need to turn off Personal File Sharing from the command line, type ps -ax | grep -i applefileserver, and then press Enter. Note the job number in the first column of the output, and then type sudo kill job_number within your ssh session.

16.2.2 Sharing Additional Folders with Windows

When it comes to making your Mac files visible to Windows computers on the same network, Mac OS X grants you temporary David Copperfield powers. This ability comes in particularly handy if you're sitting in front of a Windows machine three floors from your desk, and you need to pull up a document from your Mac.

For the magic to work, you must open System Preferences [image] Sharing [image] Services tab, and turn on Windows File Sharing. After that, you can reach your Home folder from any Windows machine on your network.

Unfortunately, your Home folder is the only folder you can access from a Windows machine this way. What if you have an external drive and want to share the files you store on it, too? Two solutions let you share any folder on your Mac.

The first requires turning on SWAT, the Web-based Samba administration tool, covered in hint Section 16.7.9. The second solution, in which you manually add additional folders to Samba's configuration file, is explained here.

  1. Open the Samba configuration file, with root permissions, in an editor like pico or vi.

    The file is named smb.conf, and lives in /etc. To gain root permissions when you open it, type sudo pico /etc/smb.conf (although you can substitute another editor's name for pico).

    The first lines of the file are all comments, denoted by the semicolon at the start of each line. Below the comments are sections labeled "[global]" and "[homes]," plus commented-out sections for "[public]" and "[printers]."

  2. To share a new folder, create a new section.

    For example, if your MP3 collection is stored on an external hard drive named MyMP3s in a folder named MyTunes, the following section would create a new shared folder called MyGreatMusic:

    [MyGreatMusic]

 comment = My MP3 Collection

 path = /Volumes/MyMP3s/MyTunes

 browseable = yes

 read only = no

 create mode = 0750

    The first line (in brackets) is the name of the folder as seen by Windows machines; you use the comment command to help identify the folder when it's being shared. The path command specifies the physical location of the folder to be shared. Setting browseable to yes lets Windows machines see the folder's contents. Setting read-only to no allows the contents of the folder to change from Windows machines as well.

    The create mode setting determines, in advance, the permission settings for any new files that are created in this folder. (Setting create mode to 0750 grants full privileges to the folder's owner, read-only privileges for the group, and no permissions for everybody else. See Chapter 2 for more on Mac OS X permissions.)

    To share additional folders, duplicate the section above, but change the name, comment, and path for each new folder.

    Once you've created all the shared folders (or shares) you need, save the smb.conf file and exit the text editor.

  3. Turn off and restart Windows File Sharing (in System Preferences [image] Sharing).

    You should now be able to log into your new shares from a Windows machine as easily as you can connect to your Home folder.

16.2.3 Protecting Your Windows Shared Folders

If you use Mac OS X's Mac-to-Windows file sharing services, you may wonder if your shared folders are secured from unauthorized access via the Internet.

The short answer: somewhat. Any attackers would need your account name and password to access the shared folders, and it's pretty unlikely they'd know that information (that is, unless you told them).

The long answer: you can do better. For starters, you can add an additional layer of defense by restricting which computers can connect to your shared folders.

Edit the smb.conf file by typing sudo pico /etc/smb.conf, and looking for the "[global]" section. Then add a line to the section, using the hosts allow option to specify which IP addresses (Sidebar 6.1) can connect to your shared folders. For example:

hosts allow = 192.168.1.

In this example, only machines on the local 192.168.1.xxx network are allowed access (of course, use an IP range that's suitable for your internal network). Save the file, and then restart Windows File Sharing in the Sharing preference pane.

You can use the hosts allow setting (and the related hosts deny setting) to do many more things. For the complete 411, type man smb.conf and search for "hosts allow."


16.3 Remote Access Hints

How do you manage a Mac that's hundreds of miles away? (And no, FedEx has nothing to do with it.) Why, from Terminal, of course.

16.3.1 Wake a Sleeping Mac Remotely

The Mac's remote-connection features are stellar, but they won't do you any good if your Mac's gone to sleep. To fix this predicament, go into System Preferences [image] Energy Saver [image] Options tab, and turn on "Wake for network administrator access."

At this point, you could also use Wake550, a freeware program from www.tc.umn.edu/~olve0003/wake550.html, to rouse the snoozing remote Mac.

Or, you could hit Terminal to send a little networking pulse called a magic packet to rouse your sleeping Mac. Harry Potter would be proud.

  1. Before you leave home, write down the sleeping computer's Ethernet and IP addresses.

    To do so, open System Preferences [image] Network, open the Ethernet section, and click the TCP/IP tab. The Ethernet address is a series of six, two-character letter and number combinations, like 01:34:63:be:20:ad. The IP address is four blocks of numbers, like 192.168.1.6. You'll need these numbers when it comes time to remotely wake your sleeping Mac.

    (Now you can leave your house.)

  2. At the new machine, open Terminal and create a script in a folder specified by your path settings. It should go something like this:

    #!/usr/bin/env python

import socket

s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

s.sendto('\xff'*6+'\x01\x34\x63\xbe\x20\xad'*16, ('192.168.1.255', 80))

    Make sure the last command (starting with "s.sendto") is all on one line.

    Copy the first three lines exactly. As for the last line, copy this part exactly: s.sendto(`\xff'*6+'.

    Then, after each remaining \x, enter the components of your Ethernet address. Replace the IP address in the example with your machine's actual IP address.

    Finally, enter the port on which the magic packet will be sent (in this example, port 80). Be careful to pick a port number that is forwarded through your router (if you have one) and that won't be blocked by your ISP (some block ports below 1024). Check with your ISP and/or system administrator to find an available port.

    Save the file and exit the editor when you're done editing (name it whatever you like, of course). Now, make sure it's executable (type chmod 755 filename).

Finally, run your script to awaken the remote machine. Once the sleeping machine is awake, you can access it via ssh, Apple Remote Desktop, or any other remote-access tool. Hey, just think of all the money you save in FedEx shipping charges!

16.3.2 Limit Which Users Can Access Your Mac via ssh

The ssh command lets you or others access your Mac remotely using Terminal. When you turn on Remote Access in the Sharing preference pane, this feature is automatically activated. As a result, anyone with an account on your Mac can access it remotely.

You can, however, restrict who has access to your Mac, by editing its configuration file. You might want to forbid your 10-year-old brother from using ssh, for example.

  1. Open the file /etc/sshd_config in your favorite Terminal text editor.

    If you use pico, run the command sudo pico /etc/sshd_config.

  2. Add the following line to the end of this file: AllowUsers username1 username2.

    Replace username1 and username2 with the user names of those people you want to log in via ssh. Add as many users as you want, separated by spaces.

  3. Restart ssh by turning off Remote Login in the Sharing preference pane, then turning it back on.

Now, if anyone attempts to log in through ssh with a username that's not in the list after AllowUsers, the Terminal will behave as if the account doesn't exist. Basically, it's saying, "Talk to the hand, 'cause the face don't want to know!"

If you have multiple users on your system, you can add an AllowGroups line to the sshd_config file. This arrangement permits only those people who are members of specific groups to connect. Type man sshd_config for more on the various options available.


16.4 FTP Hints

Real estate is all about location; Macs are all about convenience. It should come as no surprise, then, that you can connect to FTP servers from Terminal just as you can from the Finder or a Web browser. And with a little side help from Terminal's FTP program, which lets you download some very cool automation features, you can save oodles of time in the process.

16.4.1 Automating FTP Server Logins

When you use the ftp program to connect to servers, you must either include your user name and password in the command line or enter them when prompted by ftp. With help from a file named .netrc, however, you can make this process much simpler.

Make sure you're in your Home directory by typing cd ~, then type pico .netrc (use a different editor, if you prefer). For each FTP host that you connect to, add a line in the .netrc file that matches this syntax:

machine machine_name login user_name password your_password

For example, if you regularly connect to ftp.myfavoritestuff.com with the user name Wilson and the password beachplay, the .netrc entry would look like this:

machine ftp.myfavorites.com login Wilson password beachplay

Add a new row for every machine you regularly connect to, and then save the file and quit the editor.

Before you use this file with ftp, confirm that none of the other accounts on the machine can read it. Use the command chmod 700 .netrc to restrict the visibility of the file to just your account, so no one else can access your user name and password.

Now, type ftp ftp.myfavorites.com. Bam! You connect without providing a name or password.

By adding the following as the last line of the .netrc file, you can allow anonymous logins to servers that don't require a user name and password: default user anonymous password your_email_address.

16.4.2 Automated FTP Transfers

If you often transfer the same file to or from an FTP server (or do anything repeatedly with an FTP server, for that matter), Unix can help automate the process. The following script, for example, uploads an HTML file via FTP, thereby making it the new index.html file on the server.

  1. Use cd to switch to the folder where you're going to create the script.

    The best place to store it is in a folder in your path settings (Sidebar 15.3).

    Now, create the file (using any text editor you want):

    pico site_upload

  2. Enter the following text into the editor:

    #! /bin/sh

echo Uploading the new index page...

ftp <<**eof

open www.yourISP.comcd wwwdirascii

put /Users/user_name/Documents/newindex.html index.html

bye

**eof

echo FTP ended - your Web site is now marked as UP.

    Here's how the script works:

    • #! /bin/sh indicates this is a shell script (as opposed to a perl script or some other type).

    • echo Uploading the ServerUp page... tells Terminal to display the designated text (everything after echo) onscreen.

    • ftp <<**eof launches your FTP program and redirects all the lines between the **eof characters to it. The section of the file between the two **eof lines is known as a here doc.

      In this example, the here doc opens the connection, switches to the right directory, establishes ASCII mode (for transferring text), sends and renames the new index page, then disconnects.

      Replace the put command with whatever you require for your own site, including the proper paths and file names. If you want to transfer more than one file, just add more commands to the here doc. (If you need to download files, use the FTP command get instead of put.)

      Anything that you can do directly on the FTP server can be included in your script, making it a dynamite tool for automation.

    • echo FTP ended - your Web site now has a new index page... prints the specified text in Terminal.

  3. Save the file and quit the editor. Make your script executable with the following command:

    chmod 755 site_upload

    This command adds execute permissions to the file so you can run it as a script.

  4. In your Home directory, type pico .netrc.

    Since ftp doesn't accept user names and passwords from a here doc, you must provide a name and password in the .netrc file.

  5. Add this line to the file:

    machine www.yourISP.comlogin your_user_name password your_password

    Replace the placeholders with the name of your Web site, your user name, and your password.

  6. Save the file and quit the editor.

    Now that .netrc has your password in plain text, it's somewhat of a security hole. You should, therefore, immediately change the permissions on the file so that only you can use it.

  7. Use this command:

    chmod 700 .netrc

    chmod, of course, is the command for changing file permissions. The digit in the first position (7, in this case) tells Unix that you should be allowed to read, write, and run the file. The two zeroes that follow tell Unix that no one else should be allowed to use the file at all.

  8. To run the sample script from the current directory, type site_upload.

    Alternatively, in the Finder, Control-click the script's icon, choose Open With [image] Other, and then select Terminal (in Applications [image] Utilities). Double-click the script in the Finder to run it.


16.5 Shell Hints

Since the shell is where you spend much of your Terminal time, it's just good horse sense to have a shell that works efficiently. The following hints are all tips for maximizing bash.

16.5.1 Nixing Case-Sensitivity in Autocompletion

To amp up your efficiency in Terminal, use the autocomplete feature described in hint Section 15.2.5. Instead of typing cd /Library/WebServer/Documents, you only have to type cd /L W D. Ha...mere kid's play! (Just remember to press Tab after each letter to make Terminal complete the missing portions for you.)

While this feature is quite convenient, the shell is picky about what it autocompletes. For instance, if you improperly capitalize any portion of what you type, you'll get a beep instead of a completed path. Hey, what can you do? The shell is case-sensitive.

To fix this, simply add the following line to the .inputrc file in your Home folder:

set completion-ignore-case On

You need to set this variable in the .inputrc file, rather than, say, your .bash_profile file, since the autocomplete feature is part of the readline library, not the shell itself.

To return to case-sensitive behavior (for whatever reason), simply delete that line in your .inputrc file and launch a new session with bash.

16.5.2 Finding Files in the Current Directory

While locate is a super tool for searching your entire hard drive (hint Section 15.6.5), it can be cumbersome for more focused searches. To restrict locate to a certain directory, you must include the full path as part of the search string. Worse, any files you created since your last database update aren't included in the search.

Using the find program, however, you can apply virtually any set of restrictions to a search. The tradeoff? It's not nearly as fast as locate.

One of find's basic uses is identifying files that match a certain name or pattern. For example, to find all files that end in .html within the current directory, you would type:

find . -name "*.html"

The dot tells find to search from the current directory down through all its subdirectories, the -name setting tries to match file names with the pattern that follows (*.html), and the asterisk is a wildcard (Section 15.2.8) that instructs the shell to search for any number of characters before .html.

For any search string that contains wildcards, you must enclose the whole string in double quotes. Otherwise, the shell tries to search for the asterisk itself.

find lets you use a number of operators (settings, like -name), which you can mix with logical operators (like -and and -or) to combine conditions. For example, say you've created a new Help folder and used it to consolidate a bunch of help files (.help) from various subdirectories. You want to find all the remaining .help files, but you don't want the list to include the documents you've already moved. By combining operators, you can do just that:

find . -name "*.help" \! -path "./Help/*"

The first part of the command finds all files that end in .help. But the command includes another condition: \! -path ./help/\*. The exclamation point says to the find command "not" ; bear in mind that it must be preceded by the backslash so the shell won't interpret it as a special character. This "not" piece acts on the next operator, -path, which specifies the path to everything in the Help folder.

In other words, this command tells the shell to find all files in the current directory—and its subdirectories—whose name ends in .help, but that are not currently in the Help directory.

If you want to go nuts, find can help you catalog and identify all identical files that are bigger than 20 KB, for example. Use the following command in your Home directory (enter the text all on one line—not broken up as shown here):

find . -size 20 \! -type d -exec cksum {} \; | sort | tee /tmp/f.tmp | cut -f 1,2 -d ' '

| uniq -d | grep -hif - /tmp/f.tmp > ~/Desktop/duplicates.txt

The -exec flag is a powerful feature of the find command: it lets you run a command on the search results. When you use the -exec flag, it must end in a semicolon, which must be preceded by a backslash. The empty curly brackets ({}) tell find to execute the specified command on every result of the find. Meanwhile, the cksum command sizes up each file identified in the find command.

After the command runs, open duplicates.txt on your desktop. You'll find a list of all the duplicate files in your Home directory.

For more information on the find command, spend some time reading man find.

16.5.3 Counting the Files in the Current Directory

Terminal offers no obvious way to see how many files the current directory holds. This limitation can be quite a hassle when you're trying to determine if two different directories are identical (counting the number of files is a good, quick first check to make). Using a pipe (or vertical bar), however, you can fashion an effective tally command.

Typing ls | wc -l makes Terminal display the number of visible lines in the current directory listing. It works by sending the output of the ls command to wc, a word counting utility. The -l option on wc returns the number of lines in the ls output, thereby telling you how many files are in the folder.

This trick won't work for regressive ls commands—that is, it doesn't work when you're using ls -R to list the current directory and all subdirectories inside it. That's because the -R option adds a blank line and identifying row ("~/Documents/Homework to do") to each directory listing, and these extra lines throw off the total file count.

16.5.4 Authorizing Alternate Shells to Use FTP Services

In addition to the default bash shell, Mac OS X comes with the tcsh, csh, sh, and zsh shells for free. If you've installed another shell, though, (such as ksh), you may find that you can't FTP into other Mac OS X computers.

The culprit is a file named, confusingly enough, shells that lives in /etc. This file contains a list of shells from which the FTP server will accept connections. If your alternate shell is not listed, you won't be able to connect.

The fix is simple. On the computer you want to connect to, edit the shells file (using sudo, as the file is owned by root), and add a line with the full path to your newly installed shell. Save the changes. You should now be able to connect from the machine running the alternate shell.

16.5.5 Shell Scripts in the Finder

If you use shell scripts, you can easily make them launch from the Finder. Just add .command to the end of the script's name to turn it into a standard, double-clickable icon. Houston, we are now ready for launch.

Of course, you need to make sure the script has the ability to execute permissions first. Type chmod 755 script_name to execute permissions.

16.5.6 Trace Program Execution in Real Time

Ever wondered why a certain program takes so long to start up or why a program makes you wait a moment after you click an object within it? Sure you have.

Well, a program called ktrace exists to sate your curiosity. Basically, it reveals exactly what happens while another program is running. For example, to see what happens when you run an ls command, type ktrace /bin/ls. The resulting output is stored in a file named ktrace.out in the directory from which you ran ktrace.

You can read this file using a utility called kdump. The ktrace.out file is relatively long, so you'll probably want to read it by typing kdump | less to scroll at your own pace.

You could also use kdump | grep some_search_term to find a specific word or phrase in the file.

Although the output of ktrace on the ls command might not be terribly interesting, you can also use ktrace to see what your regular Mac OS X programs are doing, too. To use ktrace on Mail, you'd type:

ktrace /Applications/Mail.app/Contents/MacOS/Mail

This command opens Mail behind your Terminal window. Switch to Mail, do a little work, and then quit it. ktrace now stops running, too. To inspect its output file, use kdump.

You'll be able to see which directories Mail.app is looking at when it scours your hard drive in search of the various pieces it loads when it runs. Such knowledge can be very helpful for trying to figure out where certain icons, images, or sounds are stored, as shown in Figure 16-1.

You might wonder, why use Mail.app in this example instead of just Mail? Well, as you probably know, a typical Mac OS X program is actually a special folder called a bundle—and the actual program is called the executable inside that bundle. Section P.3.5.1 explains how to open an application's bundle icon to peruse its contents; you'll find a program's executable in its Contents [image] MacOS folder.

Like your waistline after a few too many Krispy Kreme doughnuts, your ktrace.out files can get pretty big, so feel free to delete them after inspection.

Figure 16-1. Here, ktrace has been run on Mail.app, and the results are being viewed with kdump. The output from kdump is sent through grep to find only files that contain ".tiff" in their names. This is a great way to figure out where certain icons, sounds, and images are stored within a given application.


16.6 X11 Hints

Panther includes full support for Unix applications based on the X Windows system, opening up a whole new world for Mac users. Based on the Xfree86 project, this environment includes a window server (the Unix equivalent of the Aqua environment), the necessary programming libraries, and Xterm, a terminal application.

You launch the X11 environment by double-clicking the X11 application, which is housed in the Applications [image] Utilities folder.

If it's not there, then you didn't install it when you installed Panther. You can do so now from disc 3 of your Panther CDs: just double-click the Packages folder of the CD, double-click the X11User.pkg file, and follow the Installer instructions.

With all the work you now have under your belt, you'll feel right at home running X11 applications. You can minimize windows to the Dock, copy and paste data between X11 applications and Mac OS X applications, and use any three-button USB mouse in X11 with no additional configuration. X11 also uses the keyboard layout you've selected in your Panther preferences, so you don't have to worry about confusing Unix and Mac layouts.

There are three ways to install X11 applications: using a standard Mac OS X installer, compiling them from their source code (which requires that you install the X11 SDK, found on the Mac OS X Xcode CD), or installing them using Fink (hint Section 16.6.5).

Launching applications is simple as well. Either double-click an X11 application's icon—which opens both the X11 environment and the application—or select it from the X11 Applications menu.

To add applications to this menu, select Applications [image] Customize, click Add Item, and then enter the command and a name for the application.

Once you've added applications to this menu, you can also Control-click the X11 Dock icon, select Applications, and then choose the program you want to launch.

16.6.1 Use X11 in Full-Screen Mode

While you can work with X11 applications in a normal windowed mode—where each application has its own window and the X11 environment has its own menu bar—you can also switch to full-screen mode, giving you the same display you'd have on a Unix machine running X Windows.

To switch modes, go to the X11 preferences (X11 [image] Preferences), click the Output tab, and then turn on Full-Screen Mode. Once you close the window, you can toggle between full-screen and normal display by pressing Option- [image] -A.

You won't see other windows when in full-screen mode, so this arrangement is most useful when you're only working in X11 applications for a while.

16.6.2 Use Exposé to Switch Back to Aqua Apps

When you run X11 in full-screen mode (see previous hint) you need to use a keyboard shortcut to toggle between this mode and windowed mode. In addition, the default Exposé keyboard shortcuts (F9, F10, and F11) don't work; therefore, switching to an Aqua application can be a bit of a hassle.

The way to simplify things is to set a hot corner to activate Exposé functions. For example, you can go to the Exposé preference pane and set the top-right corner to show all windows. When in X11 full-screen mode, just move your pointer to this corner to see all your open Mac OS X windows. To return to X11 full-screen mode, move your cursor to the corner again.

16.6.3 Set Xterm Dimensions

When you open X11, a small Xterm window opens. Unlike the Panther Terminal, you don't have any preferences to set the size of this window or other options to adapt it to the way you work. Ah, but there's always a workaround.

Here's how you can tell Xterm to open its window to the size you want. Start by opening X11, then select Applications [image] Customize. You'll see an entry in the Applications list that looks like this:

Terminal     |     xterm     |     n

Double-click the xterm command field and add the -geometry setting. For example, to set it to 132 columns 50 rows, change the command to this:

xterm -geometry 132x50

Now, when you open a new Xterm window, it opens in your specified size.

There are other settings you can adjust by changing the Xterm command at startup. See man xterm for more.

16.6.4 Access Xterm Options

If you Control-click anywhere in the Xterm window, a menu appears, giving you access to some options and commands. (Unfortunately, you need to hold down the mouse to keep the menu around, plus this maneuver doesn't work properly with some multibutton mice.)

16.6.5 Getting X11 Applications with Fink

A Fink is more than just someone who spills the beans on your extra helping of ice cream. In computer-speak, it's also an open source porting system that helps you download and compile Unix applications for Mac OS X. When you install Fink, a vast new world of software unfolds right at your fingertips. At print time, Fink provides more than 2,800 programs, ranging from abiword, an open source word processor, to the KDE window manager.

Fink is not required for running X11 applications, but it simplifies compiling, installing, and updating them. It doesn't download and install just X11 applications, either—it installs all kinds of Unix commands and tools. Although you can download source code for Unix tools and compile it yourself, Fink offers a streamlined system for dealing with complicated software dependencies and updates. To get started:

  1. Download the Fink installer.

    To use Fink, head to http://fink.sourceforge.net/download/, then download the latest version of the Fink Binary Installer.

  2. Install Fink.

    Mount the Fink Installer disk image, then double-click the Fink Installer.pkg file. This package installs the basic Fink tools and a small sample of additional programs. Near the end of the installation process, you're presented with a dialog box asking whether you'd like to install a special file; click OK.

    If, for any reason, this command returns an error, double-click the pathsetup.command file in the Fink disk image to fix it.

  3. Create Fink's index.

  4. Run the following command in Terminal:

    fink scanpackages ; fink index

    This command updates Fink's index for all available packages (including Fink itself).

    Alternatively, you can use Fink Commander, a graphical interface for Fink, which is included in the Fink Installer disk image. If you want to work with Fink Commander, copy the application to your Applications folder, double-click to open it, then select Source [image] Scanpackages.

  5. Update Fink.

    Even though you downloaded the latest version of Fink in step 1, there may have been minor changes since that release. Therefore, it's a good idea to update Fink itself. To that end, run the following command:

    sudo apt-get update ; sudo apt-get install fink

    This process usually takes a few minutes, depending on your Internet connection, as Fink downloads data for updates.

    The apt-get command is what you'll use to update and install other programs with Fink. While you can install programs directly from their source code using Fink's install command, doing it that way takes longer, and requires that you have the Developer Tools installed.

    As in step 3, you can use Fink Commander to update Fink if you want to avoid the command line (but, hey, you wouldn't be here if you were Terminal-shy). Select Binary [image] Update Descriptions, select the fink package in the package list, then select Binary [image] Install.

  6. Find out what programs you can install with Fink.

    Now that Fink is installed and up to date, you can check to see which packages are available. The fink list command returns a list of all the programs currently available. And wouldn't you know it, Fink Commander comes in handy here as well. The GUI program displays this list, showing the name, version number, category, and description for each available package. It also lets you sort by different columns and search for files within those columns. So, while you're likely to use Fink from the command line for many tasks, Fink Commander is the best way to check out what's available.

  7. Install programs with Fink.

    Now you're ready to install programs with Fink from the command line or with Fink Commander. Find a program you want to use, then run this command:

    sudo apt-get install [package name]

    Update your PATH.

    When you open a session with Xterm in X11, the bash shell used by default doesn't read your .bash_profile file. The command that's run during installation (see step 2) adds a line telling bash to read Fink's configuration file when you launch a session with Terminal—but not when you use Xterm. Therefore, you need to edit a file to be able to call commands installed by Fink from Xterm.

    Run sudo pico /private/etc/X11/xinit/xinitrc, and enter your password. Add the following line just after the first two lines that are commented out (prefaced with #):

    . /sw/bin/init.sh

    Save this file by pressing Control-O, then Enter, then Control-X. You'll need to quit X11 and restart it for this change to take effect.

    If you don't make this change, you can still launch Fink-installed programs from X11 by typing their full paths: /sw/bin/[command name].

  8. Launch some programs.

    To launch programs you installed with Fink, just type their names at the command line. Bear in mind that you may need specific options for some commands, so check the program's documentation by typing man command_name.

    Programs that run in the X11 environment require that you launch X11 first. The only exception is X11 programs that you install in locations where you can simply double-click their icons, such as Gimp (see hint Section 16.6.6).

In some cases, you'll receive an error message when trying to launch X11 graphical applications. If that's the case, add the following line to your .bash_profile file: export DISPLAY=:0.

16.6.6 Install and Use the Gimp

One of the most useful programs you can use with X11 is the Gimp. No, not your Uncle Morty. This Gimp is an acronym for the GNU Image Manipulation Program. A free program that's comparable to Photoshop, the Gimp provides just about the same features as its commercial cousin, as illustrated in Figure 16-2.

Figure 16-2. The Gimp offers most of the same functions as Photoshop, but for a much nicer price: it's free!

To run the Gimp, you first need to install X11 (Section 16.6); after that, the rest of the procedure is a piece of cake. Start by downloading a binary file for the Gimp from http://gimp-app.sourceforge.net. Double-click the disk image file, and then copy the Gimp program to your Applications folder. When you double-click the application, it automatically opens X11 and then launches the Gimp.

The first time you run the Gimp, you'll be guided through an installation assistant. When you've finished setting all your options, you'll see the Gimp's interface. (Be patient, it can take a while to launch.)

You may be disconcerted at first by the Gimp and its interface—for good reason. The windows and controls are less attractive than Panther's, and there's no menu bar, which means you access most of its menus by Control-clicking or right-clicking on an image. Nevertheless, you'll love the price and the broad range of functions it offers. In short, Gimp can do just about everything that Photoshop does.

16.6.7 A bin Directory for Personal Scripts

If you work regularly with shell scripts, you should seriously contemplate creating a bin directory (a directory in which to store your executable files) in your Home folder, or, alternatively, in your Documents folder. If you add this directory to your path settings (hint Section 15.9.6), the scripts you create will be available from anywhere within the shell. Now when you want to run a script, instead of specifying its full path (such as ~/Documents/bin/myScript), you can simply type myScript, and bash will find it.


16.7 Apache and Web Hints

One of Mac OS X's sweetest perks is its inclusion of Apache, an industrial-strength Web server that's used on thousands of popular Web sites. While you probably won't want to use your everyday Mac to serve up a site that millions of people hit every day, having a local Web server makes it a breeze to test your own site designs before they go public. It also makes it easy to serve up a small site directly from the machine for family and friends (assuming your Internet service provider allows such things).

16.7.1 The Apache Web Server Manual

The Apache manual is quite the detailed resource, with a plethora of definitions and examples of various configuration settings. You can find it online in the Documentation section of the Apache Web site, http://httpd.apache.org/docs-project/.

On the other hand, if you've turned on Personal Web Sharing (in System Preferences [image] Sharing), you can read the whole enchilada right from your hard drive. This arrangement is handy when you need info about working on Apache but happen to be somewhere without an Internet connection, like 35,000 feet over Denver.

In your browser, load your account's home page by typing http://127.0.0.1/~kirk (or whatever your account name is). Now click the Apache Manual link at the bottom of the page. Bingo! You're now browsing the Apache manual from your own hard drive.

16.7.2 Port Scans from Terminal

Mac OS X's Network Utility (in your Applications [image] Utilities folder) lets you run a port scan (a way to identify security holes) on any machine on your network—with one slight caveat. If you're connected to a computer remotely via Terminal, Network Utility won't work. Worse, Unix has no built-in port scanning tools.

But there is a secret loophole: all you have to do is use a program buried within the Network Utility program bundle.

First, confirm that you have a /usr/local/bin directory, and that it's stored in your path settings (Sidebar 15.3). If you don't have the directory in the first place, create it with this command: sudo mkdir /usr/local/bin.

Next, type this command, all on one line:

sudo ln -s "/Applications/Utilities/Network Utility.app/Contents/Resources/stroke"

/usr/local/bin/portscan

The above command triggers a bunch of key actions. It creates a symbolic link (something like a Mac OS X alias) to the stroke program, which Network Utility uses; names the link portscan; and stores it in your /usr/local/bin directory.

From now on, you can run your port scans directly from the Terminal by using the new portscan command. For example, type

portscan 192.168.1.150 0 1024

where 192.168.1.150 is the host to scan, 0 is the starting port number, and 1024 is the ending port number.

16.7.3 Installing a Command-Line Web Browser

The very idea of a Web browser—surfing the Internet using links and graphic information—may strike you as unworkable in Terminal's text-based screen. Yet a Terminal browser can be quite useful, particularly if you ever need to browse the Web while connected remotely to your Mac.

Among command-line Web browsers, links is a good choice. (It's not the same thing as lynx, a similar program that's not quite as effective.) Installing the program is not overly complicated, but it does require the Developer Tools (Section P.3.5.5).

  1. Head to the links home page, http://sourceforge.net/projects/links. Scroll down and click the Download link next to "links." On the next page, click to download the source files.

    Source files, of course, are the raw code that's required to build an application.

  2. In the Finder, expand the archive with StuffIt Expander.

    You're left with a folder named links-version_number. (The version number, of course, depends on the version you downloaded.)

  3. Switch to Terminal, and move into the new links folder using cd. Then set up links.

    To do that, type the following commands:

    ./configure --mandir=/usr/local/share/man

make

sudo make install

    The first command automatically configures all the compilation options (the settings for compiling the source code) and specifies that the man pages should be stored in the usual Mac OS X location for such things: /usr/local/share/man. The make command compiles (converts) the source code into an actual program, which can take a few minutes.

    Finally, the third command installs links.

  4. Type links in Terminal to fire up the program.

    Follow the onscreen directions for using the program. Just press the Escape key to see the program's menus, then press the first letter of one of the menus to view it. Type man links for more info.

16.7.4 For Web Designers Only: An Advanced Development Trick

If you're used to working with Unix-hosted Web sites by using an FTP program to upload them to the server, you may delight in Mac OS X's Apache Web server. Not only is Apache one of the most rugged and respected Web servers on earth, but it's loaded with useful features—including the ability to test your Web sites locally before uploading them to a separate server.

Working on more than one site at a time, though, can be a real hassle, because to switch from one to the other, you must type http://127.0.0.1/~username/site_name or http://127.0.0.1/site_name (depending on where you store your development pages).

Fortunately, Apache has a feature called name-based virtual hosts, which lets you serve an infinite number of sites from one IP address while providing each site with a unique URL. Even if you don't know the first thing about domain name servers (DNS), and you don't have a customized domain name of your own, you can put the power of name-based virtual hosts to work. The feature lets you store a client's work anywhere on your hard drive, yet reach each site with a unique name. Instead of having to type out that complex URL to open a site, you can just load www.smallfajitakitchen.site, for instance.

Suppose you're building one site for each of two major clients (Big Fred's Pizza and Small Fajita Kitchen), and you store their sites' HTML files in directories called ~/Documents/bigfredspizza and ~/Documents/smallfajitakitchen. During your testing period, you want the ability to load each client's pages with a unique URL that's not accessible beyond your own machine.

  1. Switch into the /etc directory by typing cd /etc, and then edit the hosts file by typing sudo pico hosts.

    The file has a few lines of comments followed by these three lines:

    127.0.0.1 localhost

255.255.255.255 broadcasthost

::1  localhost

  2. Insert two new rows after the 127.0.0.1 line:

    127.0.0.1 www.bigfredspizza.site

127.0.0.1 www.smallfajitakitchen.site

    Don't include the http://prefix, and stay away from .com, .biz, .edu, .net, and any other real-world domain endings. Use a fictitious name that's easy to type and remember. You could even use your account name (www.client1.chris), or whatever).

  3. Save the file and quit the editor.

    Next, edit the Apache configuration file to allow name-based virtual hosts.

  4. Type cd httpd to switch to the Apache configuration directory within /etc.

    The file you want to edit is named httpd.conf. Create a backup copy before you do anything else (type sudo cp httpd.conf httpd.conf.bak).

  5. Type sudo pico httpd.conf, and then enter your administrator's password when prompted.

    Of course, you can substitute any editor you like. (See Sidebar 15.5 for more on sudo.)

  6. Search for the string "### Section 3".

    In pico, you search by typing Control-W, followed by the search string, and then pressing Enter.

    A few lines below "### Section 3," you'll find a line like this:

    #NameVirtualHost *

  7. Change the "#NameVirtualHost" line to this:

    NameVirtualHost 127.0.0.1

    You've just removed the comment marker, making this line active. Furthermore, you've pointed the NameVirtualHost setting at your local machine.

    Next, add an entry to ensure that the normal http://localhost continues to work as expected.

  8. Leave the existing "<VirtualHost *>" line alone (it's already commented out). Insert the following lines below that example:

    # Enable http://localhost

<VirtualHost 127.0.0.1>

DocumentRoot /Library/WebServer/Documents

ServerName localhost

</VirtualHost>

    This section ensures that the existing behavior will work after you turn on name-based virtual hosts.

  9. Add entries for the two client Web sites just below the new entry you created.

    The entries should look like this (replace www.bigfredspizza.site and www.smallfajitakitchen.site with the names you chose):

    # Client Website #1

<VirtualHost 127.0.0.1>

DocumentRoot /Users/username/Documents/bigfredspizza

ServerName www.bigfredspizza.site

</VirtualHost>

# Client Website #2

<VirtualHost 127.0.0.1>

DocumentRoot /Users/username/Documents/smallfajitakitchen

ServerName www.smallfajitakitchen.site

</VirtualHost>

    Remember to replace username with your actual user name.

  10. Save the changes, quit the editor, and restart the Web server.

    You can restart the Web server in System Preferences [image] Sharing (turn the Personal Web Sharing checkbox off and on). Or you can do it in Terminal by typing sudo apachectl graceful.

    Once the Web server restarts, you should be able to access each client's Web site by typing http://www.bigfredspizza.site or http://www.smallfajitakitchen.site into your favorite Web browser.

Depending on which part of your hard drive you store these sites on, you may need to modify their group permissions (Chapter 2) to allow you to read them from a browser.

16.7.5 Jazzing Up Your Site: Server-Side Includes

Suppose you've created a basic Web site, one that you host on your Mac. It's nothing fancy, but it lets you keep your family and friends up to date on what's going on with your world-class Star Wars action figure collection. Just for kicks, however, you'd like to include some dynamic data—data that changes automatically, like a visitor count—at the top of each page.

Apache uses CGI scripts to handle placing dynamic data on Web pages. For your information, CGI stands for Common Gateway Interface, a system that allows you to run an external program (like a perl script) from within your Web server.

Most of the time, you simply want to embed a CGI script's output in an existing page. For example, maybe you want today's date to appear at the top of your home page—y'know, for those visitors who can't seem to remember which day of the week it is.

Apache lets you embed CGI scripts through a system known as Server-side Includes, which are instructions to the server on how to modify a page before sending it to the browser. Once you've turned on this feature, inserting the date at the top of your Web page becomes as easy as adding this line to your HTML file:

<--#echo var="DATE_LOCAL"-->

In order to turn on Server-side Includes, you must edit the Apache configuration file. While not massively complex, this process does require editing a file with root privileges and using a command-line text editor like vi, pico, or emacs.

The configuration file is named httpd.conf, and it lives in /etc/httpd. Before you begin, make a backup copy of it just in case you make a mistake somewhere along the line. To do so, type:

cd /etc/httpd

sudo cp httpd.conf http.mybackup

Later, if you make a mistake, you'll be able to revert to the original files by typing sudo cp httpd.mybackup httpd.conf, which copies your backup over the dysfunctional edited version.

Now that you're backed up and ready to go, it's time to open the configuration file.

  1. If you use pico as your editor, type:

    sudo pico httpd.conf

    If you don't use pico, type the same command but swap in the name of your editor.

  2. Once you've opened the httpd.conf file, search for ExecCGI.

    In pico, press Control-W to bring up the search mode. The search takes you to a line that looks like this:

    # "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".

    The line you need to edit is five rows below this:

    Options Indexes FollowSymLinks MultiViews

  3. Add ExecCGI +Includes at the end, with a space between each term, like so:

    Options Indexes FollowSymLinks MultiViews ExecCGI +Includes

    Now you need to tell Apache that files with a different extension (.shtml instead of .html) are also valid index files. If you skip this step, your index.shtml home page won't load if someone just enters your URL.

  4. Bring up a search again, type DirectoryIndex, and press Enter.

    The editor jumps to this line:

    # DirectoryIndex: Name of the file or files to use as a pre...

    Four lines below this is the line that sets the valid index types:

    DirectoryIndex index.html

  5. Add a space after index.html, and then type index.shtml at the end of the line.

    The result should look like this:

    DirectoryIndex index.html index.shtml

  6. Start another search, and type server-parsed.

    Now you jump to this line:

    # To use server-parsed HTML files

    Two lines down are a pair of lines that start AddType and AddHandler. Both begin with a #, which indicates that they're comments rather than commands.

  7. Remove the comment (#) symbols, but don't change anything else. Save your changes (in pico, press Control-O), and then press Enter to accept the given file name. Now quit the editor (Control-X in pico).

    The edits you made turned on Server-side Includes for any Web sites that you run from your Library [image] WebServer [image] Documents folder. (You can find out if you store pages there by entering http://127.0.0.1 into a Web browser and seeing if you get any results.)

    But if you store pages in your account's Home [image] Sites folder (which you can test by pointing a browser to http://127.0.0.1/~user_name), you need to make one more edit.

  8. Type sudopico users/kirk.conf.

    Type your own account name instead of kirk, of course.

    This file is merely a much smaller version of the main configuration file you just edited.

  9. Edit the second line so that it matches the Options line you created in the main configuration file, like this:

    Options Indexes FollowSymLinks MultiViews ExecCGI +Includes

  10. Save the changes.

    To enable Server-side Includes for other accounts' pages, you must change each user's configuration file separately. You can use ls to list the contents of the httpd/users directory and see all the accounts on your machine.

  11. Open System Preferences [image] Sharing, then turn the Personal Web Sharing checkbox off and on again.

    You can also perform this operation by opening a new Terminal window and typing sudo apachectl graceful. If everything goes well, you should see a message that reads "/usr/sbin/apachectl graceful: httpd gracefully restarted." (If things don't go well, you might want to use sudo apachectl configtest to see where the problems lie.)

  12. To test the Server-side Includes, create the following test.shtml file in any text editor:

    <HTML>

 <HEAD>

 <TITLE>

 My SSI Test Page

 </TITLE>

 </HEAD>

 <BODY>

 <b>Today is:</b><br>

 <!--#echo var="DATE_LOCAL"-

 </BODY>

</HTML>

    Save the file in your Home [image] Sites folder, and then type http://127.0.0.1/~your_user_name/test.shtml into your browser (see Figure 16-3).

This hint is just one example of what you can do with Server-side Includes. Spend some time reading the Apache manual (man apache) for examples of other clever tricks.

And if the CGI bug has really bitten you, try installing some of the hundreds of shareware, freeware, and commercial CGI scripts available. A decent place to start is the CGI Resource Index, found at www.cgiresourceindex.com.

16.7.6 Parsing Regular HTML Pages for CGI Scripts

If you use CGI scripts on your Web pages, then you've already turned on shtml processing in your httpd.conf file (see the previous hint). When you want to stick a CGI counter on a plain old HTML page, however, you have to rename the file with a .shtml extension so Apache will understand it.

Problem is, if you rename your files, you'll break all the links to them from the other pages on your site. So is it really worth doing that for a simple counter?

Figure 16-3. Once you've turned on Server-side Includes, you can add things to your Web pages that are automatically updated, like the current date and time. Provided everything works, you should be rewarded with something like this. If you don't see a display of the current date and time, go back and double-check your edits.

Conveniently, you can use the XBitHack flag (a special Apache variable), which tells Apache that files with the user-execute bit set should be treated like .shtml files. (The user-execute bit is a little flag that identifies those files that Terminal can run.)

Here's how you go about it. Open the httpd.conf file in a text editor, exactly as described in the previous hint. For example, type:

cd /etc/httpd

sudo pico httpd.conf

Search for "### Section 2". Now add the following line anywhere in Section 2:

XBitHack on

If you prefer to add this setting on a host-by-host basis (hint Section 16.7.4), you can also add this line inside a VirtualHosts section.

Save your changes and quit the editor. To make your changes take effect, stop and restart the server using sudo apachectl graceful, as described in the previous hint.

From now on, you can turn any "normal" HTML page into a page that'll be checked for CGI code, just by changing the file's mode to user executable. (To make the change in Terminal, type chmod u+x filename.html, where filename.html is the name of the HTML page with the included CGI code.)

Now, instead of renaming your index.html to index.shtml just to get a CGI-based date to appear, you can just type chmod u+x index.html to set the executable bit. Apache will see this file is executable when it loads it, and the XbitHack will therefore send the page through the CGI parser.

To turn this feature off, just delete the row from your httpd.conf file (or change on to off).

16.7.7 Running Apache and SSH Servers on Alternate Ports

It's very cool that Apache lets your Mac become a first-class Web site on the information highway. It's not so cool that your DSL or cable-modem company might deliberately block the port (networking channel) that would let you do just that. These companies assume that you're just a humble individual, not the next Amazon.com. Their biggest fear? That you'll launch a thriving commercial Web site out of your home, which could put a serious drag on the ISP's bandwidth.

ISPs often block the ports you need for ssh, too (hint Section 6.3.3). For example, SSH runs on port 22, Apache on port 80. Many providers block these servers simply by turning off all ports below 1024.

If Unix geeks know one thing, it's that you can fight software with software. This hint shows how to reassign your Apache and ssh servers to ports within your ISP's valid range. Each server requires a slightly different technique, ranging from the simple to the moderately complex.

16.7.7.1 The Apache server

You can run Apache on an alternate port by editing one line in the httpd.conf file (in /etc/httpd). Type this to open it:

sudo pico /etc/httpd/httpd.conf

(Or substitute your favorite editor for pico.)

Search for "# Port:" to find this section:

# Port: The port to which the standalone server listens. For

# ports < 1023, you will need httpdto be run as root initially.

#

Port 80

To use an alternate port with Apache, change 80 to a number that's outside the blocked range. One easy solution is to just add 5,000 to the port number, like this:

Port 5080

Save the file, quit the editor, and then restart the Web server either in System Preferences [image] Sharing, or in Terminal by typing sudo apachectl restart.

From now on, you can serve Web pages that anyone can reach, but you have to use a modified URL:

http://12.34.56.78:5080/index.html

Replace 12.34.56.78 with your Mac's IP address, and replace 5080 with the port number you chose. (You can find your IP address on the TCP/IP tab in System Preferences [image] Network.)

If your pages still don't load, it's possible that you haven't found an open port. Pick another number and try these same steps again.

16.7.7.2 The SSH server

The SSH server, sshd, is similary easy to edit. Its configuration file is called sshd_config, and it lives in the /etc directory. Once again, you need to edit the program using root privileges with sudo.

Once the file is open, look for the line near the top that reads:

#Port 22

Remove the comment marker (#), and then change the port number to a number above the restricted range (5022, for example). Save the file, head to System Preferences [image] Sharing, and restart Remote Login.

You can now remotely connect on the new port like so:

ssh -l username -p 5022 12.34.56.78

Replace 5022 with the port number you chose, and then replace 12.34.56.78 with your machine's IP address.

16.7.8 A Windows-Sharing Management Tool: SWAT

Luckily, Mac OS X 10.3 includes an easy method for sharing files with Windows machines (via System Preferences [image] Sharing, on the Services tab). There is one slight catch, though: the system doesn't let you set any preferences for this service—which folders to share, what rights to give them, and so on.

No problem. Samba, the Windows-sharing protocol used in Mac OS X, includes a management feature known as SWAT (Samba Web Administration Tool), which grants you complete control over Windows sharing.

  1. To turn on SWAT, open the /etc/xinetd.d/swat file, like this:

    cd /etc/xinetd.d

sudo pico swat

    xinetd is a process that controls Internet services. Instead of launching individual services at startup, Mac OS X launches xinetd and then hangs around waiting for somebody to request a service that it knows about. When it receives word that one is needed, it fires up the appropriate server. Services like xinetd are called super servers, because they have the power to start other servers.

  2. Once in the editor, you'll see the following lines:

    service swat

{

 port = 901

 socket_type = stream

 wait = no

 only_from = localhost

 groups = yes

 user = root

 server = /usr/sbin/swat

 log_on_failure += USERID

 disable = yes

}

    You need to change the last line, disable = yes, to read disable = no.

  3. Save the swat file and quit the editor.

    Next, you'll add your new service to Mac OS X's list of existing network services. This list is cleverly called services, and it lives in the /etc directory. Move up one directory by typing cd .. and then type sudo pico services to edit it.

  4. In services, search for "telnets."

    The cursor jumps to the beginning of this line:

    telnets  992/tcp

  5. Immediately above this line, insert a new line for the SWAT service you just created on port 901, like this:

    swat  901/tcp

    Although the services don't have to be listed in numeric order, it's much easier to find them in the future if you store them sequentially.

  6. Save the file and quit the editor. Back at the command line, force xinetd to reread its configuration file.

    For this operation, you'll send something called a HUP signal to xinetd. A HUP signal is the "Hang up" message, which instructs a process to exit. Confusingly, it has an entirely different function when sent to certain programs, including xinted. When xinetd receives a HUP signal, it reloads its own configuration file and restarts all the services. Here's the command:

    sudo kill -HUP `cat /var/run/xinetd.pid`

The section between the backticks (`) looks tricky, but it's only a shortcut to attain xinetd's process ID (PID).

Mac OS X keeps track of certain PID numbers in the /var/run directory; within that, each process has its own file that contains nothing more than its PID. The cat command shows the directory's contents, which the backticks dutifully send to the kill command. In other words, everything between the backticks is replaced by the PID number of xinetd, which is then used in the kill command.

You could do the same thing on two lines by first running ps -ax | grep xinetd and then taking the PID (the number in the first column) and using it as the argument for the kill command.

Once you have everything installed and running, you can load SWAT by pointing your browser at http://127.0.0.1:901. You'd need another entire book or two to lead you through the whole story of configuring Samba shares via SWAT, but the page you'll see in your browser offers a prominent link to Samba's documentation.

16.7.9 Apache's Server Statistics

You've created a modest Web site so your family and friends can follow your African violets' growth. Lately, however, you've noticed that your Internet connection seems slower than usual, and you suspect that your little site has become more popular than you originally planned. How do you tell if your hunch is correct?

Why, just ask your log files, of course! These are the documents where Apache nicely records all access and error information. Both access_log and error_log live in your /private/var/log/httpd directory.

The error log portion is usually relatively small; you can quickly browse around it to find any poor links, missing images, and glitches on your Web pages. On the other hand, the access log—which lists the volume of traffic on your pages, where your visitors come from, which files they most often visit, and so on—is a very large file, and quite hard to work with.

Luckily, the world is crawling with free log-analysis programs. A good one is the Webalizer. Figure 16-4 gives you a taste of the information that the program can generate and why its onerous installation process is worth overlooking.

Figure 16-4. The Webalizer traffic-analysis tool can help you figure out what your traffic flow looks like. This chart from October 2003 reveals that traffic peaks daily between 11 a.m. and 2 p.m., for example.

  1. Download the program from www.webalizer.com/download.html.

  2. You want the Mac OS X version listed in the "binary distribution" section. If it doesn't expand automatically when you downloaded it, double-click the compressed Webalizer file in your download folder. You now have a folder named webalizer (followed by the version number) ready for action.

  3. If you've never installed Unix programs before, type the following in the Terminal:

    sudo mkdir -p /usr/local/bin

sudo mkdir -p /usr/local/share/man/man1

    These commands ensure that the necessary directory trees exist. (The -p flag tells mkdir to create any and all of the structure needed for the final directory.) Skip this step if you've installed Unix programs before.

  4. In Terminal, type cd, press the Space bar, and drag the Webalizer folder into Terminal.

  5. When Terminal completes the path, press Enter.

  6. Now type the following:

    sudo cp webalizer /usr/local/bin/webalizer

sudo chmod 755 /usr/local/bin/webalizer

sudo cp webalizer.1 /usr/local/share/man/man1/webalizer.1

hash

    These four lines move the program into the directory where it will run, change the program from useless code into an executable application, install the manual pages so that you can get help by typing man webalizer, and tell the shell to re-examine the paths to find new executable code.

  7. You're now ready to analyze your Web log.

  8. Unless you want the analysis to wind up in the current directory, create a new folder in your home directory, called, say, WebAnalysis, and then type cd ~/WebAnalysis before running the program.

  9. Type webalizer/var/log/httpd/access_logto run the analysis.

  10. The Webalizer creates index.html and a number of support files in the new folder. Open index.html in your browser and follow the links to discover who's visiting your site and what they're doing while they're there.

The Webalizer is a very sophisticated program with a number of options that you can invoke from the command line or via a configuration file. Spend some time with the manual pages or on the program's Web site to learn how to get the most out of it.

16.7.10 PHP Scripting on the Apache Web Server

While hint Section 16.7.5 covers dynamic pages, it's certainly not a stretch to say that entire Web sites can be dynamic, too. A dynamic site is one that creates a page not just from some HTML files you have stuck in a folder, but uses programming code to generate different pages depending on who's viewing them and what they're looking for. Amazon.com is a classic example.

Mac OS X offers this feature at no additional cost. It includes PHP, a powerful scripting language for creating dynamic Web sites.

PHP is often used with the popular MySQL database package—covered in hint Section 16.7.11. Once you've activated the language and installed MySQL, you can download a variety of PHP-based packages that run goodies like chat rooms, forum boards, and mailing lists. (Visit the PHP Resource Index for an extensive collection of PHP scripts: www.phpresourceindex.com.)

Turning on PHP requires editing the same configuration file you mucked around with in hint Section 16.7.5: httpd.conf, which lives in /etc/httpd. Follow these steps to turn it on:

  1. If you haven't already done so, make a backup copy of httpd.conf. Type these lines:

    cd /etc/httpd

cp httpd.conf http.mybackup

    If you make a mistake, you can revert to the original by typing sudo cp httpd.mybackup httpd.conf, which copies your backup over the dysfunctional edited version.

  2. Open the configuration file.

  3. If you use pico as your editor, type:

    sudo pico httpd.conf

    If you don't use pico, swap in the name of your editor.

  4. Once the editor has started, bring up the search function (in pico, press Control-W), type php4_module, and then press Enter.

  5. The screen should jump to this line:

    #LoadModule php4_module

libexec/httpd/libphp4.so

  6. Remove the # sign, then search for mod_php4.

  7. Now the screen should jump to this line:

    #AddModule mod_php4.c

    Again, remove the # sign. Then search for index.html, which should take you to this line:

    DirectoryIndex index.html index.shtml

    (That last part—index.shtml—is there only if you've turned on Server-side Includes, as described in hint Section 16.7.5.)

  8. Add a space at the end of the line, and then type index.php.

  9. This change allows Apache to load your Web page whenever somebody types in the URL. (Otherwise, visitors would have to attach "index.php" to the end.)

  10. Search for x-tar.

  11. The screen should jump to this line:

    AddType application/x-tar .tgz

    Leave this line alone, but immediately below it, insert these two lines:

    AddType application/x-httpd-php.php

AddType

application/x-httpd-php-source

.phps

  12. Save the file, quit the editor, and then restart the Web server.

  13. You can do this step either in System Preferences [image] Sharing, or in Terminal by typing sudo apachectl restart.

  14. That's it! You've turned on PHP.

To test PHP, create the following file in any text editor:

<? phpinfo( ) ?>

Name it "test.php," and save it in your Home [image] Sites folder.

In your Web browser, load http://127.0.0.1/~username/test.php. You should be greeted with a page of information about the PHP environment, as shown in Figure 16-5.

16.7.11 The MySQL Database Server Package

MySQL is a free, open source relational database server that can run in a number of operating systems, including Mac OS X. (A relational database keeps data in tables that are all interconnected and easily accessed.)

MySQL excels in providing data to Web-enabled programming languages like PHP. In fact, PHP and MySQL combine to make a nearly perfect tool for creating dynamic Web sites. For example, the entire www.macosxhints.com site (both the hints site and the forum site) is driven exclusively by PHP and MySQL.

While MySQL isn't included with regular copies of Mac OS X (it does come with Mac OS X Server), you can rest easy knowing it is a free download.

Figure 16-5. New versions of PHP come out regularly. In fact, you may have an old one on your computer right now. Should you need to install a more current release, visit Marc Liyanage's www.entropy.ch site. There you can find an installer and easy-to-follow instructions that make the process nearly painless.

Point your browser to the official MySQL downloads page, www.mysql.com/downloads/mysql-4.0.html. (At this writing, MySQL 4.0 is the official version of MySQL.) On this page, scroll down to the Mac OS X downloads section and download the "Installer Package (Mac OS X v10.3)." If the file doesn't automatically expand when you download it, double-click the downloaded archive, and then mount the disk image.

On the disk image is a ReadMe.txt file, which is well worth reading. To install the database server, double-click the mysql-standard package file on the disk image, and follow the instructions. When the installer is done, you'll have a full-fledged database server sitting in the /usr/local/mysql directory.

Although now installed, the server is still not running. To launch the MySQL server, type the following in Terminal:

cd /usr/local/mysql

sudo ./bin/mysqld_safe

Control-Z

bg

These commands switch to the appropriate mysql directory, launch the server, and then interrupt the job (the Control-Z keystroke returns control of the Terminal to you). The bg (background) command moves the job into the background where it'll run silently.

The ReadMe file contains additional information on running the server. As explained in that file, the very first thing to do after the server starts is to assign a password to the MySQL root user (which is different from the Mac OS X root user, explained on Sidebar 15.5). Assign the root user's password with this command:

/usr/local/mysql/bin/mysqladmin -u root password 'new_password'

/usr/local/mysql/bin/mysqladmin -u root -h localhost password 'new_password'

Replace new_ password with the password you'd like to use. Once you've assigned the password, you can launch the MySQL command line interface by typing /usr/local/mysql/bin/mysql -u root -p. Be careful to put a space between -u and root, and enter the newly assigned new_ password when prompted after hitting Enter.

As shown in Figure 16-6, the MySQL interface isn't much to look at, but running the program and accessing a database proves the server is running.

Figure 16-6. It's not pretty, but this is the public face of the powerful (and free) MySQL database server. Here you can see the two sample databases (test and mysql), along with a number of other databases, such as Geeklog (a free content management system) and vBulletin (a commercial bulletin board package).

Before you try to put MySQL to work for you in a PHP script or some other Web-enabled program, spend some time learning about account security in MySQL. The MySQL Web site has excellent information on this subject; in particular, study section 4.3 of the online manual thoroughly.

While you're on the site, also check out the Mac OS X installation instructions page at www.mysql.com/doc/en/Mac_OS_X_installation.html. In addition to more detail on the steps provided here, the online instructions explain how to create a startup item that will automatically launch MySQL server whenever you boot up the Mac.

Just installing PHP and MySQL won't do much for you unless you're a full-fledged PHP and MySQL developer, though. Now you'll want something to show off all that power—something that doesn't require you to learn a ton about programming or database design. Like the next hint, for example.

16.7.12 Placing a Forum on Your Web Site

Many of the tips and tutorials in this chapter and the previous chapter have been leading up to this moment. This next tutorial pulls it all together. The instructions assume that you're comfortable in Terminal, and that you're running the Apache Web server with PHP enabled (hint Section 16.7.1) and the MySQL database package installed (hint Section 16.7.11).

Forum software is very popular on the Web because it provides a venue for people to exchange ideas and carry on conversations. Plenty of forum software packages are available, ranging in price from free to several thousand dollars. This tutorial will help you install the popular free forum software, phpBB, on your Mac.

The first step is to extract the software from www.phpbb.com. Click the Downloads button on the site to download the latest release to your desktop. Use StuffIt Expander to expand the package. You wind up with a phpBB2 folder on the desktop.

In the Finder, choose Go [image] Go to Folder. Type /L /W /D (pressing Tab after each letter) into the Go to Folder dialog box, and then press Enter. You'll see that Mac OS X expands that abbreviation to the /Library/WebServer/Documents folder. Drag the phpBB2 folder from the desktop into this Documents folder.

Before installing the forum software, you'll need to create a database for it to use. Open a Terminal window and start MySQL with a user account that has rights to create a new database, like this:

mysql -u phpbb_user-p

If you haven't specified your mysql folder in your path settings, you'll need to specify the full path for the command: /usr/local/mysql/bin/mysql.

Enter your MySQL user's password when prompted, and then create the database by typing create database phpbb.(You can name it whatever you wish, but you'll find it much easier later on if the database name is related to what it does.) At this stage, you can quit MySQL and then switch over to the phpBB2 directory:

cd /Library/WebServer/Documents/phpBB2

In order to run the Web-based configuration program, you need to tweak the permissions on the config.php script so that any account holder can make changes to it. To do that, type chmod 777 config.php.

Now, in your Web browser, go to http://127.0.0.1/phpBB2/install/install.php. You should see a "Welcome to phpBB2 Installation" message and a screen full of questions. This table shows you how to fill in the blanks:

Question | Answer
Default board language | Pick the most applicable language
Database Type | Select MySQL 4.x, since that's what you just installed
Choose your installation method | Leave unchanged as Install
Database Server Hostname/DSN | localhost
Your Database Name | phpbb (or the name you used instead)
Database User Name | phpbb_user (or the name you used instead)
Database Password | some_password, as defined earlier
Prefix for tables in database | Delete the prefix—t's unnecessary if you're not sharing one database with more than one program
Admin Email Address | Your email address
Domain Name | 127.0.0.1
Server Port | 80, unless you've changed it to another port (hint Section 16.7.7)
Script path | Leave unchanged as /phpBB2/
Administrator User Name | A user name you'd like to use
Administrator Password | A password you'd like to use
Administrator Password [confirm] | The same password again

After you've completed the form, click the Start Install button. If all goes well, you'll be greeted with another screen that lets you know the admin user has been created. It also shows you a Finish Installation button.

This button is a bit of a tease, though. Instead of finishing the installation, you'll be led to yet another screen. It contains some very important instructions on how to delete the install and contrib directories. (If you skip this step, phpBB will not work correctly.) So before you click the Finish Installation button, switch into Terminal and use these two commands:

rm -r /Library/WebServer/Documents/phpBB/install/

rm

-r /Library/WebServer/Documents/phpBB/contrib/

Now, click the Finish Installation button at the bottom of the same screen. If you've stuck with the program this far, you'll be rewarded by the phpBB administration screen, shown in Figure 16-7.

Figure 16-7. phpBB is a free, open source software program designed to help manage conversations on whatever topics you can dream up. With some hard work, you can install and run phpBB directly on your Mac OS X machine.

Before you spend too long figuring out exactly how to configure and use your new forum software, take a couple seconds to close a post-install security loophole by switching to the Terminal and typing:

chmod 700 config.php

This command resets the permissions on the config file so that other account holders can no longer read its values.

To take full advantage of phpBB, read the instruction manual in your browser by opening the file at http://127.0.0.1/phpBB2/docs/README.html. This document contains information on configuration, security, and other important topics.

You're now running an open-source, free forum site (phpBB driven by a combination of free and open source databases (MySQL), scripting (PHP), and Web serving (Apache) software. Congratulations!


Day Day Up

Colophon

Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects.

Marlowe Shaeffer was the production editor and proofreader, and John Cacciatore and Nan Barber were the copyeditors for Mac OS X Power Hound, Panther Edition. Philip Dangler and Claire Cloutier provided quality control. Caitrin McCullough and Mary Agner provided production assistance. Johnna Dinse wrote the index.

Ellie Volckhausen designed the cover of this book, based on a series design by David Freedman. Emma Colby produced the cover layout with Adobe InDesign CS using Adobe's Minion font.

David Futato designed the interior layout, based on a series design by Phil Simpson. This book was converted by Andrew Savikas to FrameMaker 5.5.6 with a format conversion tool created by Erik Ray, Jason McIntosh, Neil Walls, and Mike Sierra that uses Perl and XML technologies. The text font is Adobe Minion; the heading font is Adobe Formata Condensed; and the code font is LucasFont's TheSans Mono Condensed. The illustrations that appear in the book were produced by Robert Romano and Jessamyn Read using Macromedia FreeHand MX and Adobe Photoshop CS.

The online edition of this book was created by the Safari production group (John Chodacki, Becki Maisch, and Ellie Cutler) using a set of Frame-to-XML conversion and cleanup tools written and maintained by Erik Ray, Benn Salter, John Chodacki, Ellie Cutler, and Jeff Liggett.


index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]


index_SYMBOL

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

$ (dollar sign), Unix prompt
~ (tilde), Unix home folder


index_A

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

A Better Finder Rename
account information, iTMS
accounts
administrator and
features, limits
Home folder and
privileges, limiting
programs, limiting
Simple Finder
troubleshooting only
Acrobat Reader startup time
action scripts, folders
Activity Viewer (Mail)
add-ons
A Better Finder Rename
AP Grapher
application menus
Butler
charting software
Clipboard
Clipz
Cocoa Gestures
CopyPaste-X
CrushFTP
custom pop-up menus
Default Folder X
DejaMenu
Dock Detox
donationware
DropDrawers
freeware
FruitMenu
FTP server installation
gestures
laptop trackpads
LaunchBar
MaxMenus
MenuMeters
morphing software
MorphX
OmniGraffle
Open dialog box
Pacifist
Path Finder
program launchers
program switchers
Save dialog box
scanner drivers
shareware
SideTrack
SnapzPro X
System Preferences
TinkerTool
WindowShade X
X-Assist
Xounds
address bar
browsers, launch applications
Safari
hiding
window management
Address Book
contacts
ages
weather in location
groups
creating and viewing members
searches
iCal to-do lists
Mail entries
maps
Palm contacts
phonetic lookup
reverse lookups
scripts
addresses
Ethernet
IP addresses
administrator
accounts and
Mail hacks
advertisements, OmniWeb pages
AFS (AppleFileServer) Sharing
AirPort AP Grapher
albums, iPhoto
books
image files
Intro pages
comments
creating by dragging
desktop images
merged
selecting multiple
Smart Albums
aliases
creating
dragging
Make Alias command
Unix and
animation in Dock
AP Grapher
Apache
alternate ports
CGI scripts
parsing HTML pages for
manual
name-based virtual hosts
PHP scripting
port scanners
server statistics
Server-side Includes
SWAT
Apple LCDs, touch-sensitive switch
AppleScript
address book scripts
Dock restart
Finder scripts
info scripts
mail scripts
Script menu
Sherlock scripts
Application menu add-ons
application switcher, Expose and
applications [See also programs]
Acrobat Reader
BBEdit
DragThing
hide from command line (Unix)
install single from disc
launching, browser address bar
Office 2004
Photoshop
Photoshop Elements
Quicken
SnapzPro X
switching, dragging icons in Dock
X11, Fink and
apropos command (Unix)
Aqua Apps, switch to from Expose
artwork, iTunes
associating files
attachments to email
entire folder
Entourage 2004
autocorrect in bash shell (Unix)
automatic login


index_B

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

background
Desktop, screen saver as
Finder, screen saver as
iChat
iTunes control
login window
programs, pausing with Unix
windows
Finder
moving
backups
Carbon Copy Cloner add-on
iPhoto preferences
iTunes Smart Playlist
Stickies
Unix
banner, Unix
bash shell (Unix) 2nd
command completion
command history
directories, autocorrect
history
editing commands
search
History file management
keyboard shortcuts
mouse and
paths, drag folder to
switch to tcsh
tab completion
text, boilerplate insertion
tiling windows
batch conversions, Photoshop
batch file rename in Unix
BBEdit
listing files
scrolling
acceleration
keyboard
system files
Bcc (blind carbon copy), Mail
benchmarking in Unix
bin directory, scripts (Unix)
blind carbon copies, Mail messages
boilerplate text, bash shell (Unix)
bookmarklets, Google
bookmarks
Camino
Favorites folder
Safari
folders 2nd
keyboard shortcuts
new
searches
window
books, iPhoto
image files
printing, as PDF files
Browser, iTunes 2nd
browsers
address bar
launch applications
Safari 2nd
autocomplete
command-line, installation
cookies, Safari
downloads, Internet Explorer 2nd 3rd
form fill-in
Google search bar
history
deleting entries
Safari 2nd
home page, jump to
images, PNG
Internet shortcuts
keyboard shortcuts, Safari 2nd
keywords
links, keyboard control
MultiZilla
new windows, Internet Explorer
open multiple sites
PDF files in
pop-ups, OmniWeb
scrolling, Internet Explorer
shortcuts
tab groups
tabbed browsing
tabbing
URL drag-and-drop
Buddy List, iChat
adding buddies
screen name
build number
Butler


index_C

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

cal command (Unix)
Calculator
command line (Unix)
conversions
graphing calculator
large type
talking calculator
virtual tape
calendar [See iCal]
calendar, cal command (Unix)
camera sharing, Image Capture and
Camino
bookmarks
forms
home page, jump to
shortcuts
tab groups
tabbing in
tabs
capturing colors
Carbon
drag-and-drop and
Carbon Copy Cloner
case sensitivity, tab completion in Terminal
cat command (Unix)
categories, System Preferences
CDs
ejecting
drutil
iTunes
importing as one song
MP3 CDs
rip multiple
multisession
System Preferences
cellphones, iChat messages and
CGI scripts (Apache)
parsing HTML pages for
Character palette
Classic 2nd
opening, speeding up
printers
running from disk image
sharing settings with Mac OS X
Clipboard
add-ons
formatting, Unix
Preview and
Clipz
Close button
closing windows
accidentally
multiple
Cocoa
drag-and-drop and
font panel size
font scaling
Cocoa Gestures
color
capturing
Finder windows
puff of smoke on Dock
Terminal (Unix)
color palettes, custom
ColorSync Utility
PDF size
column view, Finder
icons in columns
resizing columns
speed
columns
iTunes shortcuts
Mail
command line (Unix) 2nd
calculator
dictionary, curl program
Fast User Switching
file open
hide applications from
System Profiler
Web browser installation
zip files
Finder compatible
unzipping quickly
commands
bash shell (Unix)
Unix [See Unix commands]
comments, iPhoto
concatenation, Unix
Connect to Server dialog box
connections
Connect to Server dialog box
remote
location files
passwords and
ssh (secure shell)
console login
contextual menus
Control Panels, Mac OS 9
conversions, units command (Unix)
cookies, Safari
Copy/Paste commands
folder copy 2nd
copying
files
Copy/Paste command
dragging
folders
Copy/Paste
dragging
CopyPaste-X
cornering Dock
cover art, iTunes
downloading
now playing
CPU usage, iTunes
creator code (Unix)
cron program, task scheduler
crontab command (Unix)
CrushFTP
cue cards, Keynote
curl program (Unix)
currency conversion, Calculator


index_D

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

daemons (Unix)
damanged fonts, Office 2004
Darwin kernel (Unix)
database servers [See MySQL]
date & time scripts
date in menu bar
debugging, Safari menu
Default Folder X
DejaMenu
Desktop
background
.Mac slideshow images
screen saver as
icon sizing
iPhoto albums and
organizing folder action scripts
pictures
desktop printers
Developer Tools (Unix)
dialog boxes
Connect to Server
iTunes, keyboard shortcuts
login
Open
restart and
Save
Save As, jump to folder and
screen shots
shut down and
sleep and
dictionary, Unix curl program
diff command (Unix)
directories
bash shell (Unix), autocorrect
fast switching, Unix
Terminal
number of files
opening in Finder
switching
disk erasure
disk images
Classic and
creating with Terminal
Disk Utility
Internet-enabled
passwords
speed mounting
disk space display (Unix)
Disk Utility
disk images
Internet-enabled
passwords
speed mounting
folders, password protection
games without CDs
multisession CDs
Displays panel, opening
Dock
animation
bouncing icons
cornering
Finder, Quit icon
hidden programs
hiding/showing
iCal icon
icons
adding
bouncing, turn on/off
dragging and switching applications
removing
supersized
iTunes and
keyboard combinations
killing
MicroDock recovery
position
puff of smoke color
resizing
restarting, AppleScript
screen shots
System Preferences icon
top-mounted
Trash, customized
troubleshooting from Terminal
Web page launch
Web Shortcuts folder
windows
minimizing
Terminal, saved
Dock Detox
docking windows, multiple
documents
file associations
saving, Close button and
donationware
downloads
cover art, iTunes
iCal calendars
Internet Explorer
long file name
Safari
deleted list recovery
monitor progress
opening
pasting to windows
speed display
URLs
Unix
video, iTMS
saving
drag-and-drop
alias creation and
canceling
Carbon programs
Cocoa programs
file copying
folder copying
URLs
DragThing
active programs
Easter egg
fades
drawers (Mail)
moving
shortcuts
DropDrawers
drutil command (Unix)
eject CDs
du command (Unix)
DVD-RW disks, burning to
DVDs
ejecting
screenshots
SnapzPro X and
System Preferences


index_E

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

Easter eggs
DragThing
iTunes About box
ejecting CD/DVDs
emacs (Unix), game
email
attachments, Entourage 2004
browsers, external mail programs
iPhoto photos
URLs, Safari
embedded objects, Safari
emoticons, iChat
disabling
status messages
empty Trash, Terminal and
Entourage 2004
email attachments
importing Entourage 2001 files
Stickies and
Erase Disk command [See Disk Utility]
Ethernet, address
Expose
application switcher and
Aqua Apps, switch to
Floating Expose Blob
hidden files, moving to hidden windows
modes
multibutton mouse
Show Desktop mode
slow motion effects
sticky mode
text clippings
windows, opening one


index_F

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

Fast User Switching, Unix
favicon.ico files, Safari
Favorites folder bookmarks
Favorites toolbar
fc command (Unix)
file command (Unix)
file names
Finder
long, Office 2004
spaces
searches
Terminal and 2nd
file sharing
AFS Sharing
monitoring
Public folder
remote
SharePoints
SMB (Windows)
Unix
command line
Windows computers
Windows, protecting
Windows
SWAT
file system, Unix and
file utilities (Unix)
files
associations
copying
Copy/Paste command
dragging
deleting in Terminal
downloads, Unix
generic (Unix)
hidden, moving to hidden windows in Expose
hiding/showing
icons, custom
listing
BBEdit
Unix
location files
multimedia, preview in Finder
originals
PDF, creating
renaming
A Better Finder Rename add-on
multiple
swap files
FileVault
film rolls, iPhoto
information
scrolling
selecting
filtering, junk Mail
LSMMap2 file
find command (Unix) 2nd
Finder
background
animated screen saver as
still image from screen saver as
column view
icons in columns
resizing columns
speed
directories, Terminal
Dock Quit icon
file info, multiple lines
file names in
file renaming
Find, space beginning name
Finder to Terminal exchanges
folders
jumping to
toolbars
icons, custom
keyboard shortcuts
list view
sorting
locate command (Unix)
mouse, multibutton
multimedia file preview
Path Finder add-on
Quit command
scripts
scrolling mouse and
scrolling, diagonally 2nd
shell scripts
shortcut menu plug-ins
sidebar, removing
Snap to grid, overriding
spring-loaded folders
toolbar
customizing
folders on
hiding/showing
icons
icons, heavily used
removing
server icons
shrinking
troubleshooting from Terminal
Undo
window background
window location
window size
windows
pop-up
printing
zip files, Unix and
zooming, turning on/off
Fink, X11 applications
Firefox
forms
home page, jump to
keywords
tab groups
tabbing in
Floating Expose Blob
focus, windows
folders
bookmarks, Safari 2nd
copying
Copy/Paste
dragging
Finder toolbar
folder action scripts
desktop organization
Home, accounts and
icons, custom
jumping to
Mail, pop-open
passwords, Disk Utility
Public, sharing
renaming, System folders
Save As dialog box, jump to
sidebar folders, opening in new window
spring-loaded
System folder, copying
Font Book
faces, display all
information
fonts
Cocoa
panel size
scaling
iDVD
iTunes
Office 2004, damaged
scripts
Unicode characters
Windows, installation without conversion
forms, browsers
forums on Web site, MySQL and
freeware
FruitMenu
FTP
alternate shells' usage
automated transfers, Terminal
server login, Terminal and
FTP server installation
Full Screen Mode, X11


index_G

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

games, emacs (Unix)
gesture
Get Info, Inspector and
Gimp (X11)
Google
bookmarklets
MultiZilla and
Page Holder, Internet Explorer
Safari toolbar
search bar
Grab utility, screenshots
graphics, Desktop
graphing calculator
gray arrow links, iTMS
grep command (Unix) 2nd
Grim Ripper, resource fork and
gzip (Unix)


index_H

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

hard drive space needed
Help system
Adobe files opening in another browser
iMovie, removing files
iTunes
iTunes Music Store Help
Terminal
hidden files
Expose
hiding/showing
hidden programs
Hide Others command
hiding/showing
windows
history
bash shell (Unix)
Safari
deleting entries
searches
shell (Unix)
Unix search
Home account, Terminal (Unix)
Home folder
accounts and
keyboard shortcuts
home page, browsers
jump to
hover focus, mouse
iTunes
HTML
Mail messages
OmniWeb and
parsing pages for CGI scripts
HTML documents, TextEdit and
hyperlinks in Mail messages


index_I

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

iCal
calendar download
calendar merge
Dock icon
events
moving between calendars
multiline
keyboard and
messages
mouse
open window with keyboard
to-do lists, Address Book contacts
view days
windows, size
iChat
AIM screen name
background
Buddy List
adding buddies
screen name and
chat rooms
emoticons
disabling
status messages
image icon
images
opening
pasting
iTunes songs
logging
.Mac account name
messages
cellphones
multiline
spell checking
video streaming
window accidental closure
icons
column view, Finder
Desktop, sizing
Dock
adding to
removing
supersized
dragging, switching apps in Dock
Finder
custom
toolbar
iChat
screenshots
toolbars
Finder
Internet Explorer
iDisk
access from Windows
iDVD
burning to DVD-RWs
disk usage and
fonts, enabling in other programs
hiding, burning discs and
themes
Image Capture
camera sharing
scanner sharing
Web galleries
image files, iPhoto books
Image Format Factory, Preview and
images
iChat
PNG, Internet Explorer
Preview, browsing multiple
iMovie
add-ons
clips, importing
Help files, deleting
hiding/showing
images, importing
startup time
still images, synchronizing
info scripts
Info window, iTunes
Inspector, Get Info and
installation
FTP server add-on
menulets
single applications from disk
interactive mode, Unix commands
Internet Explorer
downloads
long file names
images, PNG
new windows
Page Holder
printing Web pages
Refresh, options
scrolling tricks
toolbar, icons
Internet radio, iTunes and
Internet services, scripts
Internet shortcuts, browsers
Internet-enabled disk images, Disk Utility and
IP addresses
iPhoto
albums
book image files
book intro pages
books
books, printing as PDF files
creating by dragging
desktop images
merged
selecting multiple
Smart Album creation shortcut
Smart Albums
comments
emailing photos
film rolls
information
scrolling
selecting
Library
location
removable drives
Library Manager
preferences, backup file
rotating clockwise
slideshows
music
online, URLs
windows
speed
views, pre-editing
windows, editing
zooming
iTMS (iTunes Music Store)
account information
downloading video
listen to music during
saving
gray arrow links
purchase tracking
iTunes
About box Easter egg
artwork
background play
Browsers
playlist creation
CDs
importing as one song
MP3 CDs
columns, shortcut menu
cover art
downloading
now playing
CPU usage
dialog box keyboard control
Dock and
extended labels
fonts
hover focus
iChat display
Info window
Internet radio
keyboard shortcuts
library
deleting from
keyboard navigation
playing songs without adding
renaming
marking/unmarking songs
modes
Music Store Help
navigation
play time, display change
playback
adding library
keyboard control
keyboard shortcuts
playlist
backups
creating from Browser
deleting from
deleting, warning
keyboard navigation
play all songs at once
printing
random, modifying
shuffling
Smart Playlist
Smart Playlist, searches
song position, changing
previewing
random play, skipping albums
rip CDs, multiple
searches, clearing
song list, shortcut menu
split songs
unmarking songs
Visualizer, keyboard controls
Visuals
screen capture
Visualizers
volume
minimum/maximum
mouse
window resize


index_K

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

kdump utility (Unix)
keyboard
Dock
full navigation
iCal and
iTunes
library navigation
playback control
launching add-ons
login
menu navigation
scrolling, BBEdit
System Preferences
typing sounds
keyboard shortcuts [See also shortcuts]
bash shell (Unix)
Finder
Home folder
iTunes
jump to folder, Save dialog boxes
log out
Open dialog box
Quicken
Restart
Safari
bookmarks
Save dialog box
Shut Down
Sleep
TextEdit
Word
Keynote
cue cards
themes
keywords, browsers
killing Dock
ktrace program (Unix)


index_L

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

languages
deleting unused
spell checker
laptop trackpad
LaunchBar
leave command (Unix)
libraries
iPhoto
comments
Library Manager
location
removable hard drives
iTunes
deleting from
keyboard navigation
playing songs without adding to
renaming
software creation
windows, Terminal
links
autocomplete
browsers, keyboard control
Mail messages
Safari
outline on clicked-links
status bar
lists
Finder, sorting
jump to bottom/top
login panel
Live Word Count, Word
locating files
log in
automatic
console
keyboard
list
root
screen background
screen marquis
log out
confirmation cancel
keyboard shortcut
quick log out
login dialog box
login items
logs, Unix system log
Lord of the Rings timeline
LSMMap2 file, junk mail


index_M

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

Mac OS 9
Control Panels
menu
menus
multiple folders, speed and
sound sets
Mac OS X version
checking from About box
checking from Unix
.Mac service
slideshows, Desktop background
machine-independent Terminal sessions
MacJanitor
magnification, Dock icons
Mail
Activity Viewer, mouse and
Address Book entries
attachments
entire folder
blind carbon copies
columns
development team
drawer
moving
shortcuts
filtering
junk
junk, LSMMap2 file
folders, pop-open
hyperlinks
messages
deleting 2nd
HTML
plain text
resending
unread
multiple mailboxes
new message alerts
preview pane
replies
quoting previous
reply versus reply all
scripts
searches
sending messages
Address Book groups
later time
sounds
threading
troubleshooting
incomplete message
Mac.com overflow
opening-sequence crashes
maintenance scripts (Unix)
Make Alias command
man pages (Unix)
no entry
pager
printing
maps, Address Book contacts
marking songs, iTunes
master spell checker
MaxMenus
memory
RAM
services and
menu bar
calendar
date
system information display
menulets
installation
removing
MenuMeters
menus
contextual
jump to bottom/top
keyboard navigation
Mac OS 9 2nd
screenshots
Script menu
messages
iChat
cellphones
multiline
Mail
Address Book groups
attachments
blind carbon copies
deleting 2nd
entire folder attached
HTML
new, voice alerts
plain text
resending
sending later
unread
MicroDock
recovery
Microsoft Office 2004 [See Office 2004]
military time
morphing
MorphX
mouse
Activity Viewer, Mail
hover focus, iTunes
iCal
iTunes volume
multibutton
Expose and
Finder and
scrolling
either direction with one click
Unix bash shell
Mozilla
external mail programs
forms
home page, jump to
keywords
MultiZilla
tab groups
tabbing
MP3s
burning CDs in iTunes
concatenation (Unix)
multibutton mouse
Expose
Finder and
multimedia preview in Finder
MultiZilla
Google and
MySQL
forums on Web sites


index_N

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

named-based virtual hosts (Apache)
Netscape
external mail programs
forms
home page, jump to
keywords
MultiZilla
tab groups
tabbing in
Network browser, speed
network scanner sharing
networking [See also connections]
camera sharing
connections
Ethernet address
file sharing, monitoring
iDisk
IP addresses
location files
.Mac service
NSWindowResizeTime control


index_O

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

Office 2004
Entourage 2004
email attachments
importing Entourage 2001 files
Stickies
fonts, damaged
long file names
PowerPoint 2004, PowerPoint 4.0 files
Word
keyboard shortcuts
Live Word Count
text string generation
zooming
Office X, scrolling speed
OmniGraffle
OmniWeb
advertisements on page
HTML and
PDF files, Web pages as
pop-up ads
shortcuts 2nd
tab groups
windows, new with current page showing
Open dialog box
keyboard shortcuts
shortcuts
opening programs
leaving open
switching between
openssl command (Unix)
Opera
optical disk erase withUnix
original files, finding
Ownership & Permissions, volume control and


index_P

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

Pacifist
Page Holder, Internet Explorer
palettes
Character palette
color, custom
Palm Desktop, Address Book and
panes, System Preferences
alphabetizing
dimmed
new
removing
passwords
disk images, Disk Utility
folders, Disk Utility
remote connections
Path Finder
pbcopy command (Unix)
pbpaste command (Unix)
PDF (Portable Document Format) files
creating
OmniWeb Web pages
Preview and
extract one page
size, ColorSync Utility and
Web browsers and
permissions, Unix and
phonetic lookup, Address Book
photographs [See iPhoto]
Photoshop
batch conversions
zooming
PHP scripting, Apache and
PID (process ID), pausing programs and
pipes, Unix commands
play time, iTunes
playback, iTunes keyboard control
playlist, iTunes
creating from browser
deleting from
deleting, warning
keyboard navigation
play all songs at once
previewing
printing
random, modifying
shuffling
Smart Playlist
backups
searches
song position, changing
plug-ins, shortcut menus
pmset command (Unix)
PNG (Portable Network Graphic) images, Internet Explorer
pop-up ads, OmniWeb
pop-up menus, custom
pop-up windows, Finder
port scanners, Terminal
power management, Unix
PowerPoint 2004, PowerPoint 4.0 files
Preferences
iPhoto backup file
shell (Unix)
troubleshooting
presentations [See Keynote]
Preview
Clipboard
graphics
columnar text
display order, multiple images
Image Format Factory
images, browsing multiple
PDF documents and
extract one page
zooming
preview pane, Mail
Printer Setup Utility
docking
drag jobs between printers
printers
Classic
desktop printers
Mac OS X
sharing
unsupported
printing
desktop printers
Finder windows
man pages (Unix)
playlist, iTunes
Safari, Print button
settings, custom
Web pages, Internet Explorer
processors, iTunes CPU usage
program launcher/switcher
programs [See also applications]
Carbon
Classic
Cocoa
cycling between
hidden
limiting access
opening and leaving open
switching between 2nd
prompt (Unix) 2nd [See also $ (dollar sign]
customization
Public folder, file sharing and
puff of smoke on Dock
punctuation marks, sorts and


index_Q

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

Quicken keyboard shortcuts
QuickTime movies in Stickies
Quit command in Finder


index_R

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

radio, Internet radio (iTunes)
RAM (random access memory), amount needed
refreshing browsers, Internet Explorer
regular expressions (regex) in Unix
reminders (Unix)
remote connections
file-sharing
location files
passwords and
ssh (secure shell)
Terminal and
limit users
renaming
files
multiple
System folders
replies to Mail
quoting previous
reply versus reply all
resource fork
Grim Ripper and
movie files
searching for in Unix
restart
confirmation box
dialog box
Dock, AppleScript
keyboard shortcut
quick restart
reverse phone number lookups
robg%, Unix prompt
root user
logging in as
temporarily using sudo command


index_S

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

Safari
address bar, hiding
address highlighting
Aqua versus brushed metal appearance
bookmarks
folders 2nd
keyboard shortcuts
new
searches
window
cookies, temporary
debugging menu
downloads
deleted list recovery
monitor progress
opening
pasting to
speed display
URLs
embedded objects
favicon.ico files
Google search bar
history
deleting entries
searches
keyboard shortcuts
links, clicked with outline
Print button
status bar
stopping page loading
tab groups
URLs
tabbed browsing
closing tabs
title bar, navigating with
toolbar, Google search
URLs, emailing
window management
windows
position
sizing
Save As dialog box, jump to folder
Save dialog box
keyboard shortcuts
shortcuts
save sheets
saving documents, Close button and
say command (Unix)
scanners
driver add-ons
sharing, Image Capture and
screen captures, iTunes Visuals
screen name, iChat
buddies and
screen program (Unix)
screen saver
as Desktop background
as Finder background
screen, login marquis
screenshots
capturing
dialog boxes
Dock and
DVDs
Grab utility
icons
menus
section of screen
SnapzPro X
Terminal
windows
Script menu
scripts
address book
date & time
Finder
folder actions
desktop organization
font sample
info scripts
Internet scripts
mail scripts
maintenance scripts (Unix)
PHP, Apache and
searches
shell (Unix), bin directory
scroll bars
arrows
Option-clicking and
scrolling
BBEdit
acceleration
keyboard
diagonally in Finder
Internet Explorer
iPhoto film rolls
mouse
in either direction with one click
speed, Office X
search bar, Google
searches
Address Book groups
grep command (Unix)
History (Unix)
iTunes
clearing
Smart Playlist
Mail
resource fork (Unix)
Safari
bookmarks
history
scripts
space beginning name
TextEdit
Trash folder
Secure Empty Trash, Unix equivalent
secure shell (ssh)
remote connections
Terminal and
selecting text in text boxes
sending Mail messages
Address Book groups
later
serial number
Server-side Includes (Apache)
services
memory saving and
turning on/off
Services menu 2nd 3rd
SharePoints, file sharing and
shareware
sharing files
Public folder
remote connections and
SharePoints
sharing printers
sheets
display speed
shell (Unix)
case sensitivity, autocomplete and
find program
FTP services
history
preferences
prompt customization
scripts
bin directory
Finder and
Sherlock scripts
shortcut menu plug-ins
shortcuts [See also keyboard shorcuts]
browsers
iTunes
columns
song list
Mail drawer
OmniWeb
Open dialog box
Save dialog box
Terminal
TextEdit
Show Desktop mode, Expose
shut down
confirmation cancel
dialog box
keyboard shortcut
quick shut down
sidebar folders, opening
sidebars, removing from Finder
SideTrack
Simple Finder account limits
sleep
dialog box
keyboard shortcut
slideshows
.Mac service, Desktop background
iPhoto
music
URLs
windows
Smart Albums, iPhoto
creation shortcuts
Smart Playlist, iTunes
backups
searches
SMB sharing (Windows)
smoke puff on Dock, color
Snap to grid, Finder, overriding
SnapzPro X 2nd
software
donationware
freeware
library creation
shareware
Software Update
saving updates
Unix
modified files
song list, iTunes shortcut menu
Sound panel, opening
sound sets, Mac OS 9
sounds
iPhoto music
Mail
Speaking text
Speech
alerts
minimize window
Terminal
spell-checker
iChat
language
master
spring-loaded folders
ssh (secure shell), Terminal and
ssh command (Unix)
SSH servers, alternate ports
startup, login
automatic
keyboard
login items
status bar, Safari
Stickies
backups and
bring notes forward
collapsing notes
Entourage 2004 notes
floating notes
programs
QuickTime movies
Sticky Keys
sticky mode, Expose
sudo command (Unix)
superuser (Unix)
swap files
SWAT (Samba Web Administration Tool)
switching between programs
cycling through open
system files, BBEdit and
System folders
copying
renaming
system information, menu bar display
system maintenance
System Preferences
add-ons
categories, renaming
CDs
date, menu bar
desktop, picture
Dock icon
DVDs
keyboard
full navigation
panes
alphabetizing
dimmed
new
removing
sharing
Software Update
Speech
alerts
minimize window
Sticky Keys
time set
time, military time
toolbar
icon size
removing
separators
spaces
Universal Access
Sound
zoom
Unix and
System Profiler
Unix command line


index_T

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

Tab completion, Terminal
tab groups
browsers
Safari URLs
tabbed browsing 2nd
Safari
closing tabs
tags, login marquis
tail command (Unix)
task scheduler (Unix)
tcsh shell (Unix)
switch to bash
Terminal
batch files, renaming
benchmarking
clipboard formatting
command line, open URLs
commands
double-clicking
master list
copy operations
Developer Tools
directories
disk image creation
fast switching
number of files
directories, open in Finder
directory switching
file deletion, secure
file downloads
file names, spaces in 2nd
files
listing
opening
Finder to Terminal exchanges
fonts, color
FTP
automated server logins
automated transfers
Help
Home account
locate command
machine running time
machine top speed
machine-independent sessions
paste operations
port scanners
power management
reminders
remote access and
remote access and, limit users
screenshots
shortcuts
Software Update
modified files
speech
ssh (secure shell)
tab completion
text files
^M characters
comparing
text, drag between windows
top command
Trash rename
troubleshooting from
Dock problems
empty Trash
Finder
wake sleeping remote Mac
welcome message personalization
wildcards
windows
color
dragging text between
library
open in current directory
saved, opening in Dock
tile
text
Mail messages
Speaking text
Terminal, drag between windows
text box selection
text clippings, Expose
text files
^M characters
Unix, comparing
text strings
generating in Word
grep command (Unix)
TextEdit
file open, Terminal
HTML documents
navigation
page breaks
search and replace
searches
shortcuts
zooming
themes
iDVD
Keynote
threads in Mail
time, System Preferences 2nd
tiniscule
TinkerTool
title bar, Safari
to-do lists, iCal
toolbars
Favorites
Finder
customizing
folders on
hiding/showing
icons
icons, heavily used
removing
server icons
shrinking
Internet Explorer, icons
Safari, Google search
System Preferences
removing
separators
sizing icons
spaces
tooltips, iTunes
top command (Unix)
top-mounted Dock
touch-sensitive switch, LCD display
Tracing program, execution (Unix)
Trash
Dock, customized
emptying, Terminal and
searches
viewing contents
troubleshooting
account setup
Mail
incomplete messages
Mac.com overflow
opening-sequence crashes
preferences
Terminal and
Dock problems
empty Trash
Finder problems
type code (Unix)
typewriter sounds


index_U

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

Undo
Unicode characters
unit conversion, Calculator
units command (Unix)
Universal Access, System Preferences
Sound
zoom
Unix
aliases
backups
bash shell
boilerplate text
command completion
command history
directory name autocorrect
history
history command editing
History file management
History search
keyboard shortcuts
mouse and
paths
CD eject
command line
calculator
dictionary, curl program
Fast User Switching
file sharing
hide applications from
System Profiler
TextEdit files
Web browser installation
zip files
zip files, Finder compatible
command line interface
commands
apropos
banner
cal
cat
crontab
diff
double clicking
drutil 2nd
du
editing
fc
file
find
grep 2nd
interactive mode
leave
locate
master list
openssl
pbcopy
pbpaste
pipes
pmset
say
ssh
sudo
superuser status
tail
top
units
uptime
variables
whatis
xargs
concatenation
creator code
Darwin kernel
disk space display
emacs game
file sharing
Windows computers
Windows, protecting
file system and
file utilities
gzip
Lord of the Rings timeline
Mac OS X versions
maintenance scripts
man pages
no entry
pager
printing
optical disk erasure
overview
pausing background programs
permissons and
prompt
~ (tilde)
regular expressions (regex)
resource fork, searches
screen program
shell
case sensitivity
find program
Finder
History
prompt customization
shells
Software Update, modified files
superuser
system log
System Preferences
task scheduler
tcsh shell
Terminal
automated FTP transfers
banner
batch files, renaming
benchmarking and
clipboard formatting
color
command line file opening
comparing text files
copy operations
Developer Tools
directories, fast switching
directory switching
disk image creation from directory
drag text between windows
file deletion
file downloads
file listing
file names with spaces 2nd
FTP hints
Help
Home account
^M characters in text files
machine-independent sessions
number of files in directory
open URLs from command line
open window in current directory
paste operations
port scanners
power management
reminders
saved windows in Dock
screenshots
Software Update
speech
tab completion
text drag between windows
Trash rename
wake sleeping Mac
welcome message personalization
wildcards
window library
window tiling
tiniscule
Trace program real time execution
type code
verbose mode booting
X11 [See X11]
uptime command (Unix)
URLs (Uniform Resource Locators)
downloaded files, Safari
drag-and-drop
emailing
Safari
Mail messages
open from Terminal command line


index_V

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

verbose mode booting, Unix
video download, iTMS
listen to music during
saving
video streaming, iChat
Visualizer
iTunes
keyboard control
volume
iTunes
minimum/maximum
mouse
setting
VueScan


index_W

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

Web browsers [See browsers]
Web design, name-based virtual hosts (Apache)
Web galleries, Image Capture
Web pages
Dock launch
Favorites toolbar
printing, Internet Explorer
Web servers [See Apache]
Web Shortcuts folder, Dock
Web sites, open multiple
whatis command (Unix)
wildcards, Terminal (Unix)
windows
background
Finder
moving
bringing forward
closing
accidentally
multiple
docking multiple
Expose opening one
Windows
file sharing
SWAT
windows
Finder, printing
focus
Windows
font installation without conversion
windows
hiding
iCal
sizes
iChat, accidental closure
Windows
iDisk access
windows
Internet Explorer
iPhoto, editing
iTunes, resize
maximizing in slow motion
minimized, closing
minimizing
all
slow motion
OmniWeb, new showing current page
pop-up
Safari
bookmarks
screenshots
sidebar folders, opening
slideshows, iPhoto
Terminal
Library
tiling
Unix saved, opening in Dock
WindowShade X
Word
keyboard shortcuts
Live Word Count
text string generation
zooming


index_X

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

X-Assist
X11
applications, Fink and
Aqua Apps, switch to from Expose
Full Screen Mode
Gimp installation
launching environment
Xterm window
options
size
xargs command (Unix)
Xounds
Xterm (X11)
options
size


index_Z

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

Zip files, Unix
Finder compatible
unzipping quickly
zoom
Finder, turning on/off
Universal Access
zooming
iPhoto
Photoshop
Preview
TextEdit
Word documents