Re: Trying to tweak an iTunes VBScript

Tech-Archive recommends: Fix windows errors by optimizing your registry




"Trevor Sullivan" <pcgeeknosp4m86@xxxxxxxxx> wrote in message
news:OypuSBRUIHA.5496@xxxxxxxxxxxxxxxxxxxxxxx
Paul,

Here is a link to the iTunes SDK:

http://developer.apple.com/sdk/itunescomsdk.html

----------------
Trevor Sullivan
Systems Engineer

Thanks, Trevor
I extracted the iTunesCOM.chm help file from the SDK download file.
I'm just guessing here, but it looks like it is aimed at those who
directly access the iTunes object through a DLL. There are some
sample JScripts that access the iTunes object through the COM object,
with scripts like this:

var iTunesApp = WScript.CreateObject("iTunes.Application");
var mainLibrary = iTunesApp.LibraryPlaylist;
var mainLibrarySource = iTunesApp.LibrarySource;
var tracks = mainLibrary.Tracks;
var numTracks = tracks.Count;
var numPlaylistsCreated = 0;
var i;

// FIXME take a -v parameter eventually
var verbose = false;

// first, make an array indexed by album name
var albumArray = new Array();

for (i = 1; i <= numTracks; i++)
{
var currTrack = tracks.Item(i);
var album = currTrack.Album;
....

To me, this means that there are properties, or methods named:
LibraryPlaylist
LibrarySource
Tracks

Searching the help file for LibraryPlaylist , I get:
HRESULT IiTunes::LibraryPlaylist (
[out, retval] IITLibraryPlaylist ** iLibraryPlaylist )

With a change in mindset, perhaps I could figure out how to get some
method and property info that could be used by VBScript. Maybe I've
been spoiled by Microsoft's object documentation like that they
provide online for the DHTML DOM.

I suspect it would be relatively easy to get a list of tracks, if you
can decipher the help file.

Perhaps something like:
Set oiTunesApp = WScript.CreateObject("iTunes.Application")
Set omainLibrary = oiTunesApp.LibraryPlaylist
Set oTracks = omainLibrary.Tracks
For Each oTrack in oTracks
MsgBox "Album = " & oTrack.Album & vbCrLf & _
"Artist = " & oTrack.Artist"
Next

I was hoping to find a name property for tracks, but I didn't see it
in the list of 30-some properties listed in the help file, but I may
have missed something or the documentation may be incomplete. If
there is a name property for tracks, TLViewer should list it.

-Paul Randall


.



Relevant Pages

  • Re: Previous versions of Office wont uninstall when deploying Off
    ... The main Microsoft focus appears to be the "home user who is a member of the Administrators group", and who interacts with the computer by "clicking" things. ... Vista makes extensive use of Reparse Points, but if you put those words into the help file, it starts offering help about "Wireless access points"! ... var cArgs = WScript.Arguments; ... It will uninstall if I use a custom .MSP file. ...
    (microsoft.public.office.setup)
  • Re: Previous versions of Office wont uninstall when deploying Off
    ... It's been the case for a long time that Microsoft products are becoming ... The Vista help file is another good example. ... var cArgs = WScript.Arguments; ... It will uninstall if I use a custom .MSP file. ...
    (microsoft.public.office.setup)
  • Re: Trying to tweak an iTunes VBScript
    ... I too am not an iTunes user or I would have used TLViewer to look at ... I extracted the iTunesCOM.chm help file from the SDK download file. ... sample JScripts that access the iTunes object through the COM ... var mainLibrarySource = iTunesApp.LibrarySource; ...
    (microsoft.public.scripting.vbscript)
  • Re: Trying to tweak an iTunes VBScript
    ... I haven't used the SDK myself, as I am not an iTunes user, but I figured I would send the link your way anyway! ... I extracted the iTunesCOM.chm help file from the SDK download file. ... but it looks like it is aimed at those who directly access the iTunes object through a DLL. ... var mainLibrarySource = iTunesApp.LibrarySource; ...
    (microsoft.public.scripting.vbscript)