ISDBSongData::SetPathByMask

From MediaMonkey Wiki
Revision as of 16:47, 26 September 2013 by Ludek (talk | contribs) (Created page with "{{MethodDeclaration|SDBSongData|ISDBSongData|Method SetPathByMask(Mask As String)}} ===Method description=== Similar to Path property and RenameByMask method, but allows you to...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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)
    oSongData.DiscardChanges
    SDB.MessageBox oSongData.Path, mtInformation, Array(mbOK)
End Sub


Added in MediaMonkey version 4.1