• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Adding Spotlight comment data to folder/file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding Spotlight comment data to folder/file


  • Subject: Re: Adding Spotlight comment data to folder/file
  • From: Wim Lewis <email@hidden>
  • Date: Mon, 11 Jul 2011 16:57:41 -0700

On 11 Jul 2011, at 12:05 PM, Kevin Muldoon wrote:
> Would like to get/set Spotlight comments into directories and files. I thought this would have been the easy part.

IIRC you can read them pretty easily as the kMDItemFinderComment metadata attribute. Setting them is harder.

The comments are stored in two places, AIUI --- an extended file attribute (com.apple.metadata:kMDItemFinderComment xattr) and in the .DS_Store file (maybe only on older OS revisions) --- neither of which seem like things other apps should mess with directly. I think the most-nearly-supported way to do this is still to send an aevt to the Finder (set the <comt> property of the file to the text you want).

Some example code here, though be aware it was mostly written in the 10.4 timeframe: https://github.com/omnigroup/OmniGroup/blob/master/Frameworks/OmniAppKit/OpenStepExtensions.subproj/NSFileManager-OAExtensions.m

Technote 2045 seems to have vanished softly and silently away from the web, but it's still available in Xcode's embedded document viewer.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Adding Spotlight comment data to folder/file
      • From: Kevin Muldoon <email@hidden>
References: 
 >Adding Spotlight comment data to folder/file (From: Kevin Muldoon <email@hidden>)

  • Prev by Date: Adding Spotlight comment data to folder/file
  • Next by Date: Re: Adding Spotlight comment data to folder/file
  • Previous by thread: Adding Spotlight comment data to folder/file
  • Next by thread: Re: Adding Spotlight comment data to folder/file
  • Index(es):
    • Date
    • Thread