Question: I am trying to add track information to newly added tracks in iTunes using the COM interface and JavaScript. I am able to successfully add files, but am unable to grab them using OperationStatus.Tracks(). I know that OperationStatus.Tracks() is unavailable until after OperationStatus.InProgress() returns false. However, when I try to call InProgress() on what I expect to be an OperationStatus object, I receive the error: "Object doesn't support this property or method."

```
var iTunesApp = WScript.CreateObject("iTunes.Application");
var status = iTunesApp.LibraryPlaylist.AddFile('newfile.mp4');
WScript.Echo(status.InProgress());

```

Can anyone shed some light on to what is going wrong here?

Answer: 
I have since been able to answer my own question. I was simply adding empty parens when no parameters were necessary. As such, the methods and properties were not being recognized. The last line mentioned above will work in the following form:  
`WScript.Echo(status.InProgress);`  

To access the tracks that have been recently added can be done using  
 `var newtracks = status.Tracks;`  

 Then to access properties about an individual track can be done as follows:  
 `var newtrack = newtracks.ItemByName('filename');`  
`WScript.Echo(newtrack.Name);`
Don't forget the result from the AddFile is asynchronous, so you will need to loop and wait before you can access the data.

```
var results = iTunesApp.AddFile( filepath );

// wait for the result to be available
while( results.InProgress )
    Thread.Yield(); 

foreach( var it in results.Tracks )
{
    tune = it as IITFileOrCDTrack;
    Console.WriteLine( "Track '{0} - {1}' was added to itunes library", tune.Artist, tune.Name );
}

```

To get the latest added tracks, i guess you could create a smart playlist, sorted by the added date and access cycle through, this will probably be faster than accessing the whole itunes DB.