The Spotlight Menu

See the little magnifying-glass icon () in your menu bar? That’s the mouse-driven way to open the Spotlight Search box.

The other way is to press ⌘-space bar. If you can memorize only one keystroke on your Mac, that’s the one to learn. It works both at the desktop and in other programs.

In any case, the Spotlight text box appears just below your menu bar (Figure 3-1).

Begin typing to identify what you want to find and open. For example, if you’re trying to find a file called Pokémon Fantasy League.doc, typing just pok or leag would probably suffice. (The Search box doesn’t find text in the middles of words, though; it searches from the beginnings of words.)

A menu immediately appears below the Search box, listing everything Spotlight can find containing what you’ve typed so far. (This is a live, interactive search; that is, Spotlight modifies the menu of search results as you type.) The menu lists every file, folder, program, email message, Address Book entry, calendar appointment, picture, movie, PDF document, music file, Web bookmark, Microsoft Office document (Word, PowerPoint, Excel, Entourage), System Preferences panel, To Do item, chat transcript, Web site in your History list, and even font that contains what you typed, regardless of its name or folder location.

Note

Lion Watch: Apple keeps enhancing Spotlight’s file-finding skills with each new version of Mac OS X. In Snow Leopard, Spotlight starting finding photos according to who is in them (using iPhoto’s Faces feature) or where they were taken (using iPhoto’s Places feature). If you use iChat (Chapter 21), Spotlight also finds the lucky members of your Buddy lists.

Now, in Lion, Spotlight also finds things according to their file types (type .doc to find Word files), download source (type cnet.com to find programs you downloaded from that site), sender (a name or email address), and Finder label.

Top: Press ⌘-space bar, or click the magnifying-glass icon, to make the Search box appear.Bottom: As you type, Spotlight builds the list of every match it can find, neatly organized by type: programs, documents, folders, images, PDF documents, and so on. But don’t miss what may be one of the most useful tweaks in all of Liondom: If you’re not sure what something is, point to it without clicking—or pause on it as you walk down the list with the arrow keys. A Quick Look preview pops out to the left. It shows exactly what’s in that movie, picture, document, or whatever. If your search has found an appointment from your calendar, you actually see a slice of that day’s calendar, showing the appointment in context!

Figure 3-1. Top: Press ⌘-space bar, or click the magnifying-glass icon, to make the Search box appear. Bottom: As you type, Spotlight builds the list of every match it can find, neatly organized by type: programs, documents, folders, images, PDF documents, and so on. But don’t miss what may be one of the most useful tweaks in all of Liondom: If you’re not sure what something is, point to it without clicking—or pause on it as you walk down the list with the arrow keys. A Quick Look preview pops out to the left. It shows exactly what’s in that movie, picture, document, or whatever. If your search has found an appointment from your calendar, you actually see a slice of that day’s calendar, showing the appointment in context!

How to Handle Your Results

If you see the icon you were hoping to dig up, just click it to open it. Or use the arrow keys to walk down the menu, and then press Return to open the one you want.

You can use the new Quick Look preview to see what something is before you take the time to open it, as shown in Figures Figure 3-1 and Figure 3-2. Or check out Figure 3-2 to see how to find out where something is.

If you click an application, it opens. If you select a System Preferences panel, System Preferences opens and presents that panel. If you choose an appointment, the iCal program opens, already set to the appropriate day and time. Selecting an email message opens that message in Mail or Entourage. And so on.

Spotlight is so fast, it eliminates a lot of the folders-in-folders business that’s a side effect of modern computing. Why burrow around in folders when you can open any file or program with a couple of keystrokes?

Note

Lion Watch: You can now drag icons right out of the results list. For example, you can drag one onto the Desktop to park it there; into a window or a folder to move it; into the Trash to delete it; onto the AirDrop icon (in the Sidebar) to hand it over to a colleague; to another disk icon to back it up; and so on.

If you press ⌘-Option as you point to one of the results, you get a line of text beneath the image that identifies the file’s location.

Figure 3-2. If you press ⌘-Option as you point to one of the results, you get a line of text beneath the image that identifies the file’s location.

Spotlight-Menu Tips

