.vcf ist ja nur reiner Text. Hier ein einfaches AppleScript, das alle Photos entfernt
• Code in den Script Editor kopieren und starten
• Quelldatei auswählen
• Die neue Datei wird als contactsWithoutPhotos.vcf auf dem Desktop gesichert. Die Originaldatei wird nicht verändert.
• Quelldatei auswählen
• Die neue Datei wird als contactsWithoutPhotos.vcf auf dem Desktop gesichert. Die Originaldatei wird nicht verändert.
Show Plain Text
- set vcf to choose file of type {"vcf"}
- set destination to {}
- set theSource to paragraphs of (read vcf as «class utf8»)
- repeat with i from 1 to (count theSource)
- set aLine to item i of theSource
- if aLine does not start with "PHOTO" and aLine does not start with space then
- set end of destination to aLine
- end if
- end repeat
- set {TID, text item delimiters} to {text item delimiters, (return & linefeed)}
- set destinationText to destination as text
- set text item delimiters to TID
- set targetFile to ((path to desktop as text) & "contactsWithoutPhotos.vcf")
- set fileDescriptor to open for access file targetFile with write permission
- write destinationText to fileDescriptor as «class utf8»
- close access fileDescriptor