Windows Vista Forums

iTunes scripting
  1. #1


    Chip Guest

    iTunes scripting

    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.




      My System SpecsSystem Spec

  2. #2


    Matthias Tacke Guest

    Re: iTunes scripting

    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

      My System SpecsSystem Spec

  3. #3


    Chip Guest

    Re: iTunes scripting

    Great thanks! I did download the SDK, but I didn't see Podcast as being a
    property of the Track.. I still don't.. But it works.. I don't know what I'm
    missing in the documentation.

    "Matthias Tacke" <Matthias@xxxxxx> wrote in message
    news:6spq1hF7k2baU1@xxxxxx

    > 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

      My System SpecsSystem Spec

  4. #4


    Steve Guest

    Re: iTunes scripting

    Chip wrote:

    >
    > Great thanks! I did download the SDK, but I didn't see Podcast as
    > being a property of the Track.. I still don't.. But it works.. I
    > don't know what I'm missing in the documentation.
    >
    It's not in the IITTrack Interface Reference; it's the second property
    listed in the IITFileOrCDTrack Interface Reference.

    You can look for properties and methods in the Index or Search tabs of
    the Contents pane. (You might have the Contents pane hidden. Just click
    the Show button to get the Contents.)

    --
    Steve

    Never let your sense of morals get in the way of doing what's right.
    -Isaac Asimov



      My System SpecsSystem Spec

iTunes scripting problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
VB scripting help David Rodriguez VB Script 5 16 Jun 2008
itunes corrupted .wmv files can't play with Media Player or itunes danny Vista music pictures video 5 07 Dec 2007
Itunes has constant "itunes has stopped working" problem!! Johnson Vista music pictures video 0 11 Nov 2007
once iTunes looses the input focus, the CDROM device disappears inthe iTunes application Holger Birkmeyer Vista General 2 18 Jul 2007
iTunes authorization problem (iTunes 7.0.1.8, Vista build 5728) =?Utf-8?B?cmVnbnVsbA==?= Vista music pictures video 0 06 Oct 2006