Chip wrote:
> I found the article on scripting to iTunes very interesting
>
> http://www.microsoft.com/technet/scr...e/default.mspx
>
> Has anyone here done much with it? I'm trying to figure out how to
> determine if a track is a podcast.. I get all tracks in the entire
> library, and haven't yet gotten to the place where I can filter out
> things that were downloaded as podcasts. Did you download the iTunesComSDK at:
http://developer.apple.com/sdk/itunescomsdk.html
Simply check the .Podcast property, if true it is a podcast.
I just modifified the RemoveDeadTracks.js example from the sdk.
Should be no problem to adapt it to vbs:
/*
File: CountPodcastTracks.js
*/
var ITTrackKindFile = 1;
var iTunesApp = WScript.CreateObject("iTunes.Application");
var PodcastTracks = 0;
var mainLibrary = iTunesApp.LibraryPlaylist;
var tracks = mainLibrary.Tracks;
var numTracks = tracks.Count;
var i;
while (numTracks != 0)
{
var currTrack = tracks.Item(numTracks);
// is this a file track?
if (currTrack.Kind == ITTrackKindFile)
{
// yes, is it a podcast?
if (currTrack.Podcast)
{
// yes, delete it
WScript.Echo("Podcast: "+currTrack.Name+" "+currTrack.Location);
PodcastTracks++;
}
}
numTracks--;
}
WScript.Echo("Counted " + PodcastTracks + " podcast track(s).");
HTH
Matthias