Remove Prefixes 1.1 - Updated 26/01/2008

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Remove Prefixes 1.1 - Updated 26/01/2008

Post by trixmoto »

This is a new script which can be used to remove prefixes and suffixes. First select the tracks you want to fix, then run the script from the menu. You are presented with a screen where you can specify the prefixes and suffixes you wish to be removed. Next you will be presented with a confirmation screen showing the changes that will be made - clicking Ok will apply the changes.

As per usual, the installer is available from my website. Let me know what you think!

Code: Select all

'
' MediaMonkey Script
'
' NAME: RemovePrefixes 1.1
'
' AUTHOR: trixmoto (http://trixmoto.net)
' DATE : 26/01/2008
'
' INSTALL: Copy to Scripts directory and add the following to Scripts.ini 
'          Don't forget to remove comments (') and set the order appropriately
'
' [RemovePrefixes]
' FileName=RemovePrefixes.vbs
' ProcName=RemovePrefixes
' Order=7
' DisplayName=Remove Prefixes
' Description=Remove prefixes and suffixes
' Language=VBScript
' ScriptType=0 
'
' FIXES: Fixed multiple artists not processed individually
'        Added checkboxes for each field to process
'

Option Explicit 
Public styleOn,holdArtist,holdAlbum,holdTitle,holdAlbumArtist 
Set holdArtist = CreateObject("Scripting.Dictionary") 
Set holdAlbum = CreateObject("Scripting.Dictionary") 
Set holdTitle = CreateObject("Scripting.Dictionary") 
Set holdAlbumArtist = CreateObject("Scripting.Dictionary")  

Function style() 
  styleOn = Not styleOn 
  If styleOn Then 
    style = "" 
  Else 
    style = " class=""Dark""" 
  End If 
End Function  

Function fix(orig,arr) 
  fix = orig
  Dim t : t = ""   
  Dim j : j = 0
  Dim a : a = Split(orig,"; ")
  For j = 0 To UBound(a)
    Dim s : s = a(j)
  
    'ignore brackets at the end
    Dim i : i = InStr(s,"(")
    If i > 0 Then
      t = Mid(s,i)
      s = Left(s,i-1)
    Else
      i = InStr(s,"[")
      If i > 0 Then
        t = Mid(s,i)
        s = Left(s,i-1)
      Else 
        i = InStr(s,"{")
        If i > 0 Then
          t = Mid(s,i)
          s = Left(s,i-1)
        End If      
      End If    
    End If
    While (Right(s,1) = " ")
      t = " "&t  
      s = Left(s,Len(s)-1)
    WEnd
    
    'apply fixes
    For i = 0 To UBound(arr)
      Dim word : word = UCase(Mid(arr(i),2))
      Dim wlen : wlen = Len(word)+1  
      If wlen > 1 Then
        Select Case Left(arr(i),1)
          Case "P"
            If word&" " = UCase(Left(s,wlen)) Then
              a(j) = Mid(s,wlen+1)&t
              Exit For
            End If
          Case "S"
            If " "&word = UCase(Right(s,wlen)) Then 
              a(j) = Left(s,Len(s)-wlen)&t
              Exit For
            End If
        End Select
      End If
    Next
  Next
    
  fix = Join(a,"; ")
End Function 

Sub OnCancel(Btn) 
  Set holdAlbum = Nothing 
  Set holdAlbumArtist = Nothing 
  Set holdArtist = Nothing 
  Set holdTitle = Nothing 
   
  Set SDB.Objects("holdArtist") = Nothing 
  Set SDB.Objects("holdAlbumArtist") = Nothing 
  Set SDB.Objects("holdAlbum") = Nothing 
  Set SDB.Objects("holdTitle") = Nothing 
  
  Set SDB.Objects("RemovePrefixesForm") = Nothing  
  Set SDB.Objects("RemovePrefixesList") = Nothing 
  Set SDB.Objects("RemovePrefixesBody") = Nothing 
  Set SDB.Objects("RemovePrefixesWeb") = Nothing 
End Sub 

Sub OnAdd(Btn) 
  Dim s : s = Mid(Btn.Common.ControlName,4)
  If IsNumeric(s) Then
    Dim i : i = Int(s)+1
    Dim Body : Set Body = Btn.Common.Parent
    Btn.OnClickFunc = "OnDel"
    Btn.Caption = "-"
    
    Dim Drp : Set Drp = SDB.UI.NewDropDown(Body) 
    Drp.Common.SetRect 25,(i+1)*25,100,25 
    Drp.Common.ControlName = "Drp"&i
    Drp.Style = 2
    Drp.AddItem("Select...")
    Drp.AddItem("Prefix")
    Drp.AddItem("Suffix")
    Drp.ItemIndex = 0
    
    Dim Edt : Set Edt = SDB.UI.NewEdit(Body)
    Edt.Common.SetRect 130,(i+1)*25,200,25
    Edt.Common.ControlName = "Edt"&i
    
    Dim Btn2 : Set Btn2 = SDB.UI.NewButton(Body)
    Btn2.Common.SetRect 335,(i+1)*25,21,21
    Btn2.Common.ControlName = "Btn"&i
    Btn2.UseScript = Script.ScriptPath
    Btn2.OnClickFunc = "OnAdd"
    Btn2.Caption = "+"
  End If
End Sub

Sub OnDel(Btn) 
  Dim s : s = Mid(Btn.Common.ControlName,4)
  If IsNumeric(s) Then
    Dim i : i = Int(s)
    Dim Body : Set Body = Btn.Common.Parent
    
    Dim Drp : Set Drp = Body.Common.ChildControl("Drp"&i)
    If Not (Drp Is Nothing) Then
      Drp.ItemIndex = 0
    End If
    Dim Edt : Set Edt = Body.Common.ChildControl("Edt"&i)
    If Not (Edt Is Nothing) Then
      Edt.Text = ""
    End If    
  End If  
End Sub

Sub OnGo(Btn)
  Dim list : Set list = SDB.Objects("RemovePrefixesList")
  Dim form : Set form = SDB.Objects("RemovePrefixesForm")
  Dim body : Set body = SDB.Objects("RemovePrefixesBody")
  Dim web : Set web = SDB.Objects("RemovePrefixesWeb")
  If (web Is Nothing) Or (list Is Nothing) Or (form Is Nothing) Or (body Is Nothing) Then
    Call SDB.MessageBox("RemovePrefixes: Objects have been lost.",mtError,Array(mbOk)) 
    Exit Sub
  End If
  form.Common.Visible = False
  Dim ini : Set ini = SDB.IniFile
  Dim doc : Set doc = web.Interf.Document
  Dim str : str = ""
  Dim tmp : tmp = ""
  Dim i : i = 0
  
  ' Save lists
  Dim obj : Set obj = body.Common.ChildControl("Drp"&i)
  While Not (obj Is Nothing)
    If obj.ItemIndex > 0 Then
      Select Case obj.ItemIndex
        Case 1
          tmp = "P"
        Case 2
          tmp = "S"
      End Select
      Set obj = body.Common.ChildControl("Edt"&i)
      If Not (obj Is Nothing) Then
        If Not (obj.Text = "") Then
          If str = "" Then
            str = tmp&obj.Text
          Else
            str = str&":|:"&tmp&obj.Text
          End If
        End If
      End If
    End If
    i = i + 1
    Set obj = body.Common.ChildControl("Drp"&i)
  WEnd
  If str = "" Then
    Call SDB.MessageBox("RemovePrefixes: No fixes have been defined.",mtError,Array(mbOk)) 
    Exit Sub
  End If  
  ini.StringValue("RemovePrefixes","Fixes") = str
  Dim arr : arr = Split(str,":|:")

  ' Save options
  Dim Chk1 : Set Chk1 = body.Common.ChildControl("Chk1")
  Dim Chk2 : Set Chk2 = body.Common.ChildControl("Chk2")
  Dim Chk3 : Set Chk3 = body.Common.ChildControl("Chk3")
  Dim Chk4 : Set Chk4 = body.Common.ChildControl("Chk4")
  If (Chk1 Is Nothing) Or (Chk2 Is Nothing) Or (Chk3 Is Nothing) Or (Chk4 Is Nothing) Then
    Call SDB.MessageBox("RemovePrefixes: Options have been lost.",mtError,Array(mbOk)) 
    Exit Sub
  End If
  Dim incArtist : incArtist = Chk1.Checked
  Dim incTitle : incTitle = Chk2.Checked
  Dim incAlbum : incAlbum = Chk3.Checked
  Dim incAlbumArtist : incAlbumArtist = Chk4.Checked
  ini.BoolValue("RemovePrefixes","Artist") = incArtist
  ini.BoolValue("RemovePrefixes","Title") = incTitle
  ini.BoolValue("RemovePrefixes","Album") = incAlbum
  ini.BoolValue("RemovePrefixes","AlbumArtist") = incAlbumArtist
  If (incArtist = False) And (incTitle = False) And (incAlbum = False) And (incAlbumArtist = False) Then
    Call SDB.MessageBox("RemovePrefixes: No fields selected to process.",mtError,Array(mbOk)) 
    Exit Sub
  End If  
  
  ' Write confirmation
  doc.write "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">" & vbcrlf 
  doc.write "<html>" & vbcrlf 
  doc.write "  <head>" & vbcrlf 
  doc.write "    <title>" & SDB.Localize("Remove Prefixes") & "</title>" & vbcrlf 
  doc.write "    <style TYPE=text/css>" & vbcrlf 
  doc.write "      body{font-family:'Verdana',sans-serif; background-color:#FFFFFF; font-size:9pt; color:#000000;}" & vbcrlf 
  doc.write "      P{font-family:'Verdana',sans-serif; font-size:8pt; color:#000000;}" & vbcrlf 
  doc.write "      TH{font-family:'Verdana',sans-serif; font-size:9pt; font-weight:bold; color:#000000; border-color:#000000; border-style: solid; border-left-width:0px; border-right-width:0px; border-top-width:0px; border-bottom-width:3px;}" & vbcrlf 
  doc.write "      TD{font-family:'Verdana',sans-serif; font-size:8pt; color:#000000; border-color:#000000; border-style: solid; border-left-width:0px; border-right-width:0px; border-top-width:0px; border-bottom-width:1px;}" & vbcrlf 
  doc.write "      TD.highlight{font-family:'Verdana',sans-serif; font-size:8pt; background-color:#FFFF77; color:#000000; border-color:#000000; border-style: solid; border-left-width:0px; border-right-width:0px; border-top-width:0px; border-bottom-width:1px;}" & vbcrlf 
  doc.write "      TR.dark{background-color:#EEEEEE}" & vbcrlf 
  doc.write "      TR.aleft TH{text-align:left}" & vbcrlf 
  doc.write "    </style>" & vbcrlf 
  doc.write "  </head>" & vbcrlf 
  doc.write "  <body>" & vbcrlf 
  doc.write "   <table border=""0"" cellspacing=""0"" cellpadding=""4"" width=""100%"">" & vbcrlf  
  doc.write "    <tr class=""aleft"">" & vbcrlf 
  If incArtist Then
    doc.write "      <th>" & SDB.Localize("Artist") & "</th>" & vbcrlf 
  End If
  If incTitle Then
    doc.write "      <th>" & SDB.Localize("Title") & "</th>" & vbcrlf 
  End If
  If incAlbum Then
    doc.write "      <th>" & SDB.Localize("Album") & "</th>" & vbcrlf 
  End If
  If incAlbumArtist Then
    doc.write "      <th>" & SDB.Localize("Album Artist") & "</th>" & vbcrlf 
  End If
  doc.write "    </tr>" & vbcrlf 

  ' Process tracks 
  For i = 0 To list.Count-1 
    Dim itm : Set itm = list.Item(i) 
    Dim artist : artist = itm.ArtistName
    If incArtist Then
      artist = fix(itm.ArtistName,arr) 
    End If
    Dim title : title = itm.Title
    If incTitle Then
      title = fix(itm.Title,arr) 
    End If
    Dim album : album = itm.AlbumName
    If incAlbum Then
      album = fix(itm.AlbumName,arr) 
    End If
    Dim albumArtist : albumArtist = itm.AlbumArtistName
    If incAlbumArtist Then
      albumArtist = fix(itm.AlbumArtistName,arr) 
    End If

    doc.write "    <tr" & style() & ">" & vbcrlf      
    If incArtist Then
      doc.write outField(artist, itm.artistName) 
    End If
    If incTitle Then
      doc.write outField(title, itm.title) 
    End If
    If incAlbum Then
      doc.write outField(album, itm.albumName) 
    End If
    If incAlbumArtist Then
      doc.write outField(albumArtist, itm.albumArtistName) 
    End If
    If incArtist And artist <> "" And artist <> itm.artistName Then 
      holdArtist.add itm, artist 
    End If 
    If incAlbumArtist And albumArtist <> "" And albumArtist <> itm.albumArtistName Then 
      holdAlbumArtist.add itm, albumArtist 
    End If 
    If incTitle And title <> "" And title <> itm.title Then 
      holdTitle.add itm, title 
    End If 
    If incAlbum And album <> "" And album <> itm.albumName Then 
      holdAlbum.add itm, album 
    End If 
    doc.write "    </tr>" & vbcrlf 
  Next 'i 
   
  ' Finish off
  doc.write "   </table>" & vbcrlf 
  doc.write "  </body>" & vbcrlf 
  doc.write "</html>" & vbcrlf 
  doc.close 
  Set SDB.Objects("holdArtist") = holdArtist 
  Set SDB.Objects("holdAlbumArtist") = holdAlbumArtist 
  Set SDB.Objects("holdAlbum") = holdAlbum 
  Set SDB.Objects("holdTitle") = holdTitle
  
  'Show confirmation
  Btn.OnClickFunc = "OnOK"
  body.Common.Visible = False
  web.Common.Visible = True
  form.Common.Visible = True
End Sub

Sub OnOK(Btn) 
  Set holdAlbum = SDB.Objects("holdAlbum") 
  Set holdAlbumArtist = SDB.Objects("holdAlbumArtist") 
  Set holdArtist = SDB.Objects("holdArtist") 
  Set holdTitle = SDB.Objects("holdTitle")
  If (holdAlbum Is Nothing) Or (holdAlbumArtist Is Nothing) Or (holdArtist Is Nothing) Or (holdTitle Is Nothing) Then
    Call SDB.MessageBox("RemovePrefixes: Objects have been lost.",mtError,Array(mbOk)) 
    Exit Sub
  End If  

  Dim itm : Set itm = Nothing
  Dim list : Set list = SDB.NewSongList
  Dim items : Set items = CreateObject("Scripting.Dictionary") 
  Dim albumNames : Set albumNames = CreateObject("Scripting.Dictionary") 
  Dim artistNames : Set artistNames = CreateObject("Scripting.Dictionary") 

  For Each itm In holdArtist  
    If Not items.Exists(itm) Then 
      Call items.Add(itm,itm)
    End If 
    itm.ArtistName = holdArtist.Item(itm)
  Next 'itm 
   
  For Each itm In holdAlbumArtist  
    If Not items.Exists(itm) Then 
      Call items.Add(itm,itm) 
    End If 
    itm.AlbumArtistName = holdAlbumArtist.Item(itm)
  Next 'itm 
   
  For Each itm In holdAlbum  
    If Not items.Exists(itm) Then 
      Call items.Add(itm,itm)
    End If 
    itm.AlbumName = holdAlbum.Item(itm)  
  Next 'itm 
   
  For Each itm In holdTitle  
    If Not items.Exists(itm) Then 
      Call items.Add(itm,itm)
    End If 
    itm.Title = holdTitle.Item(itm)
  Next 'itm 
   
  For Each itm In items 
    If itm.ID > -1 Then 
      itm.UpdateArtist
      itm.UpdateAlbum
      Call list.Add(itm)
    End If 
  Next 'itm   
  list.UpdateAll
   
  Call OnCancel(Nothing)
End Sub 

Function MapXML(orig) 
  Dim hold : hold = Replace(orig,"&","&") 
  hold = Replace(hold," ","&nbsp;") 
  hold = Replace(hold,"<","<") 
  hold = Replace(hold,">",">") 
  Dim i : i = 1 
  While i <= Len(hold) 
    If (AscW(Mid(hold,i,1))>127) Then 
      hold = Mid(hold,1,i-1)+"&#"+CStr(AscW(Mid(hold, i, 1)))+";"+Mid(hold,i+1) 
    End If 
    i = i + 1 
  WEnd 
  If hold = "" Then
    hold = "&nbsp;"
  End If
  MapXML = hold 
End Function 

Function outField (fixed,normal) 
  If fixed = normal Then 
    outField = "<td>" & MapXML(normal) & "</td>" & vbcrlf 
  Else 
    outField = "<td class=""highlight"">" & MapXML(fixed) & "</td>" & vbcrlf 
  End If 
End Function 

Sub RemovePrefixes 
  ' Get selected tracks
  Dim list : Set list = SDB.SelectedSongList 
  If list.Count = 0 Then 
    Set list = SDB.AllVisibleSongList 
    If list.Count = 0 Then 
      Call SDB.MessageBox("RemovePrefixes: No tracks are selected.",mtError,Array(mbOk)) 
      Exit Sub 
    End If    
  End If  
  Set SDB.Objects("RemovePrefixesList") = list

  ' Create the window to be shown
  Dim UI : Set UI = SDB.UI  
  Dim Form : Set Form = UI.NewForm 
  Form.Common.SetRect 50, 50, 500, 400 
  Form.Common.MinWidth = 360 
  Form.Common.MinHeight = 150 
  Form.FormPosition = 4 
  Form.Caption = SDB.Localize("Remove Prefixes") 
  Form.StayOnTop = True 
  Set SDB.Objects("RemovePrefixesForm") = Form
  
  ' Create a web browser component 
  Dim WB : Set WB = UI.NewActiveX(Form, "Shell.Explorer") 
  WB.Common.Align = 5
  WB.Common.Visible = False
  If (SDB.VersionHi = 2) And (SDB.VersionLo < 5) Then 
    WB.Interf.Navigate "about:"
  End If
  Set SDB.Objects("RemovePrefixesWeb") = WB
  
  'Create option panel
  Dim Body : Set Body = UI.NewPanel(Form)
  Body.Common.Align = 5
  Set SDB.Objects("RemovePrefixesBody") = Body
  
  'Create lists
  Dim ini : Set ini = SDB.IniFile
  Dim arr : arr = Split(ini.StringValue("RemovePrefixes","Fixes"),":|:")
  Dim i : i = 0
  Dim j : j = UBound(arr)
  If j < 0 Then
    j = 0 
  End If
  For i = 0 To j
    Dim Drp : Set Drp = UI.NewDropDown(Body) 
    Drp.Common.SetRect 25,(i+1)*25,100,25 
    Drp.Common.ControlName = "Drp"&i
    Drp.Style = 2
    Drp.AddItem("Select...")
    Drp.AddItem("Prefix")
    Drp.AddItem("Suffix")
    If i > UBound(arr) Then
      Drp.ItemIndex = 0
    Else
      Select Case Left(arr(i),1)
        Case "P"
          Drp.ItemIndex = 1
        Case "S"
          Drp.ItemIndex = 2
        Case Else
          Drp.ItemIndex = 0
      End Select
    End If
    
    Dim Edt : Set Edt = UI.NewEdit(Body)
    Edt.Common.SetRect 130,(i+1)*25,200,25
    Edt.Common.ControlName = "Edt"&i
    If i > UBound(arr) Then
      Edt.Text = ""
    Else
      Edt.Text = Mid(arr(i),2)
    End If
    
    Dim Btn : Set Btn = UI.NewButton(Body)
    Btn.Common.SetRect 335,(i+1)*25,21,21
    Btn.Common.ControlName = "Btn"&i
    Btn.UseScript = Script.ScriptPath
    If i = j Then
      Btn.OnClickFunc = "OnAdd"
      Btn.Caption = "+"
    Else
      Btn.OnClickFunc = "OnDel"
      Btn.Caption = "-"
    End If
  Next
  
  Dim Chk1 : Set Chk1 = UI.NewCheckbox(Body)
  Chk1.Common.SetRect 375,25,100,21
  Chk1.Common.ControlName = "Chk1"
  Chk1.Caption = "Artist"
  If ini.StringValue("RemovePrefixes","Artist") = "" Then
    Chk1.Checked = True
  Else
    Chk1.Checked = ini.BoolValue("RemovePrefixes","Artist")
  End If

  Dim Chk2 : Set Chk2 = UI.NewCheckbox(Body)
  Chk2.Common.SetRect 375,50,100,21
  Chk2.Common.ControlName = "Chk2"
  Chk2.Caption = "Title"
  If ini.StringValue("RemovePrefixes","Title") = "" Then
    Chk2.Checked = True
  Else
    Chk2.Checked = ini.BoolValue("RemovePrefixes","Title")
  End If
  
  Dim Chk3 : Set Chk3 = UI.NewCheckbox(Body)
  Chk3.Common.SetRect 375,75,100,21
  Chk3.Common.ControlName = "Chk3"
  Chk3.Caption = "Album"
  If ini.StringValue("RemovePrefixes","Album") = "" Then
    Chk3.Checked = True
  Else
    Chk3.Checked = ini.BoolValue("RemovePrefixes","Album")
  End If
  
  Dim Chk4 : Set Chk4 = UI.NewCheckbox(Body)
  Chk4.Common.SetRect 375,100,100,21
  Chk4.Common.ControlName = "Chk4"
  Chk4.Caption = "AlbumArtist"
  If ini.StringValue("RemovePrefixes","AlbumArtist") = "" Then
    Chk4.Checked = True
  Else
    Chk4.Checked = ini.BoolValue("RemovePrefixes","AlbumArtist")
  End If  

  ' Create a panel at the bottom of the window 
  Dim Foot : Set Foot = UI.NewPanel(Form) 
  Foot.Common.Align = 2 
  Foot.Common.Height = 35 

  ' Create a button that closes the window 
  Dim Btn2 : Set Btn2 = UI.NewButton(Foot) 
  Btn2.Caption = SDB.Localize("&Cancel") 
  Btn2.Common.SetRect Foot.Common.Width/2+10, 5, 85, 24 
  Btn2.Common.Anchors = 9
  Btn2.UseScript = Script.ScriptPath 
  Btn2.OnClickFunc = "OnCancel" 

  ' Create a button that saves the changes 
  Dim Btn3 : Set Btn3 = UI.NewButton(Foot) 
  Btn3.Caption = SDB.Localize("&OK")  
  Btn3.Common.SetRect Foot.Common.Width/2-85, 5, 85, 24 
  Btn3.Common.Anchors = 9 
  Btn3.UseScript = Script.ScriptPath 
  Btn3.OnClickFunc = "OnGo"  

  ' Show form
  Form.Common.Visible = True  
End Sub 

Sub Install()
  Dim inip : inip = SDB.ApplicationPath&"Scripts\Scripts.ini"
  Dim inif : Set inif = SDB.Tools.IniFileByPath(inip)
  If Not (inif Is Nothing) Then
    inif.StringValue("RemovePrefixes","Filename") = "RemovePrefixes.vbs"
    inif.StringValue("RemovePrefixes","Procname") = "RemovePrefixes"
    inif.StringValue("RemovePrefixes","Order") = "7"
    inif.StringValue("RemovePrefixes","DisplayName") = "Remove Prefixes"
    inif.StringValue("RemovePrefixes","Description") = "Remove prefixes and suffixes"
    inif.StringValue("RemovePrefixes","Language") = "VBScript"
    inif.StringValue("RemovePrefixes","ScriptType") = "0"
    SDB.RefreshScriptItems
  End If
End Sub
Last edited by trixmoto on Sat Jan 26, 2008 10:03 am, edited 1 time in total.
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.
Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky »

Cool.

Seems like it would be just as easy to make it a full search and replace script. If wanted to remove a string, just leave replace empty

:)
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

