vendredi 27 février 2015

Script to delete all groups in contacts with wildcard


I have about 2000 empty contact groups, which all start with _ModGrp and have some numbering scheme after that in the name. I would therefore like to delete all groups starting with _ModGrp


I have found several scripts which are supposed to perform a very similar function, however without the wild card. The group name is quite long after the starting _ModGrp however ends with Das Örtliche Merkzettel, the iOS app which created the problem. I have reported the iOS app to apple and the bug was fixed, except I still have 2000+ empty groups.


Here is one of the scripts: set counter to 0 display dialog "Name of group to delete?" default answer "" set theGroupName to text returned of result tell application "Contacts" repeat try set theGroup to group theGroupName delete theGroup set counter to counter + 1 on error exit repeat end try end repeat save display dialog "Removed " & counter & " instances of the group" with icon caution buttons {"OK"} default button "OK" end tell





Aucun commentaire:

Enregistrer un commentaire