It should be no surprise that a feature as important as Spotlight comes loaded with options, tips, and tricks. Here it is—the official, unexpurgated Spotlight Tip-O-Rama:

  • If the very first item—labeled Top Hit—is the icon you were looking for, just press Return to open it. This is a huge deal, because it means that in most cases, you can perform the entire operation without ever taking your hands off the keyboard.

    To open Safari in a hurry, for example, press ⌘-space bar (to open the Spotlight Search box), type safa, and hit Return, all in rapid-fire sequence, without even looking. Presto: Safari is before you.

    And what, exactly, is the Top Hit? Mac OS X chooses it based on its relevance (the importance of your search term inside that item) and timeliness (when you last opened it).

    Tip

    Spotlight makes a spectacular application launcher. That’s because Job One for Spotlight is to display the names of matching programs in the results menu. Their names appear in the list nearly instantly—long before Spotlight has built the rest of the menu of search results.

    If some program on your hard drive doesn’t have a Dock icon, for example—or even if it does—there’s no faster way to open it than to use Spotlight.

  • To jump to (highlight) a search result’s Finder icon instead of opening it, ⌘-click its name. Or arrow-key your way to the result’s name and then press ⌘-Return.

  • Spotlight’s menu shows you only 20 of the most likely suspects, evenly divided among the categories (Documents, Applications, and so on). The downside: To see the complete list, you have to open the Spotlight window (The Spotlight Window).

    The upside: It’s fairly easy to open something in this menu from the keyboard. Just press ⌘-↑ (or ⌘-↓) to jump from category to category. Once you’ve highlighted the first result in a category, you can walk through the remaining four by pressing the arrow key by itself. Then, once you’ve highlighted what you want, press Return to open it.

    In other words, you can get to anything in the Spotlight menu with only a few keystrokes.

  • The Esc key (top-left corner of your keyboard) offers a two-stage “back out of this” method. Tap it once to close the Spotlight menu and erase what you’ve typed, so that you’re all ready to type in something different. Tap Esc a second time to close the Spotlight text box entirely, having given up on the whole idea of searching.

  • Think of Spotlight as your little black book. When you need to look up a number in Address Book, don’t bother opening Address Book; it’s faster to use Spotlight. You can type somebody’s name or even part of someone’s phone number.

  • If you’re searching for just one word, you’ll see a “Look Up” category near the bottom of the results menu. Click it to open up that word’s definition in the Dictionary program. That’s new in Lion.

  • The bottom of Spotlight always lists commands for “Search Web for [your phrase]” and “Search Wikipedia for [your phrase].” They take you straight to the Google search or the Wikipedia (online encyclopedia) results for whatever you typed. That’s new in Lion, too.

  • Among a million other things, Spotlight tracks the keywords, descriptions, faces, and places you’ve applied to your pictures in iPhoto. As a result, you can find, open, or insert any iPhoto photo at any time, no matter what program you’re using, just by using the Spotlight box at the top of every Open File dialog box (Auto Save and Versions)! This is a great way to insert a photo into an outgoing email message, a presentation, or a Web page you’re designing. iPhoto doesn’t even have to be running.

  • Spotlight is also a quick way to adjust one of your Mac’s preference settings. Instead of opening the System Preferences program, type the first few letters of, say, volume or network or clock into Spotlight. The Spotlight menu lists the appropriate System Preferences panel, so you can jump directly to it.

  • As shown in Figure 3-2, you get a preview of what’s inside a file listed in the Spotlight menu when you point to it without clicking. But if you add the ⌘ key, you see a tiny line of text below the preview. It tells you the item’s actual name—which is useful if Spotlight listed something because of text that appears inside the file, not its name—and if you wait a moment, you also see its folder path (that is, where it is on your hard drive).

    Tip

    If you’re in a hurry, just press ⌘-Option as you point. That makes the folder path appear immediately.

  • While you’re pointing to something in the results list, you can press ⌘-I to open the Get Info window for it.

  • The Spotlight menu lists 20 found items. In the following pages, you’ll learn about how to see the rest of the stuff. But for now, note that you can eliminate some of the categories that show up here (like PDF documents or Bookmarks), and even rearrange them, to permit more of the other kinds of things to enjoy those 20 seats of honor. Details on Privacy Settings.

  • Spotlight shows you only the matches from your account and the public areas of the Mac (like the System, Application, and Developer folders)—but not what’s in anyone else’s Home folder. If you were hoping to search your spouse’s email for phrases like “meet you at midnight,” forget it.

  • If Spotlight finds a different version of something on each of two hard drives, it lets you know by displaying a faint gray hard drive name after each such item in the menu.

  • Spotlight works by storing an index, a private, multimegabyte Dewey Decimal System, on each hard drive, disk partition, or USB flash (memory) drive. If you have some oddball type of disk, like a hard drive that’s been formatted for Windows, Spotlight doesn’t ordinarily index it—but you can turn on indexing by using the File→Get Info command on that drive’s icon.

