Importing Contacts via AppleScript

Seems it is impossible to import a contact containing Cyrillic characters… You end up with “?” signs instead of them (

I think the bug occurs when you tell DT to create record with {name:name of theContact & “.vcf”, source:vCard of theContact, type:unknown}

vCard text itself as an AppleScript variable is ok with Cyrillic characters, but this bad magic happens somewhere in create record with function.

The only workaround for now is to write vCard to theFile as Unicode text on the disk and then importing resulting vcf into the DT… But this is quite a workAROUND )

Any thoughts?

Creating unknown file types like VCards that way isn’t supported but importing a valid VCard file is of course. Any reason why you’re not using File > Import > Contacts? Or are the contacts retrieved from another source, e.g. via email?

Planning to build a script for automatic contacts backup. It will regularly copy/renew contacts in DT and also mark those you have deleted in Contacts (I think to write custom metadata, like “archive”). So you always have the latest version of all your “active” contacts, keeping them lean and mean, and the archive, you can save, search and restore if needed.
For this to make, I need to write some custom metadata, like date changed, archive status and id - to quick jump to Contacts and DT back and forth.

I saw the feature “File > Import > Contacts”, it is good, but:

  • You have to manually start this process every time
  • To write additional custom info you’ll have to compare contacts in the Contacts app against those you’ve just imported

So, I have the same feature request like with, please, make AppleScript functions, like import contact and import email analogues to those of GUI, this would be really helpful to deal with emails and contacts.

@cgrunenberg and all DevonTech Team, thank you very much for making it all work now (v3.7) without any workarounds! Now you just use create record with AppleScript function if you want to import Contacts (.vcf files) or Messages (.eml files).

With Mail messages it even automatically make the message-id as the UUID of created Devonthink record!

Many thanks!

1 Like