Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Access the Address Book database from the shell' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Access the Address Book database from the shell
Authored by: famousactress on Jun 13, '03 11:54:05AM

This is great, but it's read only, yes?

My dilemma is that I'm trying to move contacts from Outlook to Mac. I'm new to Macs, and I see that I could export vcards, but Outlook won't let me do that in batch (dipsh!ts at microsoft).. I did however get them exported to a comma separated file.

I was hoping I'd be able to write an ant task / java program that would pile them into Address Book but I've been unable to figure out where/how the Address Book stores it's data. (I was praying for an xml file somewhere, but I'm beginning to doubt that it's that easy).

Anyone have a suggestion? If I get some help and complete the program, I'll be sure to make it publically available here.

thanks,
-phill



[ Reply to This | # ]
Access the Address Book database from the shell
Authored by: famousactress on Jun 13, '03 12:02:19PM

ahhight.. I found AddressBook.data

but... I have NO idea what effing format it's in. Anyone know where accessing this thing is documented?

Plz excuse my newbness :)

-Phill



[ Reply to This | # ]
Access the Address Book database from the shell
Authored by: mdzorn on Jun 13, '03 12:12:34PM

There are two ways to do that:
1. The long way: You can use another program, such as Netscape or Mozilla, to import the TAB-delimited file. This creates an LDIF file that can be imported into AddressBook.

2. The Highway: Create an entry in AddressBook. Export that entry onto your desktop as a vCard file. Examine the vCard file in a text editor and write a perl script (Java program, Objective-C, Fortran, ... ) to reformat your TAB-delimited file into a vCard file. Import vCard file into AddressBook.



[ Reply to This | # ]
Modify the Address Book
Authored by: Krioni on Jun 13, '03 01:02:17PM
The author of contacts could probably add the feature.

If he used AppleScript to get information from AB (and he probably did), then features could be added to let you edit/add information to AB.

However, the syntax for adding and/or modifying entries is more complex than for pulling out data. Also, you have to remember to send the "save database" change after every command.

[ Reply to This | # ]

Re: Modifying Address Book
Authored by: Krioni on Jun 13, '03 01:17:06PM

It seems he is using the actual Address Book framework that Apple made available to developers - not sending AppleScript commands through 'do shell script'. I opened up his code in ProjectBuilder (he released it under GPL), and it loads the Ab framework, and is coded in Objective C.

Cool! Of course, that means I'll have to learn more than the little Obj-C I know now if i wanted to make any changes. :-) Been busy in AppleScript, and haven't had time to learn Obj-C. Maybe someday...



[ Reply to This | # ]
Access the Address Book database from the shell
Authored by: at_sym on Jun 13, '03 03:06:15PM
Could you not use Address Book Importer 1.1.1? It has the ability to move a tab-separated file into the Address Book.

[ Reply to This | # ]
Try this
Authored by: jecwobble on Jun 13, '03 03:33:52PM

I submitted this in the Apple forums: Outlook 2000 macro for vCal & vCard export

I use this macro to batch export contacts and appointments to vCal and vCard format, which can be dropped right into Address Book and iCal.

[ Reply to This | # ]

Holy Helpful!
Authored by: famousactress on Jun 13, '03 04:36:04PM

Sheesh. Thanks a ton for all the advice. I imagine I'll be able to get this to work for sure now!

-phill



[ Reply to This | # ]
Holy Helpful!
Authored by: famousactress on Jun 13, '03 04:50:55PM
I used the utility over at roydesign with absolute success. If anyone else is dealing with the same problem, I highly recommend it.. Took all of 5 minutes to download and use it. :) -phill

[ Reply to This | # ]
Access the Address Book database from the shell
Authored by: dfbills on Jun 14, '03 08:37:56PM

Of course you can export your contacts in vcf from outlook for windows. You can even to them all in one batch to individual files. The import/export engine is quite good.

Once exported, just drop them all into addressbook.

That's all there is to it.



[ Reply to This | # ]