I've been racking my brains but cannot see why I am unable to get a list of the Playlist names with the below code, hopefully it's just something simple that I've missed!
Public Sub Main(Optional ByVal params As String = "")
Dim mc As Object
On Error Resume Next
mc = GetObject(, "MediaJukebox Application") 'First try to get an already running object
If Debug Then hs.WriteLog("MusicSk", "GetObject Error Code = " & Err.Number)
If Err.Number = 429 Then
mc = CreateObject("MediaJukebox Application") 'Then, create a new object
End If
' Get Number Of Playlists
Dim NoPlayListsObj As Object
NoPlayListsObj = mc.GetPlayLists()
Dim NoPlayLists As Integer
NoPlayLists = NoPlayListsObj.GetNumberPlaylists()
hs.WriteLog("MusicSK", "Number Of Playlists = " & NoPlayLists)
' Get List Of Playlists
Dim PlayListObj As Object
Dim PlayListLoop As Integer
Dim PlayListName As String
For PlayListLoop = 0 To NoPlayLists
PlayListObj = mc.GetPlaylistByID(PlayListLoop)
PlayListName = PlayListObj.Name()
hs.WriteLog("MediaControl", "PlayList Number " & PlayListLoop & " Playlist Name " & PlayListName)
Next
End Sub
Thanks
Simon