Help Exporting a VCard file from FileMaker
HAS ANYONE HAD good luck with exporting a VCard file (.vcf) from FileMaker? A solution that works with both Mac and Windows?
I have tried the Vcard custom function found on briandunning.com, but cannot get an exported file to work. I am exporting from FileMaker 13 on a Mac and have tried these variations of export file: txt, csv, utf-8, utf-16, Macintosh, Windows. Is I save it as a .vcf file, Contacts throws this error:
If I save it as a .csv or a .txt, this error occurs:
I have also tried exporting as XML, but that requires a xml stylesheet in the same folder as the program, which for this solution is on a server. And the sample solutions I downloaded don’t work even when it is there.
I’ve tried the solutions at the following links:
- http://ryosode.com/blog/?p=812
- http://blog.nealandassociates.co.uk/2010/09/07/exporting-to-vcard-from-filemaker/
- http://simoncpage.co.uk/blog/2008/08/filemaker-to-vcard/
No luck with any of them.
So, please comment if you have a solution or link to try. And thanks for helping out. I’ll post the solution in a later post.
EfficientBizz
August 20, 2014 @ 6:39 am
Hi Don
I’m pretty sure, that suffix must be ‘.vcf ‘ . Might be similar to what I did with Calendar-Data’s for iCal or Outlook Calendar with building ‘.ics ‘ files.
I’ld recommend to choose any adress in Apple-Contacts and use “Export VCard”. Open this file with Text-Editor to analyse. Rebuild the entire content with a FM formula for scriptable export.
For your current attempt, make sure you’re using correct data format. In such case, failure may be a ISO- instead a UTF8 (or UTF16) format.
Another attempt could be to create a adress record in apple Contacts and export VCF, create record with same content in FMP and make export. Now, compare both results with a simple text editor or BBEdit(!) to detect any errors.
Greetings 🙂
BEGIN:VCARD
VERSION:3.0
PRODID:-//Apple Inc.//Mac OS X 10.10//EN
N:;;;;
FN:EfficientBizz GmbH
ORG:EfficientBizz GmbH;
EMAIL;type=INTERNET;type=WORK;type=pref:info@medicalbizz.ch
TEL;type=CELL;type=VOICE;type=pref:+41 44 383 67 65
item1.TEL:EfficientBizz
item1.X-ABLabel:Skype
item2.ADR;type=WORK;type=pref:;;Mainaustrasse 44;Zürich;;8008;Switzerland
item2.X-ABADR:ch
NOTE:MedicalBizz® – Die effizienteste Lösung für Ihre Praxisadministration
item3.URL;type=pref:www.medicalbizz.ch
item3.X-ABLabel:_$!!$_
PHOTO;ENCODING=b;TYPE=JPEG:/…
//Base64 encoded Picture//
X-ABShowAs:COMPANY
CATEGORIES:Natel
UID:344BCE43-6AEE-4873-933A-E71DA3C5E7FF
X-ABUID:B01ECD9E-3E58-48AF-923B-0EA8E2A1BB5A:ABPerson
END:VCARD
Don Clark
August 20, 2014 @ 7:06 am
Thanks, EfficientBizz. I’ll give your ideas a try and see how it pans out. I was, lazily, hoping for an easy fix. It doesn’t seem to be in the offing.
Karen Weaver
August 20, 2014 @ 10:20 am
Hi Don
I have an OLD function/script that works. For PC, it saves the vcf to the desk top. For the Mac it automatically imports – just testing on Mavericks, I do get an error like your first one on automatically open, but it works when I step through the debugger. So probably would work with a tweak or two. It uses a custom function by Chris Pye to save the data in a v-card data to a field, then script exports field contents with vcf file name.
Let me know if you want it.
Douglas Alder
August 20, 2014 @ 10:56 am
Hi Don,
Sounds like you are running up against the UTF-8/UTF-16 issue. (documented here: http://hbase.net/2012/09/05/how-to-get-useful-text-documents-exported-out-of-filemaker-for-the-internet-export-utf-8-vs-utf-16/)
Try using the Virtual List approach. I used it here with exporting .ics files.
http://hbase.net/2014/05/16/exporting-calendar-files-ics-from-filemaker-pro-13/
In your script, generate your VCF text for export and then instead of xml, or export from field, use a generic export of a batch of records matched to the virtual list. Make sure you select UTF-8 as the text format in the export.
If all goes well, it should be cross platform.
Hope this helps. Post a demo file if it works….
Doug
EfficientBizz
August 20, 2014 @ 12:37 pm
I miss the ‘Like-Button’ here 🙂
Douglas just made the point:
– ISO / UTF8/UTF16 mistake is very likely
– Virtual List is a save way to prevent coding mistakes since export format is set by FMP as a native script function
Don Clark
August 20, 2014 @ 5:12 pm
Thanks Douglas, Karen, and EfficientBizz for your help. I will try your suggestions and let you know via a new comment. Unfortunately, it will be a few days due to other commitments.