Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm running the latest OS X (10.8.1). Yesterday I discovered the Spotlight Comments feature, so I went through many of my Applications and put useful comments in that field. For example, on Music Manager.app, I put the spotlight comment "google music", since it's Google Music's manager app and I would want that to appear in my search results.

It's been at least a day now and I still don't see it when I do a spotlight search for "google music". What am I doing wrong? How long does it take for Spotlight to realize applications have comments and index them?

share|improve this question
add comment

2 Answers

The comments should normally show up in Spotlight results after you close an information window in Finder. You can tell Spotlight to reindex directories or files with mdimport, but it should do that automatically most of the time.

The Spotlight comments seem to be stored in both .DS_Store files and extended attributes. But if a file is owned by root, Finder doesn't write the comment to an extended attribute, and it won't be seen by Spotlight either.

If you use xattr to add the comments, they are picked up by Spotlight, but they aren't shown in Finder's information windows.

sudo touch test
sudo xattr -w com.apple.metadata:kMDItemFinderComment somecomment test

If you open Finder as root, they are saved in both extended attributes and .DS_Store files.

sudo /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder
share|improve this answer
add comment

The simplest answer, from what I can see, is to make sure that all comments are comma-delimited. So, "google music" becomes "google, music" (without quotes). I have been using this as a "tagging" system for the past few years, and it definitely works just like this. I can't remember where exactly I discovered that commas were necessary, but I had the same problem beforehand, and no problems afterward.
The only other hitch I've hit is that occasionally I'll search for a file or folder that I know I've tagged, and it won't show up. This is because sometimes, for no good reason, these comments will just get wiped. I've never figured out how or why this happens, but it doesn't happen often, and it's never caused any serious problems. Regardless, use commas, and that should solve your problem.

share|improve this answer
    
And this will make Spotlight pick up the comments? Did you verify this? –  patrix Sep 19 '12 at 6:07
    
Yep. I've been using spotlight comments for years –  soxman Sep 19 '12 at 14:44
    
I'm more wondering about the comma. I don't see how this would change the way Spotlight includes comments and it also would be rather cumbersome for longer comments (e.g. "Pictures from Alaska trip 2009" or "Do not delete this file EVER") –  patrix Sep 19 '12 at 14:47
    
Cumbersome or not, this is the way it works. If you want Spotlight to see that you've added "Pictures from Alaska trip 2009" then it must be written as "Pictures, from, Alaska, trip, 2009". That being said, I would approach this method with more of a keyword/tagging mindset, e.g., "Alaska, trip, pictures, 2009" or similar. Trust me, this has been my tagging system for years, and if you don't use commas to delimit, it will not work. –  soxman Sep 19 '12 at 15:54
    
Well, it does here. I just entered a comment without commas and Spotlight picked it up a few seconds later. –  patrix Sep 19 '12 at 16:01
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.