Tip

Spotlight can even find words inside files on other computers on your network—as long as they’re also Macs running Leopard, Snow Leopard, or Lion. If not, Spotlight can search only for the names of files on other networked computers.

Advanced Menu Searches

Most people just type the words they’re looking for into the Spotlight box. But if that’s all you type, you’re missing a lot of the fun.

Use quotes

If you type more than one word, Spotlight works just the way Google does. That is, it finds things that contain both words somewhere inside.

But if you’re searching for a phrase where the words really belong together, put quotes around them. You’ll save yourself from having to wade through hundreds of results where the words appear separately.

For example, searching for military intelligence rounds up documents that contain those two words, but not necessarily side by side. Searching for “military intelligence” finds documents that contain that exact phrase. (Insert your own political joke here.)

Limit by kind

You can confine your search to certain categories using a simple code. For example, to find all photos, type kind:image. If you’re looking for a presentation document but you’re not sure whether you used Keynote, iWork, or PowerPoint to create it, type kind:presentation into the box. And so on.

Here’s the complete list of kinds. Remember to precede each keyword type with kind and a colon.

To find this:

Use one of these keywords:

A program

app, application, applications

Someone in your Address Book

contact, contacts

A folder or disk

folder, folders

A message in Mail

email, emails, mail message, mail messages

An iCal appointment

event, events

An iCal task

to do, to dos, todo, todos

A graphic

image, images

A movie

movie, movies

A music file

music

An audio file

audio

A PDF file

pdf, pdfs

A System Preferences control

preferences, system preferences

A Safari bookmark

bookmark, bookmarks

A font

font, fonts

A presentation (PowerPoint, iWork)

presentation, presentations

You can combine these codes with the text you’re seeking, too. For example, if you’re pretty sure you had a photo called “Naked Mole-Rat,” you could cut directly to it by typing mole kind:images or kind:images mole (the order doesn’t matter).

Limit by recent date

You can use a similar code to restrict the search by chronology. If you type date:yesterday, then Spotlight limits its hunt to items you last opened yesterday.

Here’s the complete list of date keywords you can use: this year, this month, this week, yesterday, today, tomorrow, next week, next month, next year. (The last four items are useful only for finding upcoming iCal appointments. Even Spotlight can’t show you files you haven’t created yet.)

Limit by metadata

If your brain is already on the verge of exploding, now might be a good time to take a break.

These days, you can limit Spotlight searches by any of the 125 different info-morsels that may be stored as part of the files on your Mac: author, audio bit rate, city, composer, camera model, pixel width, and so on. Other has a complete discussion of these so-called metadata types. (Metadata means “data about the data”—that is, descriptive info-bites about the files themselves.) Here are a few examples:

  • author:casey. Finds all documents with “casey” in the Author field. (This presumes that you’ve actually entered the name Casey into the document’s Author box. Microsoft Word, for example, has a place to store this information.)

  • width:800. Finds all graphics that are 800 pixels wide.

  • flash:1. Finds all photos that were taken with the camera’s flash on. (To find photos with the flash off, you’d type flash:0. A number of the yes/no criteria work this way: Use 1 for yes, 0 for no.)

  • modified:3/7/12-3/10/12. Finds all documents modified between March 7 and March 10, 2012. You can also type created:6/1/12 to find all the files you created on June 1, 2012. Type modified:<=3/9/12 to find all documents you edited on or before March 9, 2012.

    As you can see, three range-finding symbols are available for your queries: <, >, and - (hyphen). The < means “before” or “less than”; the > means “after” or “greater than”; and the hyphen indicates a range (of dates, sizes, or whatever you’re looking for).

Tip

Here again, you can string words together. To find all PDFs you opened today, use date:today kind:PDF. And if you’re looking for a PDF document that you created on July 4, 2012, containing the word wombat, you can type created:7/4/12 kind:pdf wombat—although at this point, you’re not saving all that much time.

Now, those examples are just a few representative searches out of the dozens that Mac OS X makes available.

It turns out that the search criteria codes you can type into the Spotlight box (author:casey, width:800, and so on) correspond to the master list that appears when you choose Other in the Spotlight window, as described on Other. In other words, there are 125 different search criteria.

There’s only one confusing part: In the Other list, lots of metadata types have spaces in their names—pixel width, musical genre, phone number, and so on.

Yet you’re allowed to use only one word before the colon when you type a search into the Spotlight box. For example, even though pixel width is a metadata type, you have to use width: or pixelwidth: in your search.

