I want to color badge files and folders based on the some condition in finder, what is the approach to achieve this in Mac OS X 10.6
I have checked this question: Th
For anybody still needing an answer to this here you go.
NSURL *fileURL = [NSURL fileURLWithPath:path_to_file];
NSError *error;
id labelColor = nil;
[fileURL setResourceValue:@2 forKey:NSURLLabelNumberKey error:&error]; //Set tag/label to green
[fileURL setResourceValue:@6 forKey:NSURLLabelNumberKey error:&error]; //Set tag/label to red
Garrett Hyde has the correct order.
// 0 none, 1 grey, 2 green, 3 purple, 4 blue, 5 yellow, 6 red, 7 orange
The above code has been tested using Xcode 4.6.3 and OSX 10.9.2 Mavericks.