I've just gotten the sample VBscripts working and have started working on my own script with the Read and Write sample as my base. I've read through the wiki documentation a fair amount already, I'm hoping someone can point out a stupid mistake that I'm making, it's been a while since I've written in VBscript . I want to be able to pull Songs.ID based on the path of the file.
Code: Select all
'Set file path
StringFilePath = "C:\Users\cclub\Music\Real Music\Muzak\Music\AC@_DC\Back In Black\06 Back In Black.mp3"
'Set Data Selection Method
SelectMethod = 2
'Random SampleID Code (Remove if SampleID known)
Set iter = SDB.Database.OpenSQL("SELECT DISTINCT Songs.ID FROM Songs WHERE Songs.SongPath = '" & StringFilePath & "'")
While Not iter.EOF
SampleID = iter.StringByIndex(0)
iter.Next
Wend
StringNewTitle = "Butterflyz"
Set objSongList = SDB.NewSongList 'SelectMethod 2 and 3 SDB.NewSongList
Select Case SelectMethod
Case 1
Set objSongData = SDB.Player.CurrentSong 'SDB.Player.CurrentSong
Case 2
Set objSongListiterator = SDB.Database.QuerySongs("AND Songs.ID=" & SampleID) 'SDB.Database.QuerySongs
Any thoughts?