Wednesday, January 30, 2013

Dashes or other special characters "confuse" Spotlight on mac osx ...

Have you been trying to figure out why spotlight cannot find a file with a dash in the name?  How much time have you wasted wondering about this?  Well, look no further.  If your problem is something like this:
You know that there is a file on your mac called "something-book.pdf", so like an idiot, thinking that Spotlight will be friendly, you type what you know, -book.pdf, into Spotlight, and the "Top Hit" is "App Store" ... sigh.  You _know_ that the file is there somewhere!  But where is it?  Well, simply try this:

Solution:  Put the fragment of the filename in quotes, and viola, there is your file.  


Why should you have to put it in quotes you ask?  Why wouldn't it automatically default to putting everything in quotes itself, you ask?  Why isn't it more user friendly?  Well the answer is apparently embedded in the logic sourced in this document.

http://developer.apple.com/library/mac/#documentation/Carbon/Conceptual/SpotlightQuery/Concepts/QueryFormat.html

Let me know, when you have memorized that document, and can explain this is layman's terms.  Until then, let's see if you and I are the only two people who have ever experienced any issue with Spotlight.  The comments (or lack thereof) should be very telling.

Hope that helps.

1 comment:

Anonymous said...

I want to find all the duplicated files in the downloads folder, which are added by appending " (?)" where the question mark is the number of duplicates there are. Can I get this to work? Nope. So annoying.