Very amateur scripter here. I am trying to clear out a field that is through out my contacts (multiple groups. It is some artifact of merging with outlook. the field in CONTACT and in BUSYCONTRACT shows as “Outlook”
If I export the vCard from BusyContact, it shows in the vCard as ‘Home Page’
The following modified script ( Thank You ) shows ‘missing value’ at the end
set peepData to {}
tell application "Contacts" to repeat with aPerson in group (my (choose from list (get groups's name))'s item 1)'s people
tell aPerson to set peepData's end to {(last name & "")'s text, ",", space, first name, ",", home page} & return --person parameters from Contacts' dictionary
end repeat
tell application "Finder" to write (peepData as text) to ((make file) as alias)
If I Edit a contact in CONTACT and click on the filed marked “Outlook” I get a choice of
home page
home
work
other
Outlook
Custom…
I am open to ideas on how to
A) Find the field name
B) Dump the full contact and the field names / value
C) Code to find the string that starts with “ms-outlook://people/A” and replace it in all contacts
Hi. I recall that, in the thread from which my code was originally sampled, the problem was that a constant—the last name—wasn’t included, which is what causes missing value to be returned. Concatenating with a null string and converting to text is the workaround for that. So, if you’re extracting data for reconstruction in a clean format, something like the below would be done for every parameter. You won’t be able to directly access text in the vcard that has no corresponding Contacts representation.
tell application "Contacts" to repeat with aPerson in group (my (choose from list (get groups's name))'s item 1)'s people
tell aPerson to set peepData's end to {(last name & "")'s text, (first name & "")'s text, (home page & "")'s text} & return
end repeat