Xojo Conferences
MBSOct2019CologneDE

vCards (important for me) (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: garbage in databaseCursor ?
Next thread: IDE crashes while compiling


Re: Animation in a Canvas   -   Joseph J. Strout
  vCards (important for me)   -   Pepe
   Re: vCards (important for me)   -   Dr Gerard Hammond
   Re: vCards (important for me)   -   Noah Desch
    Re: vCards (important for me)   -   Pepe
     Re: vCards -> drag&drop   -   Pepe
    Re: vCards (important for me)   -   Joseph J. Strout
    Re: vCards (important for me)   -   Pepe
    Question about MySQL plugin 1.0.1   -   dOzOs dOOs
   Re: vCards (important for me)   -   Frank Bitterlich
    Re: vCards (important for me)   -   Daniel Kennett
     Re: vCards (important for me)   -   Pepe

vCards (important for me)
Date: 08.05.02 10:22 (Wed, 8 May 2002 11:22:49 +0200)
From: Pepe
Dear list,

I got a big problem. My application includes an address book, and I want
to add vCard import/export, because this would be great for interacting
with other apps as Entourage or Apple's address book as well as the iPod.

I read the RFC's of IMC's vCard at www.imc.org/pdi/, but nontheless I
seem to have problems.

a, Creating vCards.

Please check my code. What am I doing wrong?

 Dim f2 as FolderItem
 Dim Stream as TextOutputStream
 Dim i as Integer
 f2=getsavefolderitem("vcard", "VCard.vcf")

//if the user deletes the .vcf at the end of the line above,
//the whole thing doesn't become a vCard, but a normal
//document. Of course can I open it with TextEdit, but I want
//it to be a vCard!!!!

 Stream = f2.CreateTextFile

//The three lines below aren't that necessary, I believe,
//because I defined the creator and type already in RB

 f2.Maccreator="OPIM"
 f2.mactype="vCrd"
 f2.extensionVisible=true
 if Stream <> nil then

 //here the whole vCard stuff begins

   Stream.Close
 end if

If I add .vcf, then it gets a vCard, else a document. If it gets a vCard
and I try to drag&drop it to Apple's address book, the whole content
can't be seen. Only a "???" is visible. If I create a vCard with
TextEdit with exactly the same content (of course I replace.rtf with
.vcf), then Apple's address book can read it......what am I doing wrong?


b, the format of vCards

Most formats are like this:

begin:vcard
n:Pepe;Goehl
tel;home:(570) 111-111
fn:Pepe George
end:vcard

But some are like this:

n:Pepe;Goehl/ntel;home:(570) 111-111/nfn:Pepe George/nend:vcard/n

chr(13)'s are replaced with /n's. Why? Is one vCard version 2.1 and one
vCard version 3.0?

Moreover there seem to be different formats, like EMAIL;INTERNET: or
email;type=internet: ... both mean the same, but which one is version
2.1 and which one is version 3.0? And why are there different formats
for the same thing? And where can I find a complete list of all formats?
The RFC's don't seem to be that great...

c, Pictures

Furthermore there must be a way to store pictures in vCards...another
thing I don't understand...is this really possible?

d, Projects

Are there any RB projects dealing with vCards? I searched the internet
but didn't find a single one. Would be great if anyone coud give me
examples or tips.

Thank you!
I appreciate your help!

Yours,
Pepe

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: vCards (important for me)
Date: 08.05.02 10:55 (Wed, 8 May 2002 19:55:55 +1000)
From: Dr Gerard Hammond

Try putting...

f2.Maccreator="OPIM"

f2.mactype="vCrd"

at the end after the

Stream.Close

>Dear list,
>
>I got a big problem. My application includes an address book, and I
>want to add vCard import/export, because this would be great for
>interacting with other apps as Entourage or Apple's address book as
>well as the iPod.
>
>I read the RFC's of IMC's vCard at www.imc.org/pdi/, but nontheless
>I seem to have problems.
>
>a, Creating vCards.
>
>Please check my code. What am I doing wrong?
>
> Dim f2 as FolderItem
> Dim Stream as TextOutputStream
> Dim i as Integer
> f2=getsavefolderitem("vcard", "VCard.vcf")
>
>//if the user deletes the .vcf at the end of the line above,
>//the whole thing doesn't become a vCard, but a normal
>//document. Of course can I open it with TextEdit, but I want
>//it to be a vCard!!!!
>
> Stream = f2.CreateTextFile
>
>//The three lines below aren't that necessary, I believe,
>//because I defined the creator and type already in RB
>
> f2.Maccreator="OPIM"
> f2.mactype="vCrd"
> f2.extensionVisible=true
> if Stream <> nil then
>
> //here the whole vCard stuff begins
>
> Stream.Close
> end if
>
>If I add .vcf, then it gets a vCard, else a document. If it gets a
>vCard and I try to drag&drop it to Apple's address book, the whole
>content can't be seen. Only a "???" is visible. If I create a vCard
>with TextEdit with exactly the same content (of course I replace.rtf
>with .vcf), then Apple's address book can read it......what am I
>doing wrong?
>
>b, the format of vCards
>
>Most formats are like this:
>
>begin:vcard
>n:Pepe;Goehl
>tel;home:(570) 111-111
>fn:Pepe George
>end:vcard
>
>But some are like this:
>
>n:Pepe;Goehl/ntel;home:(570) 111-111/nfn:Pepe George/nend:vcard/n
>
>chr(13)'s are replaced with /n's. Why? Is one vCard version 2.1 and
>one vCard version 3.0?
>
>Moreover there seem to be different formats, like EMAIL;INTERNET: or
>email;type=internet: ... both mean the same, but which one is
>version 2.1 and which one is version 3.0? And why are there
>different formats for the same thing? And where can I find a
>complete list of all formats? The RFC's don't seem to be that
>great...
>
>c, Pictures
>
>Furthermore there must be a way to store pictures in
>vCards...another thing I don't understand...is this really possible?
>
>d, Projects
>
>Are there any RB projects dealing with vCards? I searched the
>internet but didn't find a single one. Would be great if anyone coud
>give me examples or tips.
>
>Thank you!
>I appreciate your help!
>
>Yours,
>Pepe
>
>---
>Subscribe to the digest: <mailto:<email address removed>>
>Unsubscribe:
><mailto:<email address removed>>

Re: vCards (important for me)
Date: 08.05.02 12:03 (Wed, 8 May 2002 07:03:55 -0400)
From: Noah Desch

On Wednesday, May 8, 2002, at 05:22 AM, Pepe wrote:

>  //here the whole vCard stuff begins
>
>    Stream.Close
>  end if
>
> If I add .vcf, then it gets a vCard, else a document. If it gets a vCard
> and I try to drag&drop it to Apple's address book, the whole content can'
> t be seen. Only a "???" is visible.

What are you using for line endings? Apple's address book is probably
expecting chr(10), not chr(13), which would be the principle difference
between your saved file and the TextEdit one. Beyond that, you may have to
change the textEncoding to something else (don't ask me what).

> c, Pictures
>
> Furthermore there must be a way to store pictures in vCards...another
> thing I don't understand...is this really possible?

I assume so since it's in the RFC, but I've never seen one with a picture
in it.

-Noah Desch
Wireframe Software
http://wireframe.virtualave.net

"The noozle! The noozle on the hoose!"
-Groundskeeper Willie

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: vCards (important for me)
Date: 08.05.02 14:38 (Wed, 8 May 2002 15:38:52 +0200)
From: Pepe
Hello list,

that's what you suggested me to do:



> Try putting...
>
> f2.Maccreator="OPIM"
>
> f2.mactype="vCrd"
>
> at the end after the
>
> Stream.Close

That was it! Thanks, now it always gets a real vCard.

> What are you using for line endings? Apple's address book is probably
> expecting chr(10), not chr(13), which would be the principle difference
> between your saved file and the TextEdit one. Beyond that, you may have
> to change the textEncoding to something else (don't ask me what).

That was pretty true. When I used chr(10) instead of chr(13) it worked.

By the way (it would be very cool if you would support me by trying this
out for yourself):

I realized that Apple's address book didn't recognize some vCard formats
like "ADD:" (including street, zip code, etc.) or "TEL;PREF". At first I
thought that I was doing something wrong, but then I took a complete
address of Apple's address book (including street address, etc.),
dropped it onto the desktop (so it got a vCard) and then I imported it
via drag&drop back into the address book (that means I simply dragged it
back)....and voila: it doesn't recognize street address and some
telephone formats. Furthermore it doesn't recognize the "X-CUSTOM"'s. Is
this a bug or why can't Apple's address book read the vCards created by
itself?

Moreover: is there a list somewhere with all preferred formats? Has
someone of you already dealed with this and can give me tips how to
import vCards?

Finally I want to create a vCard via drag&drop out of a listbox onto the
desktop.
If I use Drag.text°ablabla, then it gets a text clip, no vCard. Do I
have to use MacData to make it a vCard?

I really want to thank you for your help (I couldn't go on without it).

Greetings,
Pepe

Re: vCards (important for me)
Date: 08.05.02 18:27 (Wed, 8 May 2002 10:27:49 -0700)
From: Joseph J. Strout
At 7:03 AM -0400 5/8/02, Noah Desch wrote:

>What are you using for line endings? Apple's address book is
>probably expecting chr(10), not chr(13), which would be the
>principle difference between your saved file and the TextEdit one.
>Beyond that, you may have to change the textEncoding to something
>else (don't ask me what).

Since the Address Book is a (future) OS X feature, the file should
almost certainly be in UTF-8. But of course if your text contains
only ASCII characters, then it's already in UTF-8.

Cheers,
- Joe

Re: vCards (important for me)
Date: 24.05.02 08:16 (Fri, 24 May 2002 09:16:02 +0200)
From: Pepe
> What are you using for line endings? Apple's address book is probably
> expecting chr(10), not chr(13), which would be the principle difference
> between your saved file and the TextEdit one. Beyond that, you may have
> to change the textEncoding to something else (don't ask me what).

(Noah wrote this)

Well, Noah, you're definately right.

But I've got one problem:

I am able to import vCards of Palm Desktop (X and Classic versions) and
Address Book. No problem at all. But....

a,...vCards of MS Entourage were recognized but not imported at all
(guess it's the format)...
b,...vCards of EudoravCardExport weren't even recognized

What's the problem? TextEncoding? Some vCards of Entourage worked, some
not...

Is anyone able to tell me something about it or to give me a tip?

I'm very grateful for answers, thank you!

Yours,
Pepe

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: vCards (important for me)
Date: 24.05.02 11:17 (Fri, 24 May 2002 12:17:40 +0200)
From: Frank Bitterlich
Hmmm... could that mean that the file is using the UTF16 encoding?

If so, it would be more appropriate to use a TextConverter instead. You
could run into a character one day that really uses the second byte.

Cheers,
Frank+++

Daniel Kennett wrote:
>
> On 24/5/2002 8:16 am, Pepe waxed lyrical on thus:
>
> >> What are you using for line endings? Apple's address book is probably
> >> expecting chr(10), not chr(13), which would be the principle difference
> >> between your saved file and the TextEdit one. Beyond that, you may have
> >> to change the textEncoding to something else (don't ask me what).
> >
> > (Noah wrote this)
> >
> > Well, Noah, you're definately right.
> >
> > But I've got one problem:
> >
> > I am able to import vCards of Palm Desktop (X and Classic versions) and
> > Address Book. No problem at all. But....
> >
> >
> > a,...vCards of MS Entourage were recognized but not imported at all
> > (guess it's the format)...
> > b,...vCards of EudoravCardExport weren't even recognized
> >
> > What's the problem? TextEncoding? Some vCards of Entourage worked, some
> > not...
> >
> > Is anyone able to tell me something about it or to give me a tip?
> >
> > I'm very grateful for answers, thank you!
> >
> > Yours,
> > Pepe
>
> I am currently writing a vCard reading/writing class for RB. The thing with
> Entourage vCards is that each character is sperated with a chr(0). You can
> see this when you open up the card in TextEdit (OS X). To fix this, before
> trying to read the card I simply use the following code:
>
> Dim t as textinputstream
> Dim tout as textoutputstream
> Dim f as folderitem
> Dim card as string
>
> F = getfolderitem("Foo") // the location of the vCard
> T = f.openastextfile
> Card = t.readall
> T.close
> Card = replaceall(card,chr(0),"") // Removes all chr(0) characters
> Tout = f.createtextfile
> Tout.write card
> Tout.close
>
> You will now have a readable vCard. I don't know why Entourage does this, it
> is really annoying.

Re: vCards (important for me)
Date: 24.05.02 11:54 (Fri, 24 May 2002 11:54:14 +0100)
From: Daniel Kennett
On 24/5/2002 11:17 am, Frank Bitterlich waxed lyrical on thus:

> Hmmm... could that mean that the file is using the UTF16 encoding?
>
> If so, it would be more appropriate to use a TextConverter instead. You
> could run into a character one day that really uses the second byte.
>
> Cheers,
> Frank+++

Hmmm, good point. Thanks for that :)

Thanks,

-- Daniel

I'd love to go out with you, but none of my socks match.
___________________________________________________________

Daniel B Kennett
<email address removed> http://www.kennettnet.co.uk/software/

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: vCards (important for me)
Date: 24.05.02 13:19 (Fri, 24 May 2002 14:19:08 +0200)
From: Pepe

Am Friday den, 24. May 2002, um 12:54, schrieb Daniel Kennett:

> On 24/5/2002 11:17 am, Frank Bitterlich waxed lyrical on thus:
>
>> Hmmm... could that mean that the file is using the UTF16 encoding?
>>
>> If so, it would be more appropriate to use a TextConverter instead. You
>> could run into a character one day that really uses the second byte.
>>
>> Cheers,
>> Frank+++
>
> Hmmm, good point. Thanks for that :)

Thank you both.
But how do I know if a file is using the UTF16 encoding? Better: how
does my app know this when I try to import a vCard?
Are there examples out there for de- and encoding from UTF16 to the
"appropriate" format?

Thanks!

Cheers,
Pepe

[PS: In Germany we would say: "Microsoft braucht mal wieder ''ne
Extrawurst" ;-)]

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>