' ===========
' PlayTheList
' ===========
' Version 1.0.0.1 - March 27th 2018
' Copyright © Steve MacGuire 2018
' http://samsoft.org.uk/iTunes/PlayTheList.vbs
' Please visit http://samsoft.org.uk/iTunes/scripts.asp for updates

' =======
' Licence
' =======
' This program is free software: you can redistribute it and/or modify it under the terms
' of the GNU General Public License as published by the Free Software Foundation, either
' version 3 of the License, or (at your option) any later version.

' This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
' without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
' See the GNU General Public License for more details.

' Please visit http://www.gnu.org/licenses/gpl-3.0-standalone.html to view the GNU GPLv3 licence.

' ===========
' Description
' ===========
' Script to play a named playlist, typically on start up.
' Replace <ThePlaylist> with the name of the list you want to play.

' =========
' ChangeLog 
' =========
' Version 1.0.0.1 - Initial version

Dim iTunes,List,Lists,Name
Set iTunes=CreateObject("iTunes.Application")
Set Lists=iTunes.Sources.Item(1).Playlists
Name="<ThePlaylist>"
Set List=Lists.ItemByName(Name)
If List Is Nothing Then
  MsgBox "Playlist not found. Edit the script to set the name of the playlist you wish to play on start up.",vbInformation,"Play The List"
Else
  List.Reveal
  List.PlayFirstTrack
End If

' ==============
' End of listing
' ==============