I did similar code for phone numbers and emails and it works. I did another code with AddressBookAddress and it works too.
But i can’t read any website.
Dim CeBook as AddressBook
Dim CesContacts(-1) as AddressBookContact
Dim CesDatas as AddressBookData
' Dim CetAddresse as AddressBookAddress
Dim NbContacts, iLign, jNbre, Fin_jNbre as Int16
Dim CesSitesWeb as String
Dim CesNoTel as String
CeBook = System.AddressBook
CesContacts = CeBook.Contacts
NbContacts = Ubound(CesContacts)
For iLign = 0 to NbContacts
CesDatas = CesContacts(iLign).Homepage
Fin_jNbre = CesDatas.Count - 1 ' Count retourne 0 si pas de Datas
For jNbre = 0 to Fin_jNbre
CesSitesWeb = CesSitesWeb + CesDatas.Value(jNbre) + EndOfLine
Next jNbre
CesDatas = CesContacts(iLign).PhoneNumbers
Fin_jNbre = CesDatas.Count - 1 ' Count retourne 0 si pas de Datas
For jNbre = 0 to Fin_jNbre
CesNoTel = CesNoTel + CesDatas.Value(jNbre) + EndOfLine
Next jNbre
Next iLign
MsgBox "'" + CesSitesWeb + "'"
MsgBox "'" + CesNoTel + "'"
CesSitesWeb contains only EndOfLine (empty). CesNoTel contains the phone numbers (it’s ok).
I searched in Feedback and I found bug which are many years ago (and not same problem).
Do I do something wrong or is it a bug ?
Thank you Christian, but as I’m a hobbits I can’t buy additional products like your (very good) plugins.
By the way, I understand your plugin add functions to Xojo, but in this case it correct bugs right ? Even if Apple changed Homepage property to url, Xojo should change the same way I think. Homepage is not deprecated in Xojo documentation.
The docs link you mention was last updated on 2010. I guess Homepage changed to URL address or something, because I can get notes, emails, etc. but not the urls stored.
It appears AddressBookContact.AIMScreenNames, HomePage, ICQNumbers, JabberScreenNames, MSNScreenNames, YahooScreenNames were all deprecated or removed by Apple some time ago. I’ve updated our docs to also show them as deprecated.
@Paul Lefebvre you updated the information saying there is no replacement for HomePage property, is that for Xojo? I think Apple is using URLAddresses now (I see Christian already said that).
I see other properties too, like SocialProfiles, InstantMessagesAddresses, OrganizationName.
Ok, thank you all. Then I do not need to fill a bug report.
I need to import contacts in one of my Xojo program. I will use AppleScript to import SiteWeb (if I can with AppleScript).
Edit : HomePage doesn’t work in AppleScript, but url does.
But I don’t understand, in AppleScript HomePage was a simple text (string) value, if my memory is good we couldn’t enter more than one siteweb, like we enter only one LastName, FirstName etc. . Now, with url we can enter many website like many PhoneNumber. And Xojo manage HomePage like PhoneNumber, not like LastName. Then Xojo did the job to manage many websites in one contacts.