Import Vcf Contacts

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (7007 is a long time :D 2007 is correct)
(extension for multiple contacts per file)
Line 2: Line 2:
  
 
[http://www.smurfy.de/files/neo/ac simple vcf import script]
 
[http://www.smurfy.de/files/neo/ac simple vcf import script]
 +
 +
Al Johnson posted an extension to this script to handle vcf files wihl multiple contacts. It should work as before if there's just one contact per file. Here's the modified bit:
 +
 +
for name in names:
 +
  print name
 +
  vcard = ""
 +
  f=open(name,'r')
 +
  for line in f:
 +
    vcard = vcard + line
 +
    if line[:9] == "END:VCARD":
 +
      getAddressBook().addContact(vcard)
 +
      vcard = ""
  
 
This Script is for the 2007.2 Version (default install on Neo FreeRunner) not for Qtopia
 
This Script is for the 2007.2 Version (default install on Neo FreeRunner) not for Qtopia

Revision as of 15:25, 10 July 2008

If you want to import your old Contacts to your Neo you could use this simple script:

simple vcf import script

Al Johnson posted an extension to this script to handle vcf files wihl multiple contacts. It should work as before if there's just one contact per file. Here's the modified bit:

for name in names:
  print name
  vcard = ""
  f=open(name,'r')
  for line in f:
   vcard = vcard + line
   if line[:9] == "END:VCARD":
     getAddressBook().addContact(vcard)
     vcard = ""

This Script is for the 2007.2 Version (default install on Neo FreeRunner) not for Qtopia

You need python to use this script do a

opkg install python-dbus

to install python and the python dbus module

Next step is to export your old contacts as vcf. I know its possible with Nokia phones and i used a Winmobile->activesync->Outlook export plugin to get my Contacts from my old Cell.

The script does a listdir and imports ALL files it found in that dir. (i'm a bad python programmer)

so this is what i have done.

  • copied all vcf files to a separate directory on my freerunner
  • copied the ac script to the parent directory also on my freerunner
  • go to the terminal on the freerunner and "typed" in the vcf directory: "python ../ac" (root@om-gta02:~/vcf# python ../ac)
  • done :D

Troubleshooting:

  • make sure you have python and python-dbus installed
  • make sure you have no illegal chars (utf) in the filename and inside the vcf files. (I had problems with Ü,Ä etc)
  • only vcf files should be in you current directory so do a ../ac.
  • You must call the script in the OM terminal not via Bluetooth or USB. If you do so a dbus error occur


Thanks to Import_Sim_Contacts for the original Python Script.

Personal tools

If you want to import your old Contacts to your Neo you could use this simple script:

simple vcf import script

Al Johnson posted an extension to this script to handle vcf files wihl multiple contacts. It should work as before if there's just one contact per file. Here's the modified bit:

for name in names:
  print name
  vcard = ""
  f=open(name,'r')
  for line in f:
   vcard = vcard + line
   if line[:9] == "END:VCARD":
     getAddressBook().addContact(vcard)
     vcard = ""

This Script is for the 2007.2 Version (default install on Neo FreeRunner) not for Qtopia

You need python to use this script do a

opkg install python-dbus

to install python and the python dbus module

Next step is to export your old contacts as vcf. I know its possible with Nokia phones and i used a Winmobile->activesync->Outlook export plugin to get my Contacts from my old Cell.

The script does a listdir and imports ALL files it found in that dir. (i'm a bad python programmer)

so this is what i have done.

  • copied all vcf files to a separate directory on my freerunner
  • copied the ac script to the parent directory also on my freerunner
  • go to the terminal on the freerunner and "typed" in the vcf directory: "python ../ac" (root@om-gta02:~/vcf# python ../ac)
  • done :D

Troubleshooting:

  • make sure you have python and python-dbus installed
  • make sure you have no illegal chars (utf) in the filename and inside the vcf files. (I had problems with Ü,Ä etc)
  • only vcf files should be in you current directory so do a ../ac.
  • You must call the script in the OM terminal not via Bluetooth or USB. If you do so a dbus error occur


Thanks to Import_Sim_Contacts for the original Python Script.