Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - iTunes scripting

Reply
 
Old 01-09-2009   #1 (permalink)
Chip


 
 

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
Old 01-09-2009   #2 (permalink)
Matthias Tacke


 
 

Re: iTunes scripting

Chip wrote:
Quote:

> 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
Old 01-09-2009   #3 (permalink)
Chip


 
 

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
Quote:

> Chip wrote:
Quote:

>> 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
Old 01-10-2009   #4 (permalink)
Steve


 
 

Re: iTunes scripting

Chip wrote:
Quote:

>
> 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
Reply

Thread Tools


Similar Threads
Thread Forum
VB scripting help VB Script
itunes corrupted .wmv files can't play with Media Player or itunes Vista music pictures video
Itunes has constant "itunes has stopped working" problem!! Vista music pictures video
once iTunes looses the input focus, the CDROM device disappears inthe iTunes application Vista General
iTunes authorization problem (iTunes 7.0.1.8, Vista build 5728) Vista music pictures video


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46