The original thread for trixmoto's "Import XMCD" script can be found here.
What this script will do is add information from a XMCD file from freedb.org to your library. Just locate your album at freedb.org, save the XMCD file to your hard drive, then open MM and go to "tools" - "scripts" - "ImportXMCDplus". Once you select the desired XMCD file you will be prompted with a series of input boxes allowing you to determine the albums genre (I personally have a genre for vinyl in my library - so this works well for me), add comments to the albums "comments" field (I use this for noting the albums condition and sometimes which pressing it is), and an input field for each of the albums tracks allowing you to note which side of the album the track is found on (this adds the album side to the beginning of the track title).
We tried to figure out how to associate album art with these files, but had no luck. I have thought of one or two minor tweaks I'd like to make - so there will likely be a second version. If anyone has any suggestions or comments whatsoever please feel free to post. Enjoy!
Code: Select all
'
' MediaMonkey Script
'
' NAME: ImportXMCDplus v1.0 (a variation of trixmoto's ImportXMCD v1.2)
'
' ORIG. AUTHOR: trixmoto (http://trixmoto.net)
' DATE : 02/09/2007
'
' Additional code added by Warren W. (Dec. 2011)
' -Created input boxes for Genre, Album Side, and Comments
'
' INSTALL: Copy to Scripts directory and add the following to Scripts.ini
' Don't forget to remove comments (') and set the order appropriately
'
' FIXES: Fixed track titles don't necessarily contain artist names
'
' [ImportXMCDplus]
' FileName=ImportXMCDplus.vbs
' ProcName=ImportXMCDplus
' Order=30
' DisplayName=Import XMCD Plus
' Description=Import tags from xmcd file and edit additional fields, useful for tracking a vinyl (or other media) collection within MediaMonkey
' Language=VBScript
' ScriptType=0
'
Option Explicit
Sub ImportXMCDplus
'get filename
Dim dlg : Set dlg = SDB.CommonDialog
dlg.Filter = "XMCD file|*.*"
dlg.Flags = cdlOFNOverwritePrompt + cdlOFNHideReadOnly + cdlOFNNoChangeDir
dlg.InitDir = SDB.MyMusicPath
dlg.ShowOpen
If Not dlg.Ok Then
Exit Sub
End If
'read file
Dim alb : alb = ""
Dim art : art = ""
Dim yea : yea = ""
Dim gen : gen = ""
Dim tra : tra = 0
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
Dim txt : Set txt = fso.OpenTextFile(dlg.FileName,1,False)
Dim MediaG : MediaG = InputBox ("Genre")
Dim comment : comment = InputBox ("Comments")
Do While Not txt.AtEndOfStream
Dim str : str = Trim(txt.ReadLine)
If Left(str,1) = "#" Then
'comment
Else
Dim pos : pos = InStr(str,"=")
If pos > 0 Then
Dim tag : tag = Left(str,pos-1)
Dim val : val = Mid(str,pos+1)
Select Case Left(tag,4)
Case "DTIT"
art = Left(val,InStr(val," / ")-1)
alb = Mid(val,InStr(val," / ")+3)
Case "DYEA"
yea = val
Case "DGEN"
gen = val
Case "TTIT"
tra = tra + 1
Dim itm : Set itm = SDB.NewSongData
Dim Albumside : Albumside = InputBox ("Track "&tra&" - Album Side:")
itm.AlbumName = alb
itm.AlbumArtistName = art
itm.Year = yea
itm.Genre = MediaG
itm.comment = comment
If InStr(val," / ") > 0 Then
itm.Title = Mid(val,InStr(val," / ")+3)
itm.ArtistName = Left(val,InStr(val," / ")-1)
Else
itm.Title = Albumside&") "&val
itm.ArtistName = art
End If
itm.TrackOrder = tra
itm.UpdateArtist
itm.UpdateAlbum
itm.UpdateDB
End Select
End If
End If
Loop
txt.close
Call SDB.MessageBox("ImportXMCDplus: "&tra&" tracks successfully created.",mtInformation,Array(mbOk))
End Sub
![:D](./images/smilies/icon_biggrin.gif)