Ich habe auf der Support-Website von Apple ein Applescript gefunden , mit dem alle Kontakte mit dem Häkchen "Unternehmen" in eine Gruppe "Geschäftlich" eingecheckt werden können:
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
Es scheitert an:
make new person at end of group groupName with data singlePerson
Mit Fehler:
error "Contacts got an error: AppleEvent handler failed." number -10000
Kennt jemand eine Methode, um alle Kontakte auszusortieren, die als "Firma" markiert sind?
Zum Beispiel möchte ich niemanden, der einen Firmennamen hat, sondern eine individuelle Karte ist:
Aber ich möchte Unternehmen, bei denen das Company
Kontrollkästchen aktiviert ist:
Aktualisieren:
Ich dachte ursprünglich, Sie brauchen kein Applescript, um dies zu tun.
Und Sie könnten eine intelligente Gruppe erstellen, die das für Sie erledigt.
ABER das 'Unternehmen: ist gesetzt' ist nicht für das Kontrollkästchen. Es ist für das eigentliche Textfeld Firma.
Sie können das Obige dafür also nicht verwenden, da es egal ist, ob das Kontrollkästchen für Unternehmen aktiviert ist oder nicht. Es spielt nur eine Rolle, ob im Feld Firma Text vorhanden ist.
Applescript ist also der richtige Weg. Und using company is true
which bezieht sich auf das Kontrollkästchen.
property groupName : "Business"
tell application "Contacts"
if not (exists (group groupName)) then
make new group with properties {name:groupName}
end if
set the_people to people whose company is true
repeat with i from 1 to number of items in the_people
set this_person to item i of the_people
add this_person to group groupName
save
end repeat
end tell
Weihnachten007
Weihnachten007
Markhunte