Jump to content
Server Maintenance This Week. ×

This topic is 1026 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Greets, all:

I'm looking to incorporate vCard creation into an FMP solution I'm working on, but the scripts I've found on the Web harken back to FMP v13* and earlier (before Base64 encoding) and they're a bit unwieldy to work with. Does anybody have, or can point me to, a script or custom function that'll create Vcards that's more recent/elegant?

Thanks,

Rich

*https://hbase.net/2014/10/22/exporting-vcards-from-filemaker-pro-13/.  I'm probably being dense, but I don't see where the Virtual List Utility table is (as mentioned in the artile.)

Link to comment
Share on other sites

I am somewhat confused by the various tangents in your question, such as Base64 encoding or Virtual List. 

A vCard is a plain text file and the preferable method to produce it from Filemaker, IMHO, is to export as XML and use a custom XSLT stylesheet to transform the result to the vCard format. This will work with any version since v.6 and has the advantage of not requiring the addition of any resources to the FMP file other than the exporting script.

The next best alternative would be to assemble the file contents in a variable, then encode it as UTF-8 using the TextEncode() function and export it via a global container field. This requires v.16 or higher.

Finally, in v.18 and higher you have the option of writing directly to a text file, courtesy of the new Data File script steps.

 

Link to comment
Share on other sites

Thanks. I didn't think it would be too complicated, but elsewhere here a post mentions using Base64 ( https://fmforums.com/topic/99956-base64-encodedecode-problems/?tab=comments#comment-454989  ) so I most likely misconstrued what he was trying to get at.

About the custom XSLT stylesheet--is that something I can use to encode the card so it's good-to-go if it's sent by e-mail, or is that something the end user would have to have to convert the file from XML?

 

Link to comment
Share on other sites

An XSLT stylesheet is used during an XML export. If the stylesheet's output is defined as:

<xsl:output method="text" encoding="UTF-8"/>

then the result of the export will be a UTF-8 encoded plain-text file, with no XML markup - and that's what you will be sending to the end user.

 

Edited by comment
Link to comment
Share on other sites

3 hours ago, comment said:

the preferable method to produce it from Filemaker, IMHO, is to export as XML

On second thought, since you will probably export only one record at a time, the other methods may be more convenient.

Also, if I am not mistaken, the vCard format requires CRLF line endings - and I don't know any reliable method to ensure that other than using the TextEncode() function to create container data, then either export it or write it to a data file.

I am attaching a quick sketch of how this might be constructed. As mentioned earlier, this requires v.18 or higher.

Caveat
This is only a draft and the results may not conform to the vCard format specification.

 

Create_vCard.fmp12

Edited by comment
  • Plus1 1
Link to comment
Share on other sites

This topic is 1026 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.