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:
- Highrise account
- Mac OS X Address Book
- Ruby
- Ruby Gems
- The script itself - highrise_to_vcard.rb
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
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.












Please add your comments...