Re: itunes and duplicating track from library
Re: itunes and duplicating track from library
- Subject: Re: itunes and duplicating track from library
- From: Mr Tea <email@hidden>
- Date: Tue, 16 Nov 2004 00:24:51 +0000
This from David A. Cox - dated 15/11/04 10ยท39 pm:
> As always, Mr. Tea is spot on with the answer.
Don't believe it folks. I've made my share of gaffes here, but fortunately
Paul Berkowitz or Chris Nebel have usually been on had to put things right
before my offerings have trashed anyone's system.
>
> As long as the thread is open, I might as well toss out that this has now
> led me to another stumbling block (I thinK I just don't really get how
> iTunes does things). I would (after converting the file and adding the
> converted file to a new playlist), like to delete the original file from
> the library, all playlists, and the OS itself.
>
> I tried a simple delete command, but that only takes the file out of the
> playlist it is being listed from (ie the pointer is removed).
iTunes 'knows' the location of the file, but only so that it can do iTunesy
things with it. Deleting the file from your hard disk (or renaming it or
moving it) goes beyond iTunes remit and into the realm of things more
commonly dealt with by the Finder. Fortunately, Applescript will bridge the
gap between the two apps for you, but you have to tell the Finder to delete
the file, as well as getting iTunes to remove it from its playlists. There
may be a faster and more elegant way to do it, but this should work...
--*****
tell application "iTunes"
get track 1 of playlist "***Current***" returning theTrack
set theLoc to location of theTrack
set theID to database ID of theTrack
tell playlist "Library"
delete (every track whose database ID is theID)
end tell
end tell
tell application "Finder" to delete theLoc
--*****
Regards,
Nick
pp Mr Tea
--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden