An AppleScript to publish Address Book as HTML
May 19, '05 09:13:00AM
Contributed by: robophilosopher
I'm not sure what sort of tools DotMac may or may not have for this, but I've once or twice thought "gee, I wish I had a copy of my Mac address book online somewhere, so I could get to it from away from my Mac." Now that school is over for the year and I've had time to teach myself some more AppleScript, I wrote a little AppleScript to save my Address Book in HTML form. It doesn't do anything fancy, and isn't very easy on the eyes (a cost of having very readable code). If anyone out there wants to make the page prettier, I'd love to see (and use) the changes.
Here's what you need to do to run the script:
- Create a web root folder somewhere (I suggest an "Addresses" folder on your desktop, which you can then move to an online location.)
- Open ScriptEditor, copy and paste the script into the window, and edit the first line to match the path to the directory you created above.
- Click the Run button and wait. It takes about three minutes to run for me (335 address cards on a 1GHz G4), so it could take a while depending on the size of your Address Book database.
- Open index.html in the folder you created, and use your web browser's "search" function to find an entry. Make sure to open index.html with a web browser and not a text editor, which might be the default.
Some things that still remain to be done:
- Make the output much prettier.
- Put the index page in alphabetical order.
[robg adds: I tested this script, and it worked as described.]
Comments (10)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20050508193551743