Actually, the Title property is read/write indeed, but when I try to change a name of some playlist using scripts, nothing is happening. Here is a test script, you should first create one playlist named "Playlist example" and click on the Edit / Title Test option:Property Get/Let Title As String
Code: Select all
Option Explicit
Sub OnStartUp()
Dim mnuTest
Set mnuTest = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0)
mnuTest.Caption = "Title Test"
mnuTest.OnClickFunc = "TitleTest"
mnuTest.UseScript = Script.ScriptPath
End Sub
Sub TitleTest(Item)
Dim oPlaylist
Set oPlaylist = SDB.PlaylistByTitle("Playlist example")
SDB.MessageBox oPlaylist.Title, mtInformation, Array(mbOK)
oPlaylist.Title = "Blah blah"
SDB.MessageBox oPlaylist.Title, mtInformation, Array(mbOK)
Set oPlaylist = Nothing
Set oPlaylist = SDB.PlaylistByTitle("Playlist example")
SDB.MessageBox oPlaylist.Title, mtInformation, Array(mbOK)
End Sub
Code: Select all
SDB.Database.ExecSQL "UPDATE Playlists SET PlaylistName = 'Blah blah' WHERE IDPlaylist = " & oPlaylist.ID
One related question. Why playlist nodes cannot generate any event? I need at least OnNodeEditText, OnNodeEdited and OnCanEditNode.