OSX sidebar orphans annoyance / binary XML whinge

February 21, 2010

I have circled around the Mac-Sun-Windows-Linux loop since the 1980s. Currently I am part of what Keith N calls the “invasion of the Mac brain snatchers”. Mac market share is slowly increasing amongst the general populace, but amongst astronomers its probably already the majority. If the gods that reside at One Infinite Loop have noticed this phenomenon, they maybe assume its because we appreciate and understand the power, flexibility, and beauty of OSX. Well Steve, it aint bad, but actually ITS THE UNIX. If Gnome and KDE keep improving, and Apple keep being commercial control freaks, it could be Ubuntu for me next time. (Unless there are Android laptops or something by then of course.) I just spotted  a worrying development on OSX – binary XML. Begin digression …

The OSX interface is pretty good, and the terminal interface is v.useful. (I use iTerm in preference to the standard Terminal – this is because it has tabs you can rename.) But there are some occasional annoyances. One that has hit me a few times is the issue of sidebar orphans.  You can drag aliases for frequently used folders and other items to a sidebar in the Finder, which is nice. Occasionally, as I re-organise my folders I end up with aliases for items that no longer exist, and I can’t even remove them, as when you click on the alias, you just get a message that says “can’t find this volume” or similar. I am a tad confused, as I have been trying to produce these orphans deliberately in the last few minutes and failing – moving and deleting folders seems to work ok. I just know it happens sometimes, and I have been getting a slowly longer list of them ! (I found a forum discussion here, but its a bit out of date.)

So I thought, this list has to be stored somewhere. I will find the file and edit it . Sure enough, there is a file called “com.apple.sidebar.plist” in Users/name/Library/Preferences. If I click on this file, it opens up in the Property List Editor. This has a mixture of the obvious and the gobbledygook, but its not hard to locate the item concerned and do “Delete Item”.

But its a tad mysterious. Finder says that this plist is an XML file, but it aint text; it seem to be a binary file, and the Property List Editor unpacks and formats it, as well as acting as a dedicated editor. If you try the Help menu, although it says “Property List Editor Help” it jumps straight to Xcode Help, way above my head. I isn’t a developer. I installed Xcode because I wanted Macports, which requires the X11 SDK, which comes bundled with Xcode.I just did what the nice folks at Macports told me too. I think the Property List Editor comes with Xcode, so in fact without this I would not have been able to edit this list at all.  Apparently you can change items on the command line with the “defaults” utility, or use the “plutil” utility for converting back to text – see this forum page.

This brought home to me that OSX is not just a GUI written in Unix. The OS itself, and the developer framework,  are also highly specialised constructs. Its maybe a lucky accident for us that the Unix layer is still visible and useable so that we can write shell scripts, install IRAF or whatever. This short wikipedia article explains the evolution of plist files. The original NeXTSTEP version was plain text. OSX 10.0 changed this to an XML format, defined by a public DTD; OSX 10.2 changed this to binary XML, which a normal user can’t inspect at all, and a geeky user can only inspect afer installing the Apple Developer Tools package (aka Xcode).

And there was me thinking that the point of XML was that it was an open plain text format, and that the Mac, being based on Unix, was transparent, modular, and flexible, in beautiful contrast to the incomprehensible gargantuan tangle that is the Windows Registry.  Well in relative terms, it still is.. but its a worrying trend.

For those of you who don’t want to install Xcode, there are some lightweight third party plist editors listed in the above wikipedia article, and the web page for this one also has a nice rant about binary XML.

Oh, and because I am a responsible parent, I should say “Before Using the Property List Editor, do a Back Up“, and could you all sign the disclaimer firm please ?