How to write iTunes Scripts for Windows




This page describes, in a step-by-step way, how to make yourself an iTunes script.

This line creates an instance of the iTunes.Application object. Literally, it sets the variable ‘objApp’ to the iTunes Application.

Set objApp = CreateObject(“iTunes.Application”)

Technically we could have called “objApp” anything, but for some reason everyone uses this variable name…

We can pass commands to iTunes, such as play, pause, skip track, change volume etc:

Stop

objApp.Stop

BackTrack: This restarts the current track, unless you’re near the start, in which case it plays the previous track.

objApp.BackTrack

At this point, we could simply display simple information about iTunes:
Version:

Wscript.Echo “Version: ” & objApp.Version

[what else can we display? currently playing state, for example.