Default style (Cherry Eve). Switch styles (Capricorn). XML Feed Calendar
All | General
20040914 Tuesday September 14, 2004

Get rid of the duplicate entries in your address book

After developed the Firefox extension Show java console, I came up with an idea to develop another extesion for mozilla address book that can remove the duplicate entries (in terms of email address), because there are many duplicate email addresses in my address book, like foo@sun.com, foo@Sun.Com, Foo@sun.com etc. It's very annoying especially when you use the auto-complete feature - the drop-down list is filled with the same guy's name which you don't want to send email to. Manually editing the abook.mab is not an option because that file is in a computer-friendly format.

The extension itself is very straightforward - it goes through every entry in gAbView (card = gAbView.getCardFromRow(i)), then get email address from each card (email = card.primaryEmail.toLowerCase()) and lower case it, compare to existing addresses to see whether it's a dup, if so, select this entry so that user can remove all of them later by just pressing Del key. It's also a good idea to lower case all email address at the mean time, but card.editCardToDatabase(gAbView.URI) must be used for committing the change to database.

BTW, the problem of mozilla not treating foo@sun.com and foo@Sun.Com as the same entry is here. Changing 4th argument from PR_FLASE to PR_TRUE would fix this problem. Any regressions? God knows.

I prepared two packages for the extension and source code, but I can't upload them to this site, sigh...

September 14, 2004 03:43 AM PDT Permalink

Calendar

« September 2004 »
SunMonTueWedThuFriSat
   
2
3
4
5
6
7
10
12
15
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  
       
Today

Links


Navigation


Referers

Today's Page Hits: 23