I'm trying to write a test script that sets the file location of a music file in iTunes. It doesn't generate any errors, but when I check it in iTunes the file location hasn't been changed. How do I make this work?
Code:
Set iTunesApp = CreateObject("iTunes.Application")
Set objPlaylist = iTunesApp.LibraryPlaylist
Set colTracks = objPlaylist.Tracks
For Each objTrack in colTracks
Wscript.Echo "Name: " & objTrack.Name
Wscript.Echo "Album: " & objTrack.Album
Wscript.Echo "Artist: " & objTrack.Artist
strLocation = objTrack.Location
Wscript.Echo "Location: " & strLocation
Wscript.Echo "Kind: " & objTrack.Kind
if objTrack.Kind = 1 then
Wscript.Echo "Kind is 1"
strLocation = "C:\Users\deleyd\Music\iTunes\iTunes Music\Music\Tangerine Dream\Logos - Live At The Dominion - London 19\01 Logos Part OneB.mp3"
EXIT FOR
Next