Export to Winamp Script

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

jaxjon
Posts: 102
Joined: Tue May 27, 2003 8:47 am
Location: Florida USA

Export to Winamp Script

Post by jaxjon »

In this script, when I select multiple tracks, I never get the first one to export, and they never come out in order. Can anyone help me?

Thanks
Jon

Code: Select all

Sub Winamp2
Dim WShell, Command, list, itm, i

' Set List
Set list = SDB.SelectedSonglist
If list.count=0 Then
Set list = SDB.AllVisibleSonglist
If list.count=0 Then 
res = SDB.MessageBox( "Select Tracks to be exported, please.", mtError, Array(mbOk)) 
Exit Sub
End If
End If

Dim Progress 
Set Progress = SDB.Progress 
Progress.Text = "Working..." 

' Iterate through the list and export all songs 
Progress.MaxValue = list.count 
for i=0 to list.count-1
Set itm = list.Item(i) 

' Exporting to Winamp
Set WShell = CreateObject("WScript.Shell")
Command = Chr(34)&"H:\Winamp\winamp.exe"&Chr(34) &" "&Chr(34)&itm.Path&Chr(34)
WShell.Run Command, 1, 0

Progress.Value = i+1 
if Progress.Terminate then 
Exit For
end if 
next  
End Sub
Script.ini entry

Code: Select all

[Winamp2] 
FileName=Winamp2.vbs 
ProcName=Winamp2 
Order=1 
DisplayName=Send To Winamp (2)
Description=Sends Songs To Winamp Player 
Language=VBScript 
ScriptType=0 
jiri
Posts: 5419
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

Post by jiri »

Problem of this approach is that WinAmp.exe is executed many times and the order of executing cannot be exactly defined. Probably the easiest way how to do it is to write all files to a m3u playlist and send it to WinAmp then. Another option is to send tracks to WinAmp using its API.

Jiri
Post Reply