macdevcenter.com
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button

A Closer Look at Spotlight
Pages: 1, 2

With Advanced Searching in Finder

While the Spotlight icon in your menubar can do the job most of the time, there will still be those occasions when you want to do a more customized search. For these situations, you'll want to use Finder. Open up Finder's "File -> Find..." menu and you'll be presented with a fairly self-explanatory search window. Using this window, you can specify as many detailed criteria as you'd like. If you find that you've woven up a useful search you're likely to reuse, you can conveniently save it as a "smart folder" (more on this below).

For those highly customized search jobs, use Finder to make life easier. If you use certain searches often, you can save them as For those highly customized search jobs, use Finder to make life easier. If you use certain searches often, you can save them as "smart folders."

With Smart Folders

One of the coolest things about the way you can organize your music in iTunes is the concept of the "smart playlist." You can specify a particular artist, genre, album, and so on, and the folder automatically populates and updates itself without any further action on your part.



Spotlight takes this concept and expands it to a much broader level. Smart folders provide you with an always current collection of files that meet whatever constraints you want to establish. Uses for smart folders can be as creative as you can be. You can do anything from create a folder containing everything related to your kid's last birthday party (see more on "Spotlight Comments" below) to create a folder that contains only the rich text files that have been opened in the past two days. To create a Smart Folder, click on Finder's "File -> New Smart Folder" menu.

Smart folders are a really handy way to keep a collection of files current. Smart folders are a really handy way to keep a collection of files current.

With Burn Folders

Back in the olden days burning a data CD wasn't that hard, but it could still have been easier. Spotlight and burn folders make this task about as simple as it can be. You simply create a new burn folder via Finder's "File -> New Burn Folder" menu, type a search criteria into the search box and then wait a second for the results. When you get your results, you'll notice that the burn folder window has mysteriously transformed into a search result window. While that may be a bit inconvenient, it's really not a problem. Just select the files you want and drag them onto the burn folder that was created on your desktop (using Exposé to clear the desktop if need be). Ctrl-click or double click on the folder and then choose to burn the disc.

If you have a CD player capable of playing native MP3 or Windows media files in your vehicle, you'll find burn folders to be a handy way to take music with you (although DRM can make this less convenient than it could be). They're also useful for burning specific collections of files on multiple occasions.

Using Contextual Menus

While we've reviewed some of the more common ways that Spotlight will change the way you work, there are gobs of lesser known ones that we'll all continue discovering as time marches on. A miscellaneous use that I find convenient is to select some text in a Spotlight-aware application like Mail or Safari and then ctrl-click and choose to "Search in Spotlight" from the contextual menu. You might find yourself often doing this in Mail regarding work-related stuff.

By Adding Spotlight Comments

A final note of interest involves adding additional search criteria to Spotlight files. If you choose to "Get Info" on any Spotlight-aware file type or folder, there's now a text box entitled "Spotlight Comments" that you can use to provide Spotlight with additional keywords to help focus your queries.

If you find you need to add the same comments to many files, your best option is probably to create a smart folder and add the comments to the entire smart folder instead of to all of the individual files, but you have at least two other options: 1) get information on a selection of files to open up a screen full of tiled windows, and then use shortcut keys to paste to and close the windows in succession (if you're really scared of command lines), or 2) use command-line tools such as mdimport (check the man pages) to automate the process.

Give Spotlight additional keywords to further customize searching. Give Spotlight additional keywords to further customize searching.

Privacy Issues

You might find that Spotlight indexes content that you didn't want to be indexed--directories that contain personal information or things that you just don't want Spotlight being aware of. No problem. Just tell Spotlight not to index these directories via Spotlight's "Privacy" tab in System Preferences. If you find that you have the opposite problem, your easiest option is probably to use the mdimport -f option to force indexing of a directory. If you find the need to use a more sophisticated option, read this discussion.

Prevent sensitive information from being indexed by using Spotlight's privacy tab. Prevent sensitive information from being indexed by using Spotlight's privacy tab.

A Word of Caution

For your own awareness, you should realize that Spotlight makes it easy to do some serious snooping. For example, a smart folder created to display all files opened or modified within a specified time period can tell you an awful lot about what a person has been doing, when they've been doing it, and so on. With almost no effort, you can basically reconstruct an entire day's workflow to include everything from what music a person listened to, to which files they modified and created.

You owe it to yourself to take a moment to search your own machine for "social security number," "birthday," or similar phrases you might consider sensitive. Ever heard of getting "Google hacked"? Getting "Spotlight hacked" isn't that much of a stretch. If you want to be on the safe side, don't allow Spotlight to unknowingly abet a malicious script designed to harvest your personal info. These kinds of things could happen--and a completely unconstrained Spotlight sure would make a great accomplice. At least think about it.

Go and Be Productive

Spotlight and the new features that it brings to Tiger are bound to save you time and make you more productive. Go get some work done using these new features, and stop worrying about the pains that used to come with finding files in your uber-nested folders--or maybe it was only me that had that problem?

Matthew Russell is a computer scientist from middle Tennessee; and serves Digital Reasoning Systems as the Director of Advanced Technology. Hacking and writing are two activities essential to his renaissance man regimen.


Return to MacDevCenter.com.