views:

613

answers:

2

I'm working on a small project at home that would add a badge (aka icon overlay) to a specific file based on its state. Anyway, I've Googled the hell out of it and the only documentation I was able to find was on Apple's developers site (Obtaining and Using Icons With Icon Services).

The documentation expects the developer to be familiar with Objective-C file APIs, which I'm not. So, I'm wondering if someone can please give me some code examples for adding badges to a file and directory. Thanks in advance!!

+2  A: 

The link you posted to is for the Carbon (pre-MacOSX) API. Whilst it might work in the Carbon finder of 10.5, the Finder in 10.6 is pure Cocoa and as a result of which might not support the concept of badges in that regard.

You can add badges to an application in the dock with NSDockTile but you won't have much luck in documents for applications on the whole. You'd either need to monitor the documents through some other mechanism and then use, say, a QuickLook plugin to generate a miniaturized view with whatever your state happens to be.

Failing that, you could write your own view for the documents (in which you could add such information) rather than using Finder.

AlBlue
+3  A: 
epatel