5 Ways to get the most out of Spotlight

I remember when Spotlight was a major selling point of OSX. This ability search your entire computer and have the results before you’ve finished typing was very impressive. This ease of use belies the power that lies within SpotlightSpotlight Logo, it really is a Google for your desktop (as opposed to Google Desktop, which is a completely different product). Like Google, the simple interface hides some of the more advanced features, so in this article I’ll show you five ways of using Spotlight that really leverages it’s power to your advantage.

  1. Search for files of a specific type – A Spotlight Search using the KIND operator.Much like the “filetype” operator in Google (try adding “filetype:pdf” to only get pdf files in your search results in Google), you can tell Spotlight to only return certain types of files in the results. You do this by adding “kind:” and then a filetype to your search query. For example, “kind:application” will only return applications, “kind:email” will only return emails. If you know what you’re looking for, this can narrow down the results you get, a lot.
  2. Search for files based on date – Using the date operator, you can narrow down results to only those that have been opened in a certain date range. Probably the most common usage is adding “date:today” (or this week/month) to get files that you’ve been using recently.
  3. Search a word through the services menu/right click – The services menu remains a dark art for many, but there is some useful stuff in there. Spotlight accessed from the services menu.One of the features I find myself using is the spotlight option. Simply highlight a work in a Cocoa application,Safari for example, then use the “Spotlight” option to search for that word using spotlight. Alternatively, and this is how you’ll really use it, highlight a word and press Command and Shift and “F”. It may only shave a few seconds off your workflow, but it all adds up. If you prefer the mouse, you can also right/command click on a highlighted word to search for it.
  4. Create a smart folder – I love my smart folders, I really do. They are so versatile and basically remove the need to arrange your documents yourself. The screenshot to the right shows the screen you see when creating a smart folder, there are many options that basically reflect what’s possible in Spotlight. There are multiple ways to work with smart folders, you can pull together all the files from a specific project, of a specific filetype, or even organise your files so they are sorted by priority. I can’t tell you how usefull smart folders can be. To create one, just fire up finder, click File in the menu and then “New Smart Folder”. Enter the criteria, using the query builder, and hit save. Now you have a folder that contains everything that meets the criteria you set, and it will automatically update to pull in the latest files you add that meet the criteria. This was one of my hidden gems previously, you can find a fuller explanation in that article.
  5. Tale control of your index – Spotlight, like many search tools uses something called an index. This is a file, group of files or database that contains the pertinent information from the files on your computer. Then, when you perform a search Spotlight looks in the index, not in the files themselves. This speeds searches up considerably but can cause performance problems elsewhere. Notably, the act of building the index can be fairly demanding, and is typically done fairly often, and the index itself can get quite large. To find out the size of your index, have a look at the .Spotlight-V100 folder in the root of your main drive (it puts a folder like this in every volume it indexes). You’ll have to turn hidden files on to do this (“defaults write com.apple.finder AppleShowAllFiles TRUE” in terminal). So, in the interests of size and speed, it’s best to limit the size of your index. So, to do this, fire up Spotlight PreferencesSystem Preferences and head to the Spotlight section. In the first tab you can control the order in which results are displayed to you by dragging them up and down. Additionally, you can de-select the check boxes next to each section to prevent them appearing in the search results at all. This will also prevent them from being indexed. So, I have a number of file types deselected, as you can see in the screenshot. Yet I can still find everything I need to. If you need to be really ruthless, you can use the privacy tab in the preferences to limit even within the file types you have selected, if you only want to search certain files in your documents folder for example. It makes a difference.

For more tips, head over to the official OSX spotlight tips page – http://www.apple.com/macosx/tips/spotlight.html