Month: April 2009

Default email addresses for contacts in OSX

Posted by on April 16, 2009

Have you ever wondered how OSX decides what email address to use when you email a contact? A lot of the time, you get to choose, but there are times when the system decides for itself… Such as when you are using iCal to send out event invitations.

There is actually a way that the system decides on which address to pick, and this is even a public API. The problem though, is that Address Book does not expose this interface to the user.

So, after some researching (to find the actual way this is implemented), I developed a small (command line) tool to change the default email address for a user. This tool, takes the form of a small python program, using the pyobjc bindings to the AddressBook framework.

The source code is avaliable from my repository in the stuff repository under the osx/addressbook/edit_default_address.py path.

You will also find in the same folder: a script to create a mutt alias file from the system address book, and a script to convert all of the phone numbers into the international format (from the Australian format).

These three programs form the basis of a good set of examples of the python objective-c bridge for the AddressBook format.

Adding fonts to linux

Posted by on April 7, 2009

I have been complaining for the last few days about my the font that I have been using in my terminal, so I decided to actually do something about it.
What I didn’t know, was how to go about installing some nicer fonts. While talking to James about this, he suggested that I can just create a ~/.fonts directory, and place the fonts in there. A great little piece of information, that I had no idea about.