There is a lot of risk involved with a search and replace script - it's too easy to remove text that you don't want to (such as "the" from "there" to give you "re"). This script is designed to be easy and safe to use. I might look at doing a more powerful version though! :)
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.
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

An MM3 installation package is now available from my website for this script. :)
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.
sommo

Post by sommo »

Thanks for this!
*going to try it out*
ResumeMan
Posts: 40
Joined: Wed Feb 08, 2006 1:11 pm

Post by ResumeMan »

Nice script, looks like it's going to be useful in some mods I want to make to my collection.

Question: Any idea how to remove a prefix from one tag (album) when the same prefix appears at the start of another (artist)?

e.g.

Artist: Bruce Springsteen
Album: Bruce 1975-10-15 Asbury Park
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Not at the moment, although i guess the fields could be made optional in the future.
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.
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

New version (1.1) is now available to download from my website. Changes include...

- Fixed multiple artists not processed individually
- Added checkboxes for each field to process
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.
aprzybylo
Posts: 301
Joined: Tue Aug 21, 2007 2:58 pm
Location: Ottawa, Canada
Contact:

Post by aprzybylo »

First I tried to remove "The" from my song titles, worked great.

Then I have many songs that have strings like [*] at the end, so I run the script select Suffix and set it to [*]. Here the script fails as it doesn't find any song that satisfy this condition (there are tons). DO I do something wrong or there is a problem with script?

