What to Know
- Select Spotlight (magnifying glass) from the top menu bar, enter a search term, and choose from the resulting files.
- You can search for photo metadata; for example, to find photos taken with a 5.6 F-stop, search fstop:5.6.
- If you add keywords to a file via Get Info > Comments, do a Spotlight search with this syntax: comment:[keyword].
This article explains how to use the Mac's Spotlight quick-search feature to find files based on file names, keywords in file contents, or associated metadata.
Use Spotlight to Find 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 see a photo's metadata quickly, 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.
- Open a Finder window, and navigate to one of your favorite photos.
- Right-click the image file, and select Get Info from the pop-up menu.
- In the Get Info window that opens, expand the More Info section.
- The EXIF (Exchangeable Image File Format) information (metadata) will be displayed.
We went to the effort to show you the metadata that may be contained in some file types to show you which file information Spotlight can 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 isn't the only search keywords you can use. You can create your 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.
How to Add 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. An excellent 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.
- Use the Finder to locate the file to which you want to add keywords.
- Right-click the file, and select Get Info from the pop-up menu.
- 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.
- In the Comments or Spotlight Comments section, add your keywords, using commas to separate them.
- Close the Get Info window.
How to Use 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 a colon follows the word 'comment' and that there's no space between the colon and the keyword for which you wish to search.