I had a distasteful experience just now. It seems, so far, to have ended well. It began when I clicked on an ftp link in Apple’s Mail package. The link was to a .pdf file. Safari (WebKit) was already running but it launched Firefox beta 3. I like the way Safari treats .pdf files and Firefox beta lacks features I need. (Firefox 2 has features that Safari and Firefox 3 lack which are occasionally important to me.) I thought that this was a problem with WebKit since WebKit claimed that it was my default browser and I implicitly assumed that since clicking the link launched a browser, that it had launched my default browser. WebKit being a beta project invites bug reports and I submitted this peculiar behavior as a bug. Their reply introduced me to the concept of “default ftp client” which seems like a plausible concept whose name sort of explains itself. WebKit is off the hook.

They also suggested an arcane way to set the default ftp client which I resisted because I don’t like running obscure code from unknown sites, even when recommended by people I trust.

I consulted Apple’s various and sometimes helpful Help facilities for the phrase “default ftp client”. No hits. I asked Google which led to innumerable pages suggesting that the solution to some problem was merely to change your default ftp client. None of these said how to do so, except for one 3rd party application that sounded as if it could do this.

One site recommended editing file “~/Library/Preferences/com.apple.LaunchServices.plist” for changing some other sort of default launch choice. I dislike XML. Of several editors only TextWrangler was able to decode the mysterious format in which that file was coded. I found three occurrences of “ftp” and one was related to the string “org.mozilla.firefox”. I found a corresponding string “org.webkit.nightly.WebKit” including “webkit” and substituted the 2nd string for the 1st. I rebooted and I now get the Safari beta when I click on the ftp link. Later I made the same change for “http” and “https” in place of “ftp”. Now I can click on a link in Mail and get Safari beta.

When, in TextWrangler, I change the character coding to ISO Latin-1 and write a new file, the new file is about 6 times larger. Some compression is going on. XML needs it.

Some enlightenment—do “man plutil”.
Also do “man defaults”.

The Dark Side

I have committed original sin, however; I have edited a plist!!
I do not understand the format of a .plist file. TextWrangler evidently does; perhaps it invokes plutil.
I get the feeling that Apple does not want users editing these files but they are not protected.
I don’t like having to go to Google to learn how to administer my machine. It seems to be the only way.
This is the sort of stuff that I wish I didn't have to know!

The Lighter Side

The plist format seems to suit programs, as XML does not. The native language of fast programs is arrays, pointers, 32 bit integers and even an occasional string. I am glad that XML parsing is not in the inner loop of my applications.
I think that the binary1 (‘compressed’) form is the normal state of a plist and that application code works only with that form. It is translated to XML only to provide external read-write access, and then only grudgingly.