There is a Perl script called "anoncp.pl":
#!/usr/bin/perl
##
# A N O N C P . P L
#
# a script that takes the unix cp file specification options
#
# perl anoncp.pl source_file target_file
# perl anoncp.pl source_file ... target_directory
#
# which reads the source file(s) and copies them to the
# destination stripped of all the user identification gunk
# that apple adds on iTunes "DRM free" songs
#
# NB: make sure you install the latest version of the
# most excellent Audio::M4P::QuickTime perl module.
##
use strict;
use warnings;
use Carp;
use File::Basename;
use Audio::M4P::QuickTime;
my $usage = q{
usage:
perl anoncp.pl source_file target_file
perl anoncp.pl source_file ... target_directory
};
@ARGV >=2 || croak "not enough files specified", $usage;
my $destDN = pop(@ARGV);
my $destFN = $destDN if (! -d $destDN && @ARGV == 1);
$destDN = dirname($destFN) if( $destFN);
-d $destDN || croak $destDN, ": is not a directory", $usage;
(-r $destDN && -w _) || croak $destDN, ": cannot access ", $usage;
foreach my $m4aFN (@ARGV) {
my $qt = Audio::M4P::QuickTime->new( file => $m4aFN );
$qt->FindAtom("mp4a") || croak "$m4aFN: not a mpeg 4 file\n\t";
$qt->CleanAppleM4aPersonalData(force => 1, zero_free_atoms => 1);
my $toFN = $destFN ? $destFN : $destDN . basename($m4aFN);
$qt->WriteFile($toFN);
}
You have to import the Perl module "Audio::M4P::QuickTime" using CPAN (http://search.cpan.org/~billh/Audio-M4P-0.51/lib/Audio/M4P/QuickTime.pm)
I have done a small AppleScript, that I installed into iTunes: /Users/username/Library/iTunesScripts/Anonymize.
I installed the perl-script here: /usr/local/bin/anoncp.plglobal these_files
tell application "iTunes"
if selection is not {} then
set sel to selection
set these_files to {}
with timeout of 30000 seconds
repeat with this_track in sel
if class of this_track is file track then
set end of these_files to quoted form of POSIX path of ((get location of this_track) as string)
end if
end repeat
end timeout
if these_files is not {} then
my anonymize()
else
display dialog "Selected tracks cannot be anonymized..." buttons {"Cancel"} default button 1 with icon 2 giving up after 15
end if
else
display dialog "No tracks selected..." buttons {"Cancel"} default button 1 with icon 2 giving up after 15
end if
end tell
to anonymize()
tell application "iTunes" to activate
with timeout of 30000 seconds
set the_files to ""
repeat with a_file in these_files
do shell script "/usr/local/bin/anoncp.pl " & a_file & " " & a_file
end repeat
end timeout
end anonymize
Now I can remove the annoying information from the files by selecting them in iTunes and selecting the apple script.