do shell script "touch ~/Desktop/errors.txt" do shell script "rm ~/Desktop/errors.txt" on write_to_file(this_data, target_file, append_data) try set the target_file to the target_file as text set the open_target_file to  open for access file target_file with write permission if append_data is false then  set eof of the open_target_file to 0 write this_data to the open_target_file starting at eof close access the open_target_file return true on error try close access file target_file end try return false end try end write_to_file set this_file to (((path to desktop folder) as text) & "errors.txt") tell application "Address Book" repeat with thisperson in every person try repeat with thisgroup in groups of thisperson try set note of thisperson to note of thisperson & " <" & name of thisgroup & ">" on error set this_data to "Person " & name of thisperson & " Gruppe " & name of thisgroup & return my write_to_file(this_data, this_file, true) end try end repeat on error set this_data to "Person " & name of thisperson & return my write_to_file(this_data, this_file, true) end try end repeat end tell