mardi 27 janvier 2015

Sort Contacts Marked As Company


I found an Applescript at apple's support site to sort any contact with the "Company" checkmark checked into a "Business" group:



property groupName : "Business"
tell application "Contacts"
if (name of groups as list) does not contain groupName then
make new group at end of groups with properties {name:groupName}
end if
repeat with singlePerson in people
if company of singlePerson is true then
if (people of group groupName as list) does not contain (singlePerson as list) then
make new person at end of group groupName with data singlePerson
end if
end if
end repeat
save
end tell


It fails on:



make new person at end of group groupName with data singlePerson


With error:



error "Contacts got an error: AppleEvent handler failed." number -10000


Does anyone know of a method to sort out all contacts checkmarked as "Company"?


For example I do NOT want anyone who has a company name but is an individual card:


enter image description here


But I DO want companies with the Company box checkmarked:


enter image description here





Aucun commentaire:

Enregistrer un commentaire