From MediaMonkey Wiki
Jump to: navigation, search

CoClass SDBSongData, Interface ISDBSongData

Method SetPathByMask(Mask As String)

Method description

Similar to Path property and RenameByMask method, but allows you to set path according to Mask without moving the file. The file itself is moved once UpdateDB is called.

Example script:

Option Explicit

Sub OnStartUp()
    Dim oMenuItem

    Set oMenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_TrackList, 0, 0)
    oMenuItem.Caption = "PathByMask"
    oMenuItem.OnClickFunc = "Test"
    oMenuItem.UseScript = Script.ScriptPath
End Sub

Sub Test(oMenuItem)
    Dim oSongData   
    Set oSongData = SDB.SelectedSongList.Item(0)
    oSongData.SetPathByMask( SDB.Tools.UFText2Mask _
        ("C:\Music\<Genre>\<Album Artist>\<Album>\<Track#:2> - <Title>"))
    SDB.MessageBox oSongData.Path, mtInformation, Array(mbOK)
    SDB.MessageBox oSongData.Path, mtInformation, Array(mbOK)
End Sub

Added in MediaMonkey version 4.1