Re: One Finder and one iTunes Question?
Re: One Finder and one iTunes Question?
- Subject: Re: One Finder and one iTunes Question?
- From: Skeeve <email@hidden>
- Date: Tue, 08 Apr 2008 13:43:15 +0200
A small performance improvement and better tempfile handling.
set dblist to paragraphs of (do shell script "/usr/bin/defaults read
com.apple.iApps iTunesRecentDatabases | /usr/bin/perl -e " & quoted form
of "
use File::Temp qw/ tempdir /;
my($tmpd)= tempdir( CLEANUP => 1 );
my ($plist)= $tmpd . '/x';
my ($templist)= $plist. '.plist';
while (<>) {
foreach (m#\"([^\"]+)\"#g) {
$_= fileURL_to_filename($1);
link $_,$templist;
$_= `/usr/bin/defaults read $plist 'Music Folder'`;
tr/\\015\\012//d;
print fileURL_to_filename($_);
unlink $templist;
}
}
sub fileURL_to_filename {
local($_)= shift;
s#file://localhost(?=/)##;
s/%(..)/pack 'H2',$1/ge;
return $_;
}")
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden