This example is designed to be run external to Winamp. See below for an example which runs from the “Send To” menu.
Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set wa = CreateObject("ActiveWinamp.Application") filename = InputBox("Enter filename") Set fso = CreateObject("Scripting.FileSystemObject") Set MyFile = fso.OpenTextFile(filename, ForWriting, True) MyFile.WriteLine("<HTML>" + vbNewLine + "<BODY>") for each song in wa.playlist MyFile.WriteLine("<DIV class='song'>") MyFIle.WriteLine("<DIV class='position'>") MyFile.WriteLine(song.position) MyFile.WriteLine("</DIV>") MyFIle.WriteLine("<DIV class='artist'>") MyFile.WriteLine(song.artist) MyFile.WriteLine("</DIV>") MyFIle.WriteLine("<DIV class='title'>") MyFile.WriteLine(song.title) MyFile.WriteLine("</DIV>") MyFIle.WriteLine("<DIV class='album'>") MyFile.WriteLine(song.album) MyFile.WriteLine("</DIV>") MyFIle.WriteLine("<DIV class='other'>") MyFile.WriteLine(song.ATFString("%bitrate%, %ratingstar%, %playcount%, %year%, %tracknumber%")) MyFile.WriteLine("</DIV>") MyFile.WriteLine("</DIV>") next MyFile.WriteLine("</BODY>" + vbNewLine + "</HTML>") MyFile.Close
Example which runs from the “Send To” menu on only selected items. Can also be run from the Media Library.
Const ForReading = 1, ForWriting = 2, ForAppending = 8 filename = InputBox("Enter filename") Set fso = CreateObject("Scripting.FileSystemObject") Set MyFile = fso.OpenTextFile(filename, ForWriting, True) MyFile.WriteLine("<HTML>" + vbNewLine + "<BODY>") songlist = GetSendToSelection for each song in songlist MyFile.WriteLine("<DIV class='song'>") 'Note .position won't actually be populated from then send to menu 'but would be if it was populated from the playlist (ie GetSelection) 'MyFIle.WriteLine("<DIV class='position'>") 'MyFile.WriteLine(song.position) 'MyFile.WriteLine("</DIV>") MyFIle.WriteLine("<DIV class='artist'>") MyFile.WriteLine(song.artist) MyFile.WriteLine("</DIV>") MyFIle.WriteLine("<DIV class='title'>") MyFile.WriteLine(song.title) MyFile.WriteLine("</DIV>") MyFIle.WriteLine("<DIV class='album'>") MyFile.WriteLine(song.album) MyFile.WriteLine("</DIV>") MyFIle.WriteLine("<DIV class='other'>") MyFile.WriteLine(song.ATFString("%bitrate%, %ratingstar%, %playcount%, %year%, %tracknumber%")) MyFile.WriteLine("</DIV>") MyFile.WriteLine("</DIV>") next MyFile.WriteLine("</BODY>" + vbNewLine + "</HTML>") MyFile.Close 'We must manually quit when running as an internal Winamp script. quit