So it would probably be helpful to have a master list of the one-word codes that Spotlight recognizes—the shorthand versions of the criteria described on Other.

Here it is, a Missing Manual exclusive, deep from within the bowels of Apple’s Spotlight department: the master list of one-word codes. (Note that some search criteria have several alternate one-word names.)

Real Search Attribute

One-Word Name(s)

Keywords

keyword

Title

title

Subject

subject, title

Theme

theme

Authors

author, from, with, by

Editors

editor

Projects

project

Where from

wherefrom

Comment

comment

Copyright

copyright

Producer

producer

Used dates

used, date

Last opened

lastused, date

Content created

contentcreated, created, date

Content modified

contentmodified, modified, date

Duration

duration, time

Item creation

itemcreated, created, date

Contact keywords

contactkeyword, keyword

Version

version

Pixel height

pixelheight, height

Pixel width

pixelwidth, width

Page height

pageheight, height

Page width

pagewidth, width

Color space

colorspace

Bits per sample

bitspersample, bps

Flash

flash

Focal length

focallength

Alpha channel

alpha

Device make (camera brand)

make

Device model (camera model)

model

ISO speed

iso

Orientation

orientation

Layers

layer

White balance

whitebalance

Aperture

aperture, fstop

Profile name

profile

Resolution width

widthdpi, dpi

Resolution height

heightdpi, dpi

Exposure mode

exposuremode

Exposure time

exposuretime, time

EXIF version

exifversion

Codecs

codec

Media types

mediatype

Streamable

streamable

Total bit rate

totalbitrate, bitrate

Video bit rate

videobitrate, bitrate

Audio bit rate

audiobitrate, bitrate

Delivery type

delivery

Altitude

altitude

Latitude

latitude

Longitude

longitude

Text content

intext

Display name

displayname, name

Red eye

redeye

Metering mode

meteringmode

Max aperture

maxaperture

F-number

fnumber, fstop

Exposure program

exposureprogram

Exposure time

exposuretime, time

Headline

headline, title

Instructions

instructions

City

city

State or province

state, province

Country

country

Album

album, title

Sample rate

audiosamplerate, samplerate

Channel count

channels

Tempo

tempo

Key signature

keysignature, key

Time signature

timesignature

Audio encoding application

audioencodingapplication

Composer

composer, author, by

Lyricist

lyricist, author, by

Track number

tracknumber

Recording date

recordingdate, date

Musical genre

musicalgenre, genre

General MIDI sequence

ismidi

Recipients

recipient, to, with

Year recorded

yearrecorded, year

Organizations

organization

Languages

language

Rights

rights

Publishers

publisher

Contributors

contributor, by, author, with

Coverage

coverage

Description

description, comment

Identifier

id

Audiences

audience, to

Pages

pages

Security method

securitymethod

Content Creator

creator

Due date

duedate, date

Encoding software

encodingapplication

Rating

starrating

Phone number

phonenumber

Email addresses

email

Instant message addresses

imname

Kind

kind

URL

url

Recipient email addresses

email

Email addresses

email

Filename

filename

File pathname

path

Size

size

Created

created

Modified

modified

Owner

owner

Group

group

Stationery

stationery

File invisible

invisible

File label

label

Spotlight comments

spotlightcomment, comment

Fonts

font

Instrument category

instrumentcategory

Instrument name

instrumentname

Boolean searches

What comp sci professors call Boolean searches are terms that round up results containing either of two search terms, both search terms, or one term but not another.

To go Boolean, you’re supposed to incorporate terms like AND, OR, or NOT into your search queries.

For example, you can round up a list of files that match two terms by typing, say, vacation AND kids. (That’s also how you’d find documents coauthored by two people—you and a pal, for example. You’d search for author:Casey AND author:Chris. Yes, you have to type Boolean terms in all capitals.)

Tip

You can use parentheses instead of AND, if you like. That is, typing (vacation kids) finds documents that contain both words, not necessarily together. But the truth is, Spotlight runs an AND search whenever you type two terms, like vacation kids—neither parentheses nor AND is required.

If you use OR, you can find items that match either of two search criteria. Typing kind:jpeg OR kind:pdf turns up photos and PDF files in a single list.

The minus sign (hyphen) works, too. If you did a search for dolphins, hoping to turn up sea-mammal documents, but instead find your results contaminated by football-team listings, by all means repeat the search with dolphins -miami. Mac OS X eliminates all documents containing “Miami.”

Tip

The word NOT works the same way. You could type dolphins NOT miami to achieve the same effect. But the hyphen is faster to type.

Get Mac OS X Lion: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.