I’m trying to outsmart Address Book in printing mailing labels for the Holiday Card list.
If I have records with both Home & Work addresses, I can print both (for all entries) or choose to print one or the other. There is a “distribution list” option, but it refuses to print the Company name for those entries which I’ve selected a Work address.
So, to fix the problem, I want to add the company name as the first line of the street address.
I’ve got a script put together, but can’t quite get the syntax correct to update that field. I get an error of “Can’t make this_address of item 1 of every person of group "Test" into type reference.” This occurs at the “set the value” line just before the end if.
Can somebody tell me what boneheaded mistake I’ve made this time? I’ve looked at numerous code samples, but can’t find one that does something similar that works in my case.
I’m running this currently on 10.5.8 (Address Book 4.1.2).
Thanks!
Cheers,
Jon
tell application "Address Book"
repeat with this_person in every person in group "Test"
repeat with this_address in every address of this_person
if label of this_address is "work" and this_address is not missing value then
set theCO to the organization of this_person as string
set currentWorkAddr to the street of this_address as string
set newWorkAddr to (theCO & return & currentWorkAddr)
set the value of street of this_address of this_person to newWorkAddr
end if
end repeat
end repeat
save
end tell