Who we are.

Who we are

if by design is a web design and development agency based in the Midlands, UK.

Don't forget to visit our website.

How to find what you want

How to find what you want

Our blog contains articles with hints, how-tos and other thoughts. To help you find what you want they have been organised into categories:

 

Highrise: How to export vCards with photographs for Mac OS X Address Book

highrise_to_vcard.jpg

Having spent the day importing and sorting my contacts in Highrise I was annoyed to find that the vCard export didn’t include images. I didn’t fancy the prospect of having to go through each contact and manually export their photograph so I created a script to do it for me.

The following Ruby script uses Highrise’s API to export vCards with the photographs intact ready for Mac OS X Address Book.

Ingredients

To make this script work you will need:

Step 1: Backup

It’s a good idea to backup your Address Book before starting this process. Just in case anything goes wrong!

Step 2: Gems

The script requires Hpricot and Vpim. To install these, open a terminal window and type:

sudo gem install hpricot vpim

Step 3: Permissions

The script needs to have the correct permissions to run. To sort this out, open a terminal window and type:

chmod 774 highrise_to_vcard.rb

Step 4: Setup

The script needs two variables set. To do this, open the script in a text editor (I recommend TextMate) and editor the variables in the setup section of the code. You will need to add your Highrise token and site address.


# --- SETUP --- #
# Enter your Highrise token, found under "My Info"
HIGHRISE_TOKEN = ‘YOUR_TOKEN’

# Enter your Highrise site address, http://<siteaddress>.highrisehq.com
HIGHRISE_ADDRESS = ‘YOUR ADDRESS’

# — END SETUP — #

Step 5: Run

Now run the script from a terminal window and watch as it exports all your contacts:

ruby highrise_to_vcard.rb

Step 6: Import

The script outputs all the vCards into a file called highrise.rb. Simply import this file into Address Book and your contacts will appear with their photographs.

All done

This script works fine for me. I only have about 100 contacts at present but it should work with any number.

Please feel free to tweak, change and update the script. Post a comment below to let me know how you get on or if you need any help.

What’s actually happening?

The script uses the Highrise API to download a list of all your contacts. It then parses the list using Hpricot and builds vCards using Vpim. For more information please see the script itself, it is fairly well commented.

 
  1. Hello your post is stunning.
    I like your blog..
    ciao

    Be a Good Daughter said on 21 October 2007 at 11:43 pm
  2. Hi Stuart,

    Just wanted to say a quick thanks for this. Was looking for a script to get me started with Highrise and Ruby, so that I didn’t have to do some of the basic grunt work to get going. Really appreciate your generosity in sharing this!

    cheers,
    Scott

    scott lewis said on 7 September 2008 at 9:39 pm

Please add your comments...


We hate spam. Your email address will not
be published, sold or leased to anyone.


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>