Kris Krause

I Never Fake the Funk On a Nasty Dunk
posts - 90, comments - 33, trackbacks - 441

My Links

News

Article Categories

Archives

Post Categories

Image Galleries

Blogs

Forums

User Groups

Accessing iTunes With C#

Check out the simple example here.

Print | posted on Wednesday, February 02, 2005 5:34 PM | Filed Under [ .NET ]


Feedback

# re: Accessing iTunes With C#

Here's a simple utility for selecting any number of tracks and toggling whether they're dis-abled (un-checked) or enabled (checked). Remember to add a reference to the iTunes Type Library (currently ver 1.3) from the "COM" tab of "Add Reference..."

iTunesApp iApp = new iTunesAppClass();
IITTrackCollection tracks = iApp.SelectedTracks;

foreach(IITTrack track in tracks)
{
Console.Write(track.Name.PadRight(30, ' ').Substring(0, 30) + "... has been ");
if (track.Enabled)
{
track.Enabled = false;
Console.WriteLine("disabled.");
}
else
{
track.Enabled = true;
Console.WriteLine("enabled.");
}
}

iApp = null; 5/28/2005 4:56 PM | Zach Young

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 2 and 4 and type the answer here:

Powered by: