VCard with Address fields

6,716 views
Skip to first unread message

Jaime Hart

unread,
Feb 10, 2014, 11:54:37 AM2/10/14
to xmpie...@googlegroups.com
I've used the XMPie Barcode/QR code to generate a vCard with the following function: 

XMPBarcode("QRCode", "BEGIN:VCARD\nVERSION:4.0\nN:" & |->[First] & " " & |->[Middle] & " " & |->[Last] & "\nORG:" & |->[Company] & "\nTITLE:" & |->[Title] & "\nTEL;TYPE=work,voice:" & |->[Direct] & "\nTEL;TYPE=cell,voice:" & |->[Mobile] & "\nEMAIL:" & |->[Email] & "\nADR;TYPE=work:" & |->[Address1] & "\nEND:VCARD") 

However, the format of the address should be: 
ADR;TYPE=work;:;;100 Waters Edge;Baytown;LA;30314;United States of America

Despite creating an ADOR in this format, using a formatted text file, trying to cancel out the semicolon with a backslash, and using the ASCii "&#59;" value too, the semicolon continuously appears as a comma when the QR code is scanned (causing all address fields to be populated in the Address 1 line).

Does anyone have any insight on this?

Thank you,
Jaime

Bob Paukst

unread,
Feb 12, 2014, 11:29:59 AM2/12/14
to xmpie...@googlegroups.com
Jaime,

I believe that your code is correct and follows the VCard standard as set forth.  I'm pretty sure that the problem you're experiencing is one that we've given up on.  The problem/issue is in either the interpretation of the standard by QR code reader software, or the hand-off to the mobile devices contact manager/address book.  As the standard seems quite basic, we are assuming for many devices it is in the handoff to the contact manager software of the device.

Your code does properly generate the ; and not , like you are assuming. 

Jaime Hart

unread,
Feb 14, 2014, 3:38:28 PM2/14/14
to xmpie...@googlegroups.com
Thanks for your response, Bob.

I was actually able to figure this out -- at least in my scenario.
If you fill in all fields (Address, City, State, Zip and Country), my iPhone interpreted the string correctly and and inserted each into the appropriate field.
It wasn't until all fields were filled that I was able to accomplish this.

J Stewart

unread,
Feb 14, 2014, 9:37:06 PM2/14/14
to xmpie...@googlegroups.com
Jamie,

I am not sure of the reason for the issue off hand. But perhaps you can use MeCard format instead which is much simpler, smaller and few semicolons. 

MECARD:N:Noah Coad;TEL:4258028842;EMAIL:no...@coad.net;ADR:1419 Comanche,Allen,TX,75013,;URL:coad.net;


Jeff

obsessed...@comcast.net

unread,
Feb 16, 2014, 12:06:29 PM2/16/14
to xmpie...@googlegroups.com
Jaime,

Kind of like you I’ve been working on some QLingo for a QR Code for vCards.
I’m getting all the information I need, but all the Address info ends up in the Address1 field. Would like to add some kind of attribute to the Addressing Properties specifying the sub-type of the address?

Kind of like you can with Telephone Type
TEL;TYPE=work,voice:" & |->[Direct] 
TEL;TYPE=cell,voice:" & |->[Mobile] 

ADR;TYPE=Address1" & |->[Address1] 
ADR;TYPE=Address2” & |->[Address2]
ADR;TYPE=City" & |->[City]
ADR;TYPE=State" & |->[State]
ADR;TYPE=Zip" & |->[Zip]


Here is my code so far

XMP2DQRCode("BEGIN:VCARD\\n
N:" & |->[Last] & ";" & |->[First] 
& "\\n
TITLE:" & |->[Title] 
& "\\n
ORG:" & |->[Company] 
& "\\n
ADR:" & |->[Address1] & "," & |->[Address2] & "," & |->[City] & ", " & |->[State] & " " & |->[Zip]  & " " & |->[Country]
& "\\n
URL:" & |->[URL] 
& "\\n
EMAIL:" & |->[Email] 
& "\\n
TEL;TYPE=work,voice:" & |->[phone]  & " " & |->[ext]
& "\\n
TEL;TYPE=cell,voice:" & |->[cell] 
& "\\n
TEL;TYPE=fax,voice:" & |->[fax] 
& "\\n
END:VCARD")

Am I thinking about this all wrong?
How do I fill in all the address  fields?
Thanks
Mark

Mark Kuehn

unread,
Feb 16, 2014, 1:24:22 PM2/16/14
to xmpie...@googlegroups.com
I see a couple of things you should change. You are using a comma "," instead of a semi-colon ";" to separate the "properties" of the Address "class". You are also missing some of the "properties" that can be included in an Address "class".

They properties in order are:
      post-office-box
      extended-address
      street-address
      locality
      region
      postal-code
      country-name

Therefore if you have the following address:
      John Doe
      Apt 2B
      123 Main St
      Anytown, ST 99999-9999
      United States of America

The snippet of code you want would be:
      BEGIN:VCARD
      VERSION:2.1
      N:Doe;John
      FN:John Done
      ADR;:;Apt 2B;123 Main St;Anytown;ST;99999-9999;United States of America
      END:VCARD

However, since many address book clients do not correctly support the "extended-address" property, I usually jam them together with a comma and space separator like this:
      BEGIN:VCARD
      VERSION:2.1
      N:Doe;John
      FN:John Done
      ADR;:;;123 Main St, Apt 2B;Anytown;ST;99999-9999;United States of America
      END:VCARD

***Note the "ADR" line contains a the text "ADR" followed by a semi colon, a colon, a semi colon, a semi colon, "Street-Address (address)", a semi colon, "Locality (city)", a semi colon, "Region (state)", a semi colon, "Postal-Code (ZIP)", a semi colon, "Country-Name (country)

You may want to include the address type specifier like WORK or HOME between the initial semi colon and colon.

An easy way to test your format is to place it into a file named "Doe.vcf", double click on it, and see what your address book client "does" with it.

-Mark


--
You received this message because you are subscribed to the Google Groups "XMPie Interest Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xmpie-users...@googlegroups.com.
To post to this group, send email to xmpie...@googlegroups.com.
Visit this group at http://groups.google.com/group/xmpie-users.
For more options, visit https://groups.google.com/groups/opt_out.

tyrone...@bigpond.com

unread,
Feb 16, 2014, 6:20:26 PM2/16/14
to xmpie...@googlegroups.com

has anyone worked out how to add facebook, twitter or linkedin info into their QR code for iPhone and Android? I have seen some examples but this is using a web page that emails to iPhone, I'm looking for QR code syntax.
 


Reply all
Reply to author
Forward
0 new messages