Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Getting the most out of Leopard’s Spotlight menu

hrmpf on November 6th, 2007

getting the most out of spotlight
Leopard Spotlight is infintely better than Tiger Spotlight; it’s faster and is much more flexible. Apple has made the searching easy by adding simple nature language Attributes which make searching for particular metadata easy. I’ve been exploring what tags can used in the spotlight menu.

Attributes are the tags like date: or kind: etc. These are incredibly useful but don’t seem to be well documented anywhere. I’ve made a collection of some of the attributes I’ve found, be sure to add any useful ones you’ve found in the comments

duedate?
When was a file used, modified, looked at etc?
date: (checks lastused and duedate:), created:, used:, lastused:, duedate:
These are self explanatory but very useful. The only concern is the formats you use for the dates.


date format

Unfortunately, Apple hasn’t been consistent with the way you can enter dates for the above attributes. For the date: you can use relative and word dates and is fairly flexible: today, tomorrow, “this week”, “this month”, “this year”, (”next X” or “last X” doesn’t work).

same?
For the rest of the date attributes you have to use the format month/day/YEAR with year as 4 digits eg 2007. Amazingly, Apple has made it so that spotlight honours the data format in the international System Preference. So if you’re in the UK or Australia and have your preference set for those date formats enter day/month/year. If you change the preference and then use terminal to do a mdfind it’ll produce two different results… Automagical! Good on you Apple!
spotlightExamples
modified:5/11/2007 or in the US modified:11/5/2007
modified:5/11/2007-6/11/2007
For example, what applications did I use yesterday?
used:5/11/2007 AND kind:application

Searching for Files

filename:
Self explanatory, as it says on the box?

kind:
documents, image, presentation, PDF, music, mp3, Applications, events, fonts, safari (webpages),preference ,contact, person ,email, message
Examples
kind:safari AND date:today
N.B. make sure you Spotlight Preferences allow the view of the filetype you want (for example I don’t have Music files displaying in the spotlight menu and it was confusing me when i searched kind:music that nothing came up!)
author:

language:
this is interesting. It identified Shiira as the only program I had with a Swedish localisation

wherefrom:wherefrom:
This is a great attribute it allows you to identify files downloaded from the internet (with Safari at least) and files attached to emails. This is how Apple keeps tracks of your downloads and asks if you really want to open an Application.
example
wherefrom:apple.com

Email Search from the Spotlight

subject:, recipient:, cc:, from:
Very useful attributes for searching for email from your Spotlight menu. It’s easier than starting up Mail and starting a search. Really Quick!

bigpictures.png

Images

Lots of attributes here, I won’t go into too many but send in any useful ones.
pixelwidth: pixelheight:
example pixelwith:>3500 (show me images which are larger than 3500 pixels across)
flash: 0 or 1 (image files created where the camera used flash)


picture-12.png

Nested Searches, Lots of AND OR and brackets

This is so useful, you can basically write what ever sort
Very powerful: eg. show me my emails from yesterday and
(date:yesterday AND kind:email) OR duedate:5/11/2008

Command Keys for the Spotlight Menu

Open the top hit: ⌘-Return
Move to the first item in the next category: ⌘-Down Arrow
Move to the first item in the previous category: ⌘-Up Arrow
Move to the first item in the menu: Control-Up Arrow
Move to the last item in the menu: Control-Down Arrow
Display an item in the Finder: ⌘-click the item



Write a Comment

Take a moment to comment and tell us what you think. Some basic HTML is allowed for formatting.

Reader Comments

thanks for this, much appreciated.

I wonder where we can get a hold of ALL possible search attributes? I would love to see such a list

Also, when searching is Spotlight,
Option-click: opens “Show All” window
typing a calculation
sine(10)*5
will show the result under “caluclator”!!!

I agree, the new spotlight is amazing. Taken MANY queue from Quicksilver, since they try to do similar things anyway.

Ref: date formats, more specifically, “this week”, “this month”, “this year”:

1: How are these entered? The two word format seems to violate the rule of one word before the colon. I note that if I put the words in parentheses, I get search results. Otherwise, stringing the words together as one word, or omitting parentheses, produces no results. But that leads to the second question:

2: Which “date” in a file’s metadata responds to the search request: Date created? Date modified? Last date opened? Any or all of the above? I can’t seem to establish a pattern by experimentation.

Hey Craig,
thanks for the interest-
1. if you put:
date:”this month”
it should work, though testing it for “this week” seems to just return files since the last Sunday… :this week: I suppose, though I would have thought in the last seven days would be more intuitive

2. it searches for kMDItemLastUsedDate (which is the date last opened) or the due date for calendar events

Thanks, hrmpf.



s