For awhile now, people have been requesting that I put something in XRG’s interface to allow them to turn off the UI Elements, such as having the XRG icon shown in the dock. There has always been kind of a hack to do this, by adding the following text to the app Contents/Info.plist file:

<key>NSUIElement</key>
<true/>

This is fine, but in Panther it got a little bit more difficult. Panther now caches these Info.plist files. This is great…the more caching the better, especially for things like Info.plist files that don’t change often. The bad thing is that the cache doesn’t check the last modified date of the plist file. Instead, it checks if the modification date for the .app directory has been changed. I’m not sure why they would do this, as it seems to me that checking the plist file modification date would be just as easy, and that way they know they have a copy of the latest file.

Some people have remarked here that if you move the application to a different directory and back, that the cache gets updated and all is well. This is fine, if a user is changing this value by hand and using the Finder to do it, but it leaves a little to be desired if you are trying to change this value programmatically. I thought of just moving the .app to “X Resource Graph 1.app” and then back real quick, but that doesn’t seem like a nice way of doing things. So that got me thinking, and I found a much easier way to do it using the simple Unix executable, “touch”. I was very pleased to find that making the change manually and touching the application worked just fine. Since it’s very easy to run a quick system command from code, this shouldn’t be a problem at all, so it should be in the next version of XRG.

Anyway, so if anyone is trying to do this same thing from code, hopefully this will help. Now all I need to do is find a way for the change to take effect without having to restart the app. Maybe some kind of hack on the Dock like the one other coders use to add rogue menu extras.