views:

20

answers:

1

I am writing a Spotlight importer for an application that stores content in files with meaningless names. There is benefit from allowing the user to search for these files, however.

It's easy enough to write an importer that extracts and returns useful metadata but when the user does a search in Spotlight they are presented with the meaningless file names.

I'd like to be able to change the string returned in a Spotlight search. For example, if the search returns file "abc123.qrt" I'd like it to display as "useful name for result". Is there a way to do this? Ideally there would be an appropriate piece of metadata that Spotlight (or Finder) would respect.

-Andy

+3  A: 

After a bit of digging turns out that 'kMDItemDisplayName' does the trick. It wasn't immediately working for me but did once I managed to re-import the file

AndyK