• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: One Finder and one iTunes Question?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >One Finder and one iTunes Question? (From: Dave <email@hidden>)
 >Re: One Finder and one iTunes Question? (From: Skeeve <email@hidden>)
 >Re: One Finder and one iTunes Question? (From: Philip Aker <email@hidden>)
 >Re: One Finder and one iTunes Question? (From: Skeeve <email@hidden>)

  • Prev by Date: Re: One Finder and one iTunes Question?
  • Next by Date: Re: One Finder and one iTunes Question?
  • Previous by thread: Re: One Finder and one iTunes Question?
  • Next by thread: Re: One Finder and one iTunes Question?
  • Index(es):
    • Date
    • Thread