Moving MixMeister MXM Files During Auto Organize
- Tutorials |
- MXM |
- MixMeister |
- Migration |
- MediaMonkey |
- Library Management
One of the things that's been driving me crazy is whenever I organize my music collection (or more accurately, organize it more) I end up losing the data MixMeister generates for a file when the audio file gets moved to a new location. The next time I run BPM Calc it's as if I've never played it before and that means it has to be reanalyzed which takes forever.
Well, a genius on the MediaMonkey forums, Trixmoto has a script add-on that corrects this problem. You can get the script code and read more about the script at http://www.mediamonkey.com/forum/viewtopic.php?f=2&t=12441. Right now the script is set up to move the "buddy" files for Ableton but if you make one small little change in the code it'll do MXM files as well. Specifically every time a file is going to be moved or renamed this script will automatically check to see if there are any associated MXM files and it will move them (and rename them appropriately) so you don't lose your MixMeister settings. Nifty, eh?
To install this all you have to do is copy the code below and save it as movefiles.vbs to the /scripts/auto directory of your MediaMonkey installation. That's it.
BTW, if you're looking for some slick scripts for your MediaMonkey add on pleasure, check out Trixmoto's site at http://trixmoto.net. Trixmoto is the fabulous soul responsible for this script. All the variants on this page are merely modifications to the code for Traktor specific files. Not exactly rocket science.
Here's the code with the necessary changes:
'
' MediaMonkey Script
'
' NAME: MoveFiles 1.2.T
'
' AUTHOR: trixmoto (http://trixmoto.net)
' DATE : 10/01/2010
' Traktor Version: Rob Tacey (http://djsizzly.com)
' DATE: 5/26/2011
'
' INSTALL: Copy to Scripts\Auto directory
'
' FIXES: Fixed buddy files not being renamed when necessary
'
Option Explicit
Dim Types : Types = Array("mxm")
Dim CopyOver : CopyOver = True
Sub OnStartUp()
Call Script.RegisterEvent(SDB,"OnBeforeTracksMove","MoveFiles")
End Sub
Sub MoveFiles(tracks,paths,move)
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
Dim i : i = 0
Dim j : j = 0
'loop through tracks being moved
For i = 0 To tracks.Count-1
Dim itm : Set itm = tracks.Item(i)
Dim pos : pos = InStrRev(itm.Path,".")
Dim oldf : oldf = Left(itm.Path,pos-1)
Dim olde : olde = Mid(itm.Path,pos)
'loop through extensions to check
For j = 0 To UBound(Types)
pos = InStrRev(paths.Item(i),".")
Dim newf : newf = Left(paths.Item(i),pos-1)
Dim newe : newe = ""
Dim tmpe : tmpe = "."&Types(j)
'check if either buddy file exists
If fso.FileExists(oldf&tmpe) Then
newe = tmpe
Else
If fso.FileExists(oldf&olde&tmpe) Then
newe = olde&tmpe
End If
End If
'move or copy buddy file
If Not (newe = "") Then
Dim sour : sour = oldf&newe
Dim dest : dest = newf&newe
If Not (sour = dest) Then
Call GeneratePath(Left(dest,InStrRev(dest,"\")))
If move Then
Call fso.MoveFile(sour,dest)
Else
Call fso.CopyFile(sour,dest,CopyOver)
End If
End If
End If
Next
Next
End Sub
Function GeneratePath(pFolderPath)
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
GeneratePath = False
If Not fso.FolderExists(pFolderPath) Then
If GeneratePath(fso.GetParentFolderName(pFolderPath)) Then
GeneratePath = True
Call fso.CreateFolder(pFolderPath)
End If
Else
GeneratePath = True
End If
End Function
Helpful? Let me know. I aim to please - especially if my little goslings gush about it. Still having issues? I still aim to please. Let me know what went wonky.



