I'm struggling with how to create a MM Playlist from a vb script. I'm not a complete newbie to MM scripting but haven't figured out all of the MM Automation object scripting techniques.
I'm loading comma delimited song data into a Dictionary object from a text file. The data is; title, artist, album, *mp3 file name.
As in; "A.D. 1928,Styx,Paradise Theatre,P:\Music\A.D. 1928.mp3". The path to the mp3 file is from another PC and is not where it is stored in the MM Library but the file name should be correct.
The text file is created on another PC from an iTunes Genius playlist of songs that were copied from my MM library PC to this iTunes PC. So I know the songs do exists in my MM library.
So, the job of my script is to create a new Playlist in MM from the song names loaded from the text file. How do I create the playlist and then add the song names? I don't need a complete script here just how to create the playlist and then add a song to it from the MM Library given the song title, artist, album and mp3 file name.
Thanks, -phil
Create Playlist With Songs from Text File
Moderators: Gurus, Addon Administrators
Create Playlist With Songs from Text File
Last edited by Lowlander on Fri Sep 21, 2012 11:57 am, edited 1 time in total.
Reason: Moved to correct Forum
Reason: Moved to correct Forum
Re: Create Playlist With Songs from Text File
Have you seen: http://www.mediamonkey.com/forum/viewto ... txt+import
Download MediaMonkey | License
Help: Knowledge Base | MediaMonkey for Windows 5 | MediaMonkey for Android
Lowlander (MediaMonkey user since 2003)
Help: Knowledge Base | MediaMonkey for Windows 5 | MediaMonkey for Android
Lowlander (MediaMonkey user since 2003)
Re: Create Playlist With Songs from Text File
I still haven't discovered how to create a new playlist in MM from script. However, as a workaround to get me going I just create the playlist manually and then run my script to add the tracks.
I'm using ADO to read in the csv file that has the song name, artist and album. ADO works well because some song titles have commas in them and ADO will handle that. I then use the MM SongsDB object's database routines to find the song's ID. With the ID I add the track to the playlist.
I'm using ADO to read in the csv file that has the song name, artist and album. ADO works well because some song titles have commas in them and ADO will handle that. I then use the MM SongsDB object's database routines to find the song's ID. With the ID I add the track to the playlist.
Code: Select all
playlist = curNode.caption
Set oPlaylist = SDB.PlaylistByTitle(playlist)
oPlaylist.AddTrackById(sampleid)
Re: Create Playlist With Songs from Text File
You can create a new playlist like this...
If you want to make the playlist a child of a different playlist, instead of the root, this can be done using the same CreateChildPlaylist function.
Code: Select all
Set par = SDB.PlaylistByTitle("") 'get the root playlist
Set ply = par.CreateChildPlaylist(tmp) 'where "tmp" is the name of the playlist, "ply" will be the new SDBPlaylist object
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Re: Create Playlist With Songs from Text File
that's perfect thanks!!
I had played around with CreateChildPlaylist and saw how that worked but never realized how to get to the root.
Thanks again, question answered.
-phil
I had played around with CreateChildPlaylist and saw how that worked but never realized how to get to the root.
Thanks again, question answered.
-phil
Re: Create Playlist With Songs from Text File
Glad I could help
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.