Re: Finder Color Label
Re: Finder Color Label
- Subject: Re: Finder Color Label
- From: Daniel Stødle <email@hidden>
- Date: Wed, 24 Aug 2005 15:26:13 +0200
Hi Patrick,
You can get a file or folder's label as follows. Input to the
function is a path, output is the label index. There may be more
efficient ways, but this one works for me :) Code typed in mail, so
beware of typos.
int myGetLabel(char *path) {
FSRef ref;
FSSpec spec;
IconRef icon;
SInt16 label;
if (FSPathMakeRef((UInt8*)path, &ref, 0) == noErr) {
if (FSGetCatalogInfo(&ref, kFSCatInfoNone, 0, 0, &spec, 0)
== noErr) {
if (GetIconRefFromFile(&spec, &icon, &label) == noErr) {
ReleaseIconRef(icon);
return label;
}
}
}
return -1;
}
Best regards,
Daniel Stødle, Yellow Lemon Software
Check out FolderGlance:
http://home.online.no/~stoedle/YLS/YLS-products/FolderGlance.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden