Using OpenMeta with eyes open

When Tags and OpenMeta were released within a day of one another a few weeks ago, I was ecstatic. Using Tags felt like magic (assign a tag, and it’s instantly shows up in Spotlight! Wow!), and OpenMeta’s open source release promised to lower the threshold for other developers to implement this fantastic tagging solution in their own apps. I wondered what the catch was, but Ironic Software advertises that OpenMeta uses no secret APIs, and Gravity Apps when I asked merely said that they were using extended attributes.

This turns out to be only half the story, however, and should you be a developer or user considering OpenMeta (or Tags) as a solution for your tagging needs you need to use it with eyes open. Although the technology OpenMeta uses is completely on the level, the way in which it achieves instant Spotlight availability is based on exploiting Spotlight’s preferential treatment of metadata that is identified as coming from Apple. This doesn’t mean that you should swear off OpenMeta and Tags (I’m still using them), but before you go tag-crazy you definitely need to consider the risks.

How does it do that?!

OpenMeta uses a technology called extended attributes to store and retrieve tags. Extended attributes (or xattr as they are often referred to by those in love with tech-speak) are a way for third parties or users themselves to add arbitrary metadata to files. Using extended attributes for tagging is entirely legitimate; the reason that they haven’t been used for generic tagging software before is that extended attributes are not indexed by Spotlight unless the program creating them registers them via a Spotlight importer, which means that the only program that will know about the special tagging extended attribute will be the program that created the tag.

Unfortunately, any given file can only have one Spotlight importer, which is usually the program that created the file. Clearly it isn’t feasible for a piece of tagging software to convince all the various developers whose files might be tagged to add support for their tags in their importers, so the typical route for adding information to the Spotlight index is out. (Thanks to Michael Tsai for clarifying this for me.)

OpenMeta gets around the Spotlight problem by identifying its tag attribute as coming from Apple. Spotlight automatically indexes extended attributes placed in the Apple namespace, and OpenMeta exploits this by quietly writing its tags into that namespace.

This is a problem because Apple doesn’t support other programs writing information to their namespace (the expected and sanctioned behavior is for programs to create their own unique namespace). Since Apple doesn’t support it, OpenMeta may or may not continue to work the way that it does now with subsequent updates to the operating system, and tag data may or may not be preserved.

OpenMeta (although possibly not Tags) does take steps to ensure that your information is backed up. In the event of extended attributes getting wiped for a file (which can occasionally happen if other programs are buggy in their use of extended attributes), OpenMeta stores backups of your tags in your Library folder. This, however, does not address the problem that OpenMeta is injecting information into an area that is reserved for Apple’s use.

So should I use OpenMeta?

Whether you should use OpenMeta is a question both developers and users should ask themselves before blindly adopting the technology. On the one hand, it has significant benefits and at long last offers a standardized way for programs to share tagging information with one another and the system without relying on Spotlight comments. On the other, the program is exploiting unsupported aspects of the operating system and can thus offer no promises about its future viability.

Michael Tsai of EagleFiler fame is the first developer I know of to have been willing to frankly discuss the downsides and specifics of OpenMeta’s implementation, and over the course of a long and wending forum discussion he recommends that OpenMeta change its focus from storing tags in an Apple namespace to storing tags in an OpenMeta-specific namespace available to all tagging programs with duplicate storage in the Apple namespace offered as an option for those to whom Spotlight integration is worth the potential downsides. For developers, I agree with Michael. Were I developing an app of my own that used tagging, I would be leery of relying on a framework that forced me to write to an unsupported namespace with no alternative, supported method for data storage.

For users the question of whether or not to use OpenMeta or Tags is more a matter of personal needs and preferences. If their functionality feels as much like magic to you as it does to me and you’re comfortable with using technology that isn’t officially supported by Apple, then by all means tag away. If you are using tags in a mission critical environment, you may want to think carefully about whether OpenMeta is for you but for most users the risk of data loss is extremely low.

Although I haven’t created a full-fledged system yet, I’ve slowly been developing a use for Tags which uses tags as supplemental information, pairing it with Hazel where I can to enable automatic sorting of tagged files into my standard folder hierarchy. I wouldn’t recommend using OpenMeta to try and replace a folder structure, but by utilizing it to add information I can have a richer store of metadata without being hamstrung if an OS update for some reason broke OpenMeta.

Whether OpenMeta will work for you or not should be based not just upon how great the product seems but also how comfortable you are with the methods being used behind the scenes.

My hope is that as OpenMeta and Tags gain traction, Apple will finally take note and address the problem of third party extended attributes having no way to get into the Spotlight index. Whether that happens or not, however, is impossible to predict; time will tell if OpenMeta is ahead of the curve or if it will ultimately go the route of SpotMeta.

For more information about the specifics of how OpenMeta does its thing, I highly recommend reading some of Michael Tsai’s posts in the aforementioned Ironic Software forum discussion. Although the thread ranges pretty far afield, some of the early information offers a very specific look at what OpenMeta is doing, and there are some interesting suggestions for alternative ways the software could go about achieving its various goals.