Re: Trying to tweak an iTunes VBScript

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



I too am not an iTunes user or I would have used TLViewer to look at
the COM interface. I appreciate your posting the URL. The help file
gives me a feel for what iTunes is capable of, but it is not an easy
read. Before seeing this thread I didn't know iTunes was scriptable.

-Paul Randall

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

I don't know if it would help, but you could load the type library
into a type library viewer, such as Visual Studio or even the Visual
Basic Editor included with Microsoft Office. This might give you a
better visual representation of what the SDK is capable of.

Glad to hear you're getting some results though. 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! :)

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

Paul Randall wrote:
"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: Trying to tweak an iTunes VBScript
    ... Here is a link to the iTunes SDK: ... I extracted the iTunesCOM.chm help file from the SDK download file. ... directly access the iTunes object through a DLL. ... 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)
  • 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: Access Accounts
    ... The option to remove the privacy was greyed ... > out but there is a short cut that allows file sharing without going ... > Now if I can just figure out iTunes! ... sure what you mean by "figure out iTunes", but it has a Help file, ...
    (microsoft.public.windowsxp.basics)