On Jul 10, 2008, at 5:29 PM, Chris Idou wrote:

How does one programmatically change Finder comments and keywords?

I found this comment about MDItemSetAttribute...

[...]

The other suggestion I've seen is to send Apple events to the Finder to change these things. Since I'm writing a background application it seems terribly messy to be asking a foreground app to be doing stuff for me. Would it pop up the Finder window? That would be really ugly.

Any comments? Apple event code would be gratefully accepted if that is the only way.

You shouldn't have to resort to undocumented API. Look for setComment: in this file:

https://bibdesk.svn.sourceforge.net/svnroot/bibdesk/trunk/bibdesk/NSFileManager_BDSKExtensions.m

The implementation is based off of OmniAppKit and MoreAppleEvents; it's quite fast and does not activate the Finder, although it might cause problems for users that replace the Finder. It looks like all of the functions are in CoreServices, so should be safe for a background app.

--
Adam

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to