Thanks
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Do you mean exactly "[*]" or are you using "*" as a wildcard?
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.
aprzybylo
Posts: 301
Joined: Tue Aug 21, 2007 2:58 pm
Location: Ottawa, Canada
Contact:

Post by aprzybylo »

no, not as wildcard. I have many titles that have the farm like:

Title [*]
or
Title [#]
or
Title [instrumental]

I would like to remove all those [...] parts and for some reason it doesn't work
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Ah yes, there's some code to ignore bracketed text at the end of strings!! You'll need to open the script file in a text editor and comment out (or remove) lines 51-66. That should make it work for you. :)
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.
Guest

Post by Guest »

I tried to remove sort of "webpage"-suffixes. It wont work. For example www.djgeru.prv.pl
I tried pl, .pl, prv.pl, .prv.pl, djgeru.prv.pl, .djgeru.prv.pl and www.djgeru.prv.pl
Nothing worked for me and i have a lot of songs in my database, that could use a fix for that. Can anyone help me?
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

That's strange, it shouldn't make any difference what the suffix is as long as it doesn't contain brackets. :S
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.
JuBe
Posts: 70
Joined: Sat Dec 30, 2006 7:15 am

Post by JuBe »

Another great script, trix. Just wanted to let you know that the prefix is working fine for me, but suffix isn't working. I have .m4a at the end of a lot of track titles, but .m4a, m4a, and even a don't work.
Post Reply