With this approach, what would happen if a file type already had keywords? For example, lets say an MP3 file has id3 tags supporting keywords (I have no idea if this is true, but humour me). And lets say the MP3 spotlight importer puts these tags into kMDItemKeywords. Then someone uses your tag system to add tags with xattrs. Can the keywords from both approaches be combined by Spotlight? Or will one overrule the other?
tom.andersen wrote:We at ironic are working to release a new xattr based tagging system to the public domain within a week or three. We will open source the technology (which is just a few cocoa files).
Basically, it will:
1) Allow programs to set/retrieve tags, ratings, etc on files using a simple API. This api will enforce a few 'rules' about tags - (eg no duplicates, case insensitive, case preserving, etc). Rules are generally 'good' - they allow for consistent user experiences.
2) These tags are automatically indexed with Spotlight.
3) Uses no Apple 'secret' api.
4) Allows the setting of (non spotlight indexed) 'larger but still small (<4k)' blobs of meta data, such as workflows , etc.
There are a few 'gotchas' that we found while working this all out, which is one reason why we thought it was important to not only release the idea, but also some source to implement it.
Deep (see ironicsoftware.com) uses this tech.
--Tom