:: contacts :: | home | ucontrol | contacts | macosx | gbasdk | java | jfunc ::

The utility contacts gives you access to view and search all your records in the AddressBook database. I developed a prototype a while back, but this hint rekindled my interest in it. So, I finished up the code, wrote the docs, and released it. Download it contacts1.1.dmg (includes the source code). Unfortunately, contacts 1.1 will not run on Jaguar but contacts 1.0 will (contacts1.0.dmg).

With version 1.1, contacts is now installed in /usr/bin instead of /usr/local/bin; the '-S' option was added; firstname first or vice versa is now handled correctly; added the notes to the search fields; added tokens to access addresses (i.e. '%a', '%ha', etc); added '%u' token to access unique identifier for each person.

To install contacts, double click the contacts1.1.pkg and follow the instructions. To uninstall contacts, run the following commands (if you're installing contacts in the first place, you should be somewhat comfortable with the command line):

$ rm /usr/bin/contacts $ rm /usr/share/man/man1/contacts.1

Without further ado, here are a few examples:

$ contacts -h usage: contacts [-hHsmnlS] [-f format] [search] -h displays help (this) -H suppress header -s sort list -m show me -n displays note below each record -l loose formatting (doesn't truncate record values) -S strict formatting (doesn't add space between columns) -f accepts a format string (see man page) displays contacts from the AddressBook database $ contacts NAME PHONE IM EMAIL Kim Jong Il +82-(001)385 License2KimJongill [email protected] George W Bush 202-276-4300 Bush43 [email protected] [...] $ contacts bush NAME PHONE IM EMAIL George W Bush 202-276-4300 Bush43 [email protected] $ contacts -f "%n %w" mrill NAME HOMEPAGE Kim Jong Il http://www.livejournal.com/users/kim_jong_il__/

For more info and details, see the man page. Oh and contacts is licensed under the GPL.

$ man contacts NAME contacts - displays contacts from the AddressBook database SYNOPSIS contacts [-hHsnmlS] [-f format] [search] DESCRIPTION The utility contacts affords easy access to information in the Address- Book database from the shell. [...]

Contributions, patches, ideas, and criticisms are welcome.

-shane (at) gnufoo (dot) org

Ad-hoc FAQ

Do you have any plans to add the ability to modify the AddressBook database?

I imagine someone will add the ability to add, modify, and delete records in contacts. I'm curious to see what some people come up with. I have a few ideas myself. I do not want to see the utility blow up with a ton of options to facilitate that. It should be simple. Imagine you want to synchronize your contacts from one machine to another. Maybe you could do something like this:

$ contacts export | rsh $host contacts add

So yes, I probably will add some ability to add, modify, and delete to contacts in the future, but I am not going to invest a lot of time in it right now. And I would encourage anyone out there who's really interested in it to give it a hack. Again, I'm curious to see what people come up with.