{"id":16381,"date":"2010-11-28T00:01:00","date_gmt":"2010-11-28T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2010\/11\/28\/icame-ipod-iscripted-scripting-itunes-conclusion\/"},"modified":"2010-11-28T00:01:00","modified_gmt":"2010-11-28T00:01:00","slug":"icame-ipod-iscripted-scripting-itunes-conclusion","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/icame-ipod-iscripted-scripting-itunes-conclusion\/","title":{"rendered":"iCame, iPod, iScripted: Scripting iTunes conclusion"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>[Disclaimer: this is a reprint of a previously published article from the TechNet Script Center FunZone. The FunZone was not migrated from our old platform. It is printed here due to popular demand.]<\/p>\n<p><em>This is part three of a three part series of articles about using VBScript to script iTunes. The first article was published <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2010\/11\/21\/icame-ipod-iscripted-scripting-itunes.aspx\">last Sunday<\/a>, and the second article was published <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2010\/11\/27\/icame-ipod-iscripted-scripting-itunes-part-2.aspx\">yesterday<\/a>.<\/em><\/p>\n<p><b>The Playlist&rsquo;s the Thing<\/b><\/p>\n<p>By default all your songs are included in the iTunes library and can be accessed through the LibraryPlaylist object. However, songs can also be included in one or more custom playlists. Have a hankering for Beatles songs and nothing <i>but<\/i> Beatles songs? Then create a custom playlist consisting of only Beatles songs. Dying to hear some reggae? Then create a custom playlist consisting of only reggae songs. Got a bad case of disco fever? Then create a custom playlist of &ndash; well, forget that one. There are some things even the Scripting Guys can&rsquo;t recommend; you&rsquo;re on your own when it comes to disco. <\/p>\n<p>The important thing &ndash; at least for our purposes &ndash; is that you can use scripts to create, delete, and manage custom playlists. Let&rsquo;s start with a simplest task &ndash; retrieving information about all your playlists &ndash; and then go on from there. <\/p>\n<p><b>Retrieving All Your Playlists<\/b><\/p>\n<p>Let&rsquo;s start out by retrieving a list of all our iTunes playlists. In other words, let&rsquo;s start out with a script that looks like this:<\/p>\n<p>Set objApp = CreateObject(&#8220;iTunes.Application&#8221;)<\/p>\n<p>Set colSources = objApp.Sources<\/p>\n<p>For Each objSource in colSources<\/p>\n<p>Wscript.Echo objSource.Name<\/p>\n<p>Set colPlaylists = objSource.Playlists<\/p>\n<p>For Each objPlaylist in colPlaylists<\/p>\n<p>Wscript.Echo &#8221; &#8221; &amp; objPlaylist.Name<\/p>\n<p>Next<\/p>\n<p>Wscript.Echo<\/p>\n<p>Next<\/p>\n<p>Yes, it&rsquo;s a little crazy, but that&rsquo;s because the iTunes object model can be a bit convoluted at times: in this case we need to create a Sources object, get a list of the playlists found in the Sources object, then get a list of the playlists found in each of those playlists. Confusing? Maybe it will help to take a look at the output:<\/p>\n<p>Library<\/p>\n<p>Library<\/p>\n<p>Party Shuffle<\/p>\n<p>Purchased<\/p>\n<p>90&#8217;s Music<\/p>\n<p>My Top Rated<\/p>\n<p>Recently Added<\/p>\n<p>Recently Played<\/p>\n<p>Top 25 Most Played<\/p>\n<p>Videos<\/p>\n<p>My Playlist<\/p>\n<p>Podcasts<\/p>\n<p>Radio<\/p>\n<p>Radio<\/p>\n<p>As you can see, we have two primary sources &ndash; Library and Radio &ndash; and each of these sources contains at least one playlist. A bit confusing at first glance, but there&rsquo;s a method to the madness. <\/p>\n<p>As for the script itself, we start out by creating an instance of the iTunes.Application object; we then use this line of code to retrieve a list of all our iTunes sources (which, on our test computer, is a collection with just two items: Library and Radio):<\/p>\n<p>Set colSources = objApp.Sources<\/p>\n<p>Once we have the collection we set up a For Each loop to walk through all the items. Inside that loop we echo back the source name, then use this line of code to retrieve a collection of all the playlists included in that source:<\/p>\n<p>Set colPlaylists = objSource.Playlists<\/p>\n<p>From there we set up a second For Each loop to echo back the name of each of those playlists:<\/p>\n<p>For Each objPlaylist in colPlaylists<\/p>\n<p>Wscript.Echo &#8221; &#8221; &amp; objPlaylist.Name<\/p>\n<p>Next<\/p>\n<p>After we&rsquo;ve done that we loop around and repeat the process with the next item in the Sources collection. <\/p>\n<p>We know. But remember, you can always use the code as-is without having to worry too much about how it all works. (Although if you play around with this a little bit you&rsquo;ll catch on in no time.) <\/p>\n<p>Incidentally, playlists contain more properties than simply the playlist name. For example, here&rsquo;s a script that echoes back property values for the Library playlist:<\/p>\n<p>Set objApp = CreateObject(&#8220;iTunes.Application&#8221;)<\/p>\n<p>Set objPlaylist = objApp.LibraryPlaylist<\/p>\n<p>Wscript.Echo &#8220;Kind: &#8221; &amp; objPlaylist.Kind<\/p>\n<p>Wscript.Echo &#8220;Duration (seconds): &#8221; &amp; objPlaylist.Duration<\/p>\n<p>Wscript.Echo &#8220;Shuffle enabled: &#8221; &amp; objPlaylist.Shuffle<\/p>\n<p>Wscript.Echo &#8220;Size (bytes): &#8221; &amp; objPlaylist.Size<\/p>\n<p>Wscript.Echo &#8220;Repeat mode: &#8221; &amp; objPlaylist.SongRepeat<\/p>\n<p>Wscript.Echo &#8220;Playing time: &#8221; &amp; objPlaylist.Time<\/p>\n<p>Wscript.Echo &#8220;Visible: &#8221; &amp; objPlaylist.Visible<\/p>\n<p>Needless to say, you can get that same information for a single playlist &hellip; well, assuming you know how to connect to a single playlist. Which brings us to the next section of this article. <\/p>\n<p><b>Binding to an Individual Playlist<\/b><\/p>\n<p>Any time you have a big, comprehensive object model there will always be multiple ways to achieve the same goal. What we&rsquo;re going to do here is to show you one reasonably easy way to connect to an individual playlist. Are there other ways to connect to an individual playlist? Sure. But we&rsquo;ll let you figure those out yourself. <\/p>\n<p>Here&rsquo;s a simple way to connect to the playlist named My Playlist (and, while you&rsquo;re at it, to echo back the properties of that playlist):<\/p>\n<p>Set objApp = CreateObject(&#8220;iTunes.Application&#8221;)<\/p>\n<p>Set colSources = objApp.Sources<\/p>\n<p>Set objSource = colSources.ItemByName(&#8220;Library&#8221;)<\/p>\n<p>Set colPlaylists = objSource.Playlists<\/p>\n<p>Set objPlaylist = colPlaylists.ItemByName(&#8220;My Playlist&#8221;)<\/p>\n<p>Select Case objPlaylist.Kind<\/p>\n<p>Case 0 strKind = &#8220;Unknown playlist kind.&#8221;<\/p>\n<p>Case 1 strKind = &#8220;Library playlist.&#8221;<\/p>\n<p>Case 2 strKind = &#8220;User playlist.&#8221;<\/p>\n<p>Case 3 strKind = &#8220;CD playlist.&#8221;<\/p>\n<p>Case 4 strKind = &#8220;Device playlist.&#8221;<\/p>\n<p>Case 5 strKind = &#8220;Radio tuner playlist.&#8221;<\/p>\n<p>End Select<\/p>\n<p>Wscript.Echo &#8220;Kind: &#8221; &amp; strKind<\/p>\n<p>Wscript.Echo &#8220;Duration (seconds): &#8221; &amp; objPlaylist.Duration<\/p>\n<p>Wscript.Echo &#8220;Shuffle enabled: &#8221; &amp; objPlaylist.Shuffle<\/p>\n<p>Wscript.Echo &#8220;Size (bytes): &#8221; &amp; objPlaylist.Size<\/p>\n<p>Wscript.Echo &#8220;Repeat mode: &#8221; &amp; objPlaylist.SongRepeat<\/p>\n<p>Wscript.Echo &#8220;Playing time: &#8221; &amp; objPlaylist.Time<\/p>\n<p>Wscript.Echo &#8220;Visible: &#8221; &amp; objPlaylist.Visible<\/p>\n<p>Yes, we <i>did<\/i> get a little fancy there, didn&rsquo;t we? We even included a Select Case statement that tells you which kind of playlist you&rsquo;re dealing with (as opposed to simply echoing back an integer value). For now, though, the only portion of the script we need to concern ourselves with comes in the first few lines:<\/p>\n<p>Set objApp = CreateObject(&#8220;iTunes.Application&#8221;)<\/p>\n<p>Set colSources = objApp.Sources<\/p>\n<p>Set objSource = colSources.ItemByName(&#8220;Library&#8221;)<\/p>\n<p>Set colPlaylists = objSource.Playlists<\/p>\n<p>Set objPlaylist = colPlaylists.ItemByName(&#8220;My Playlist&#8221;)<\/p>\n<p>What we&rsquo;re doing here is creating an instance of the iTunes.Application object and then retrieving a collection of iTunes sources. From there we call the <b>ItemByName<\/b> method to connect us to the Library, bypassing any other sources (like Radio):<\/p>\n<p>Set objSource = colSources.ItemByName(&#8220;Library&#8221;)<\/p>\n<p><b>Note<\/b>. Why did we go straight to the Library? Well, that&rsquo;s where most of your playlists will be found. Therefore, why not go straight to the Source? <\/p>\n<p>So to speak. <\/p>\n<p>After connecting to the Library we use this line of code to return a collection of all the Library playlists:<\/p>\n<p>Set colPlaylists = objSource.Playlists<\/p>\n<p>And then we once again use the <b>ItemByName<\/b> method to bind us to the My Playlist playlist:<\/p>\n<p>Set objPlaylist = colPlaylists.ItemByName(&#8220;My Playlist&#8221;)<\/p>\n<p>See? That wasn&rsquo;t so bad, was it? <\/p>\n<p><b>Creating Your Own Playlist<\/b><\/p>\n<p>What&rsquo;s that? You say you&rsquo;re looking at your copy of the iTunes application, and you don&rsquo;t have a playlist named My Playlist? We&rsquo;re not surprised; that&rsquo;s a playlist we created ourselves. And we did it using this ridiculously-simple script:<\/p>\n<p>Set objApp = CreateObject(&#8220;iTunes.Application&#8221;)<\/p>\n<p>Set objPlaylist = objApp.CreatePlaylist(&#8220;My Playlist&#8221;)<\/p>\n<p>No, we&rsquo;re absolutely serious: all it takes are two lines of code to create a new playlist. Create an instance of the iTunes.Application object, then call the <b>CreatePlaylist<\/b> method, passing along the name of your new playlist (in this case, My Playlist). The net result? Here&rsquo;s the net result: <\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/6114.clip_image002_45933AE0.jpg\"><img decoding=\"async\" height=\"165\" width=\"244\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/3487.clip_image002_thumb_1C26CD40.jpg\" alt=\"clip_image002\" border=\"0\" title=\"clip_image002\" style=\"border-bottom: 0px;border-left: 0px;margin:;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px\" \/><\/a><\/p>\n<p><b>Adding Songs to a Playlist<\/b><\/p>\n<p>That&rsquo;s a good point: a playlist without any songs is like a day without sunshine (a phenomenon those of us who live in the Seattle area are all-too-familiar with). Let&rsquo;s see what we can do about taking a song from our library and adding it to our new playlist:<\/p>\n<p>Set objApp = CreateObject(&#8220;iTunes.Application&#8221;)<\/p>\n<p>Set colSources = objApp.Sources<\/p>\n<p>Set objSource = colSources.ItemByName(&#8220;Library&#8221;)<\/p>\n<p>Set colPlaylists = objSource.Playlists<\/p>\n<p>Set objPlaylist = colPlaylists.ItemByName(&#8220;My Playlist&#8221;)<\/p>\n<p>Set objLibrary = objApp.LibraryPlaylist<\/p>\n<p>Set colTracks = objLibrary.Tracks<\/p>\n<p>Set objSong = colTracks.ItemByName(&#8220;Easy Love&#8221;)<\/p>\n<p>objPlaylist.AddTrack(objSong)<\/p>\n<p>In order to add a song to a playlist we need to do two things: we need to make a connection to the playlist (My Playlist) and we need to make a separate connection to the song itself. To do that we start out in familiar fashion, working our way down the object model and then using the <b>ItemByName<\/b> method to retrieve the My Playlist playlist:<\/p>\n<p>Set objApp = CreateObject(&#8220;iTunes.Application&#8221;)<\/p>\n<p>Set colSources = objApp.Sources<\/p>\n<p>Set objSource = colSources.ItemByName(&#8220;Library&#8221;)<\/p>\n<p>Set colPlaylists = objSource.Playlists<\/p>\n<p>Set objPlaylist = colPlaylists.ItemByName(&#8220;My Playlist&#8221;)<\/p>\n<p>After we do that we connect to the iTunes library, retrieve a collection of all the songs. Then, again, we use the <b>ItemByName<\/b> method to bind to a particular song (in this case, <i>Easy Love<\/i>):<\/p>\n<p>Set objLibrary = objApp.LibraryPlaylist<\/p>\n<p>Set colTracks = objLibrary.Tracks<\/p>\n<p>Set objSong = colTracks.ItemByName(&#8220;Easy Love&#8221;)<\/p>\n<p>That gives us the two things we need: an object reference to the playlist (objPlaylist) and an object reference to the song (objSong). All we have to do now is call the <b>AddTrack <\/b>method to add the song to the playlist:<\/p>\n<p>objPlaylist.AddTrack(objSong)<\/p>\n<p>It&rsquo;s that easy. <\/p>\n<p>Of course, if all you want to do is add a single song to a single playlist you&rsquo;ll probably find it faster and easier to do that by hand than to write a script. Scripts don&rsquo;t <i>really<\/i> come in handy until you begin dealing with multiple songs. <\/p>\n<p>For example, here&rsquo;s a script that takes advantage of the iTunes search capability to add all the Rock songs to My Playlist.:<\/p>\n<p>Const ITPlaylistSearchFieldAll = 0<\/p>\n<p>Set objApp = CreateObject(&#8220;iTunes.Application&#8221;)<\/p>\n<p>Set colSources = objApp.Sources<\/p>\n<p>Set objLibrary = objApp.LibraryPlaylist<\/p>\n<p>Set objSource = colSources.ItemByName(&#8220;Library&#8221;)<\/p>\n<p>Set colPlaylists = objSource.Playlists<\/p>\n<p>Set objPlaylist = colPlaylists.ItemByName(&#8220;My Playlist&#8221;)<\/p>\n<p>Set colTracks = objLibrary.Search(&#8220;Rock&#8221;, ITPlaylistSearchFieldAll)<\/p>\n<p>For Each objSong in colTracks<\/p>\n<p>Set objSong = colTracks.ItemByName(objSong.Name)<\/p>\n<p>objPlaylist.AddTrack(objSong)<\/p>\n<p>Next<\/p>\n<p>Pretty easy. We simply search the Library for all the Rock songs; as we saw earlier, the Search method will retrieve a collection of such songs for us. We then simply set up a For Each loop to walk through that collection, binding to each song in turn and then using the AddTrack method to add that song to the playlist. <\/p>\n<p>By the way, this is how you would create a playlist consisting entirely of Beatles songs. Search for all the songs where the artist name is Beatles, then add those songs to the playlist. Just that easy, just that quick. <\/p>\n<p>Here&rsquo;s an interesting bit of code. After binding to the iTunes library this script retrieves a collection of songs (tracks), then uses the <b>Count<\/b> property to determine the total number of songs in the collection. From there, the script goes into a For Next loop where it uses the VBScript function <b>Rnd<\/b> to randomly generate a value between 1 and the total number of songs in the collection. The script then uses the <b>Item<\/b> method to connect to the song with the generated index number, then adds that song to the playlist. After randomly selecting three songs and adding them to the playlist, the script exits the loop and ends. Cool, huh? <\/p>\n<p>Here&rsquo;s the code:<\/p>\n<p>Const ITPlaylistSearchFieldAll = 0<\/p>\n<p>Set objApp = CreateObject(&#8220;iTunes.Application&#8221;)<\/p>\n<p>Set colSources = objApp.Sources<\/p>\n<p>Set objLibrary = objApp.LibraryPlaylist<\/p>\n<p>Set objSource = colSources.ItemByName(&#8220;Library&#8221;)<\/p>\n<p>Set colPlaylists = objSource.Playlists<\/p>\n<p>Set objPlaylist = colPlaylists.ItemByName(&#8220;My Playlist&#8221;)<\/p>\n<p>Set colTracks = objLibrary.Tracks<\/p>\n<p>intHighNumber = colTracks.Count<\/p>\n<p>intLowNumber = 1<\/p>\n<p>For i = 1 to 3<\/p>\n<p>Randomize<\/p>\n<p>intNumber = Int((intHighNumber &#8211; intLowNumber + 1) * Rnd + intLowNumber)<\/p>\n<p>Set objSong = colTracks.Item(intNumber)<\/p>\n<p>objPlaylist.AddTrack(objSong)<\/p>\n<p>Next<\/p>\n<p><b>Playing the Songs on a Playlist<\/b><\/p>\n<p>True: it <i>would<\/i> be kind of silly to use a script to generate a playlist yet not be able to play the songs in that playlist. Okey-doke: here&rsquo;s a script that connects to the My Playlist playlist and then uses the <b>PlayFirstTrack<\/b> method to start playing the first song in the list:<\/p>\n<p>Set objApp = CreateObject(&#8220;iTunes.Application&#8221;)<\/p>\n<p>Set colSources = objApp.Sources<\/p>\n<p>Set objLibrary = objApp.LibraryPlaylist<\/p>\n<p>Set objSource = colSources.ItemByName(&#8220;Library&#8221;)<\/p>\n<p>Set colPlaylists = objSource.Playlists<\/p>\n<p>Set objPlaylist = colPlaylists.ItemByName(&#8220;My Playlist&#8221;)<\/p>\n<p>objPlaylist.PlayFirstTrack<\/p>\n<p>By default iTunes will then continue playing all the songs in the playlist. <\/p>\n<p><b>Deleting a Playlist<\/b><\/p>\n<p>Nothing lasts forever, including iTunes playlists. If you ever want to get rid of a playlist just run a script similar to this:<\/p>\n<p>Set objApp = CreateObject(&#8220;iTunes.Application&#8221;)<\/p>\n<p>Set colSources = objApp.Sources<\/p>\n<p>Set objSource = colSources.ItemByName(&#8220;Library&#8221;)<\/p>\n<p>Set colPlaylists = objSource.Playlists<\/p>\n<p>Set objPlaylist = colPlaylists.ItemByName(&#8220;My Playlist&#8221;)<\/p>\n<p>objPlaylist.Delete<\/p>\n<p>Needless to say there isn&rsquo;t much to explain here: bind to the playlist, call the <b>Delete<\/b> method, and then get on with your life. <\/p>\n<p><b>Bonus Script: The Name That iTune Game<\/b><\/p>\n<p>If you&rsquo;re looking for something different to do with your iTunes software, how about a &ldquo;Name That iTune&rdquo; game? Although this is <i>far<\/i> from a finished product, the following script demonstrates how you could create a game that: <\/p>\n<p>&bull; <\/p>\n<p>Randomly chooses a song from your iTunes library. <\/p>\n<p>&bull; <\/p>\n<p>Plays the first 10 seconds of the song. <\/p>\n<p>&bull; <\/p>\n<p>Asks you to name the song. <\/p>\n<p>&bull; <\/p>\n<p>Reports back the answer. <\/p>\n<p>Admittedly, in its current format the game isn&rsquo;t quite ready to replace <i>World of Warcraft<\/i> or <i>The Sims<\/i>. But it does give you a foundation to work from:<\/p>\n<p>Set objApp = CreateObject(&#8220;iTunes.Application&#8221;)<\/p>\n<p>Set objPlaylist = objApp.LibraryPlaylist<\/p>\n<p>Set colTracks = objPlaylist.Tracks<\/p>\n<p>intTracks = colTracks.Count<\/p>\n<p>intHighNumber = intTracks<\/p>\n<p>intLowNumber = 1<\/p>\n<p>Randomize<\/p>\n<p>intNumber = Int((intHighNumber &#8211; intLowNumber + 1) * Rnd + intLowNumber)<\/p>\n<p>Set objSong = colTracks.Item(intNumber)<\/p>\n<p>objSong.Play<\/p>\n<p>Wscript.Echo &#8220;What&#8217;s the name of this song?&#8221;<\/p>\n<p>Wscript.Sleep 10000<\/p>\n<p>objApp.Stop<\/p>\n<p>Wscript.Echo &#8220;Answer: &#8221; &amp; objSong.Name<\/p>\n<p><b>Hey, What About My iPod?<\/b><\/p>\n<p>Your what-pod? Oh, right, your iPod; we almost forgot. As it turns out, the iPod itself is just another iTunes source; as long as your iPod is plugged into the computer you can write scripts that can interact with the device the same way they interact with other sources and playlists. <\/p>\n<p>Having said that, we should caution that the only device the Scripting Guys had for testing these scripts was an iPod Shuffle, and the Shuffle has limited capabilities compared to other models. Therefore, all we&rsquo;re going to show you today is how you can connect to an iPod and retrieve the collection of songs currently on the device. Can you do anything more than that with a script? Maybe, but that will likely depend, at least in part, on the type of iPod you have. Use this script as a starter, and then go from there. <\/p>\n<p>Use <i>what<\/i> script as a starter? This script:<\/p>\n<p>Set objApp = CreateObject(&#8220;iTunes.Application&#8221;)<\/p>\n<p>Set colSources = objApp.Sources<\/p>\n<p>Set objSource = colSources.ItemByName(&#8220;IPOD&#8221;)<\/p>\n<p>Set colPlaylists = objSource.Playlists<\/p>\n<p>Set objPlaylist = colPlaylists.ItemByName(&#8220;IPOD&#8221;)<\/p>\n<p>Set colTracks = objPlaylist.Tracks<\/p>\n<p>For Each objTrack in colTracks<\/p>\n<p>Wscript.Echo &#8220;Name: &#8221; &amp; objTrack.Name<\/p>\n<p>Next<\/p>\n<p>We&rsquo;ve done things a little different this time around. As you can see, we start out by creating an instance of the iTunes.Application object, then create an object reference to the Sources object. This time around, however, we don&rsquo;t cycle through all the sources looking for one representing the iPod (although we could have). Instead, we use the <b>ItemByName<\/b> method to connect to the source with the name <i>IPOD<\/i>. That binds us directly to the IPOD. <\/p>\n<p><b>Note<\/b>. Do all iPods have a Source name of <i>IPOD<\/i>? To tell you the truth, we don&rsquo;t know. But there&rsquo;s an easy way to find out: just plug your iPod into the computer and see what name shows up in iTunes. <\/p>\n<p>From there we create an object reference (colPlaylists) representing all the playlists on the iPod, then use the <b>ItemByName<\/b> method to bind to the <i>IPOD<\/i> playlist. (Again, we can&rsquo;t do that because the shuffle has only a single playlist on it.) We then retrieve the collection of tracks and echo back the name of each song:<\/p>\n<p>Set colTracks = objPlaylist.Tracks<\/p>\n<p>For Each objTrack in colTracks<\/p>\n<p>Wscript.Echo &#8220;Name: &#8221; &amp; objTrack.Name<\/p>\n<p>Next<\/p>\n<p>You&rsquo;re right: that&rsquo;s pretty much the same approach we used when retrieving the names of all the songs in the Library. And that&rsquo;s the point: as far as the script is concerned the iPod is, like the Library, just another Source. <\/p>\n<p>Incidentally, if you have a Shuffle then you know that one way to copy songs onto the Shuffle is to configure iTunes so that it synchronizes the Shuffle with a specified playlist. Here&rsquo;s an instance where scripting can come in handy: you can use scripts to periodically change\/update the songs in that playlist. The next time you synchronize iTunes and the Shuffle, you&rsquo;ll get a new set of songs on your iPod. <\/p>\n<p>That is all there is to using VBScript to work with your iTunes collection. Join me tomorrow as I begin a new week on the TechNet Script Center. I invite you to follow me on <a href=\"http:\/\/www.twitter.com\/ScriptingGuys\">Twitter<\/a> or Facebook. If you have any questions, send e-mail to me at scripter@microsoft.com or post them on the Official Scripting Guys Forum. See you tomorrow. Until then, peace.<\/p>\n<p>Ed Wilson, Microsoft Scripting Guy<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; [Disclaimer: this is a reprint of a previously published article from the TechNet Script Center FunZone. The FunZone was not migrated from our old platform. It is printed here due to popular demand.] This is part three of a three part series of articles about using VBScript to script iTunes. The first article was [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[123,3,5,61,199],"class_list":["post-16381","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-multimedia","tag-scripting-guy","tag-vbscript","tag-weekend-scripter","tag-zune-and-other-media-devices"],"acf":[],"blog_post_summary":"<p>&nbsp; [Disclaimer: this is a reprint of a previously published article from the TechNet Script Center FunZone. The FunZone was not migrated from our old platform. It is printed here due to popular demand.] This is part three of a three part series of articles about using VBScript to script iTunes. The first article was [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/16381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=16381"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/16381\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=16381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=16381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=16381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}