View Single Post
Old 7th September 2005, 14:40   #307
Cadish
Junior Member
 
Join Date: Jan 2004
Posts: 31
Hi,

Hi, I've a script to make a database from the playlist...
code:
Set wa = CreateObject("ActiveWinamp.Application")

DataBase = "C:\Program Files\Winamp\MyMp3's.mdb"
Set fso = CreateObject("Scripting.FileSystemObject")
Set TS = fso.OpenTextFile("errors.log", 2, True)
Set Co = createobject("ADODB.Connection")
on error resume next
Co.open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=""" & DataBase & """;")
on error goto 0

If Co.State = 1 Then
req = "DELETE * FROM MP3"
Co.Execute req



for each song in wa.playlist
req = "INSERT INTO MP3 (Name,PathAndName,IsAFile,Artist,[Year],Genre) VALUES( """ & song.filename & """ ,

""" & song.filename & """ , """ & 1 & """ , """ & song.artist & """ , """ & song.ATFString("%year%") & """ ,

""" & song.genre & """ )"
Co.Execute req
next

End If
Co.close

MsgBox "Done"



How can I get the filename, not the path?

So e.g. for a file: "D:\Music\Elvis Presley - A Little Less Conversation.mp3"
I want "Elvis Presley - A Little Less Conversation.mp3"

And how can I get the folder of that song?

And how can I assign a hotkey to the whole script?

Last edited by Cadish; 7th September 2005 at 15:51.
Cadish is offline   Reply With Quote