Sample script request: read nested playlists

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey for Windows 4.

Moderators: Gurus, Addon Administrators

chrisjj
Posts: 5007
Joined: Wed Feb 14, 2007 5:14 pm
Location: UK

Sample script request: read nested playlists

Post by chrisjj »

Does anyone have a simple sample script to show me how to read nested playlists?

Must handle same-named siblings properly.

This may be not a simple as it seems. MM's own Export all Playlists fails http://www.mediamonkey.com/forum/viewto ... =6&t=58577 . Though Zvezdan Dimitrijevic's Export/Import Playlists succeeds, it is obfuscated and so not suitable as a sample.
Chris
veronika19
Posts: 1
Joined: Mon Apr 25, 2016 2:18 am

Re: Sample script request: read nested playlists

Post by veronika19 »

When the Nested Playlist is showing you will firstly need to give your Nested Playlist a name.

When you have added a name, you will be asked to select a Playlist to Insert and will be need to select whether you would like to:

a) Generate Empty Playlist or
b) Use Existing one.

You can either select the Generate Empty Playlist option then your nested playlist will start as a blank template. If you select the Use Existing Playlist,then you will be presented with the following Select Playlist feature and can use the search to find any playlist as per your requirement.

Acrobat Marketing Derby
Last edited by veronika19 on Mon May 02, 2016 6:47 am, edited 2 times in total.
chrisjj
Posts: 5007
Joined: Wed Feb 14, 2007 5:14 pm
Location: UK

Re: Sample script request: read nested playlists

Post by chrisjj »

Thanks V. I don't recognise these options as existing anywhere in MM and Google does not find.

However, what I'm asking for is a sample script to read nested playlists, and your procedure does not seem to be that.
Chris
chrisjj
Posts: 5007
Joined: Wed Feb 14, 2007 5:14 pm
Location: UK

Still seeking sample script to read nested playlists

Post by chrisjj »

Does anyone have a simple sample script to show me how to read nested playlists?

Thanks.
Chris
chrisjj
Posts: 5007
Joined: Wed Feb 14, 2007 5:14 pm
Location: UK

Re: Sample script request: read nested playlists

Post by chrisjj »

Here it is.

Code: Select all

Dim s:s=""
DIM list: SET list = SDB.PlaylistByID(SDB.MainTree.CurrentNode.RelatedObjectID)

S = s & vbCrLf & list.Title & " has tracks qty " & list.Tracks.Count

DIM i,c
FOR i=0 TO list.ChildPlaylists.Count-1		
	SET c = list.ChildPlaylists.Item(i)
	s = s & vbCrLf & " " & c.Title & " has tracks qty " & c.Tracks.Count
NEXT

MsgBox s
Example output:

Image

Key API info:

http://www.mediamonkey.com/wiki/index.p ... urrentNode
http://www.mediamonkey.com/wiki/index.p ... edObjectID
http://www.mediamonkey.com/wiki/index.p ... aylistByID
http://www.mediamonkey.com/wiki/index.p ... dPlaylists
Chris
Post Reply