|
Related Reading
Mac OS X Power Hound |
Editor's note: Last week, in part one of this two-part series or excerpts, Mac OS X Power Hound author Rob Griffiths shared eight of 16 hand-picked favorite OS X hints. This week, Rob shares his knowledge on creating a smart iPhoto album for general searching, using Internet shortcuts, creating a disk image from a directory in the terminal, and more.
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 ->
New Smart Album, or just hit Command-Option-N. iPhoto displays the smart album
creation sheet. As seen at left, 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 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.
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 preferences file. Here's how:
In the Finder, open your Home -> Library -> Preferences folder. Find the file called com.apple.iCal.plist and drag it onto the icon of TextEdit. 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.
<string> and </string> tags. Press Command-C, for example.<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 Command-V to paste. You've just set the Week view window to the same size as the Day view window. If you use the other day views, change those as well.<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.You now have identically sized windows in all three views.
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 (as seen below), an expression sheet for entering long calculations, and a hexadecimal calculator for the programmer types among us.
Command-I does the same thing from the keyboard.Command while clicking them. Once you've clicked Choose, you should see all three new plugins listed in the Plug-ins pane of the Info window.You'll now see all three new modes listed in the View menu.
In
most browsers, you can put about ten 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 -> World -> 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 -> Manage Bookmarks, and then select the web site for which you want a shortcut. Choose Edit -> Properties, enter your shortcut term on the Keyword line (see the image above; "csshelp" is the shortcut being defined), and then click OK to save your work.
Camino: Choose Bookmarks -> Show All Bookmarks (Command-B). Select the web site you want a shortcut for, and choose Edit -> Get Info (Command-I). Then just enter your shortcut in the Keyword box and close the window.
OmniWeb: Select Bookmarks -> Show Bookmarks Page (Command-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.
Note: If you don't see a Keyword box at the bottom of the window, just Control-click any bookmark and choose Show Bookmark Info.
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.
Note: How you remember your shortcuts is another matter entirely. One way is to use a translucent, floating Stickies note so you can see all of your shortcuts, but still see the windows underneath.
|
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. If you'd rather have the help files open in a more modern browser, there are a couple of ways to do it:

Command-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, a free program that works in the Finder's shortcut menus. With The Grim Ripper installed, you can select all of the .html files, Control-click them, and be done with the resource forks in one easy step, as shown in the figure above. 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.

It certainly can help you if it's Butler, 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 the figure above, you can replace a huge menu bar name with a simple pop-up menu.
Tip:
To reclaim Fast User Switching's wasted menu bar space, start by disabling Fast
User Switching in System Preferences -> Accounts -> Login Options. Then use
Butler to add a new Fast User Switching Smart Item, and assign it a keyboard
shortcut (Control-Command-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 shown in the screenshot above, 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.
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 (or your favorite text editor). 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. 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.
Tip: 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 to ever reach litigation with someone who had hacked your system.
Create a Disk Image from a Directory in Terminal Apple's Disk Utility program, located in Applications -> Utilities, lets you create disk images. 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.
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 ten percent to this number to account for metadata; this rounds up to 12,000.
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.
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.
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/SitesNow that you're finished, you can unmount the disk image:
hdiutil unmount /Volumes/SitesNote: 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.
Rob Griffiths is the creator of the Mac OS X Hints site, a database of over 3,500 tips on using OS X.
Return to MacDevCenter.com.
Copyright © 2009 O'Reilly Media, Inc.