Find Files Faster Using Spotlight Keyword Searches

Searchable Keywords Can Include Comments You Add to a File

Spotlight Comments as Keywords
Use the Get Info window to add keywords to your documents. Screen shot courtesy of Coyote Moon, Inc.

Keeping track of all of the documents on your Mac can be a difficult task; remembering file names or file contents is even more difficult. And if you haven't accessed the document it's in recently, you may not remember where you stored a particular piece of valuable data.

Luckily, Apple provides Spotlight, a pretty fast search system for the Mac. Spotlight can search on file names, as well as the contents of files.

It can also search on keywords or metadata associated with a file. How do you create keywords for files? I'm glad you asked.

Keywords and Metadata

Many files on your Mac already contain quite a bit of metadata. For example, that photo you downloaded from your camera probably contains a great deal of metadata about the image, including exposure, lens used, whether a flash was used, image size, and color space.

If you would like to quickly see a photo's metadata, try the following.

This will work best with a photo downloaded from your camera or a photo that came from a friend’s camera. Pictures you find on the web may not contain much in the way of metadata, other than image size and color space.

  1. Open a Finder window, and navigate to one of your favorite photos.
  2. Right-click the image file, and select Get Info from the pop-up menu.
  3. In the Get Info window that opens, expand the More Info section.
  4. The EXIF (Exchangeable Image File Format) information (metadata) will be displayed.

    The reason we went to the effort to show you the metadata that may be contained in some file types is to show you file information that Spotlight is able to search for.

    For instance, if you wish to find all of your photos taken with an F stop of 5.6, you could use a Spotlight search of fstop:5.6.

    We'll delve further into Spotlight metadata later on, but first, a bit about keywords.

    The metadata contained within a file aren't the only search keywords you can use. You can actually create your own keywords for any file on your Mac that you have read/write permission to access. Essentially, that means you can assign custom keywords to all of your user files.

    Adding Keyword to Files

    Some file types already have keywords associated with them, as we demonstrated above, with an image's EXIF data.

    But most of the document files you use on a day-to-day basis probably don't have any associated searchable keywords that Spotlight can use. But it doesn’t have to stay that way; you can add keywords yourself to help you find a file later on, when you've long since forgotten commonly searched keywords, such as file title or date. A good example of the kind of keyword you may add to a file is a project name, so you can quickly find all of the files needed for a project you're working on.

    To add keywords to a file, follow this easy process.

    1. Use the Finder to locate the file to which you want to add keywords.
    2. Right-click the file, and select Get Info from the pop-up menu.
    3. In the Get Info window that opens, there's a section labeled Comments. In OS X Mountain Lion and earlier, the Comments section is right near the top of the Get Info window, and is labeled Spotlight Comments. In OS X Mavericks and later, the Comments section is around the middle of the Get Info window, and will likely need to be expanded by clicking on the disclosure triangle next to the word Comments.
    1. In the Comments or Spotlight Comments section, add your keywords, using commas to separate them.
    2. Close the Get Info window.

    Using Spotlight to Search for Comments

    Names you enter into the Comments section aren't directly searchable by Spotlight; instead, you need to precede them with the keyword 'comment.' For example:

    comment:project dark castle

    This would cause Spotlight to search for any file that has a comment with the name 'project dark castle.' Note that the word 'comment' is followed by a colon and that there's no space between the colon and the keyword for which you wish to search.

    Published: 7/9/2010

    Updated: 11/20/2015

    Was this page helpful?