Code: Select all
Sub Main()
Dim oFSO, oOutput, oTrack, oAlbum, sAlbumArtist
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oOutput = oFSO.CreateTextFile("CookieData.txt")
Set oTrack = SDB.Player.CurrentSong
Set oAlbum = oTrack.Album
'Need to get the AlbumArtist Property, not the Track Artist
AlbumArtist = oAlbum.Artist.Name
oOutput.Write "NP: " & oTrack.ArtistName & " - " & oTrack.Title
If (Instr(oTrack.AlbumName, "Best")=0 And Instr(oTrack.AlbumName, "Greatest")=0) Or _
Instr(AlbumArtist, "Various")=0 Then
oOutput.Write " (from the album " & Track.AlbumName & ")"
End If
oOutput.Close()
Set oTrack = Nothing
Set oAlbum = Nothing
Set oOutput = Nothing
Set oFSO = Nothing
End Sub
Am I missing something obvious?