Mac OS 10.7, Xcode 4.3.2

I have an application with which I would like to set Finder labels (colors) for 
directories. I use the URL resource API to read and write NSURLLabelNumberKey 
for the target directory. This works, up to a point.

If I set the label number to 0, it behaves as expected: Any label is removed.

If I set the label number to anything else (up to 7), the folder's label is 
set, but the label numbers don't seem to correspond to any order the Finder 
uses. Label 3 does not correspond to the third color in the Finder Preferences 
list, nor does it correspond (as one source suggests) to the third label in 
alphabetical order by name.

+[NSWorkspace fileLabelColors] returns the available label colors in the same 
order as the index.

What I'd really like is to use the same order as appears in the preferences, 
and in the File/contextual menu. That is, I'd like to conform to Apple's 
interface. Is this possible?

        — F


_______________________________________________

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

This email sent to arch...@mail-archive.com

Reply via email to