PersonalTagEnhancer (AutoTagging)

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

Moderators: Peke, Gurus

PapaFrita
Posts: 8
Joined: Sun Feb 05, 2006 8:12 pm

PersonalTagEnhancer (AutoTagging)

Post by PapaFrita »

I was wondering if it is possible to standarize words like feat. ft (feat) f. rmx (remix) remix (rmx) and any other words like that that aren't consistantly named. I was hoping for the auto tagger to pick up on this and rename the songs to say the same thing because it's annoying when u have to of the same song one labelled with a different ending then the other.

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

Post by trixmoto »

Well it is possible to create a script with a list of words to replace with a single word. However, there are problems with this. For example:

if: feat -> (feat)
then: defeat -> de(feat)

if: ft -> (feat)
then: shaft -> sha(feat)

You'd have to be very careful about what rules you applied.
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.
Lowlander
Posts: 56491
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Post by Lowlander »

Just replace spacefeatspace or spaceftspace and there will probably be no problems.
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Latest available script code is located HERE
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


As an example, a script I wrote a "long" time ago, just to make sure my personal tagging style is applied to my songs.

Code: Select all

CODE REMOVED: Please see for the new code further in this thread...
Because this tagging is so "personal", most people will want different things to change from/to.

BTW: Here I use ft.space (no space in front) because sometimes a title/artist name can be XXXXX (ft. YYYY). In my case, it still works.

Cheers
Steegy
Last edited by Steegy on Wed Dec 09, 2009 4:12 pm, edited 4 times in total.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Lowlander
Posts: 56491
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Post by Lowlander »

Then I would advice the following to prevent bad conversions:
  • spaceftspace
    (ftspace
    (ft.
    spaceft.
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Post by Bex »

Steegy,

Your script looks cool! I'll certanly give it a try. Your way of tagging is exactly how I do it.

/Bex
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

A little rough update for the script:

Code: Select all

CODE REMOVED: Please see for the new code further in this thread...
Now all necessary corrections work for both Title and ArtistName (because things like "featuring" can be in both).
It works more careful so it won't change anything to an artist named "Defeaturing"...).

Cheers
Steegy
Last edited by Steegy on Sun Apr 02, 2006 10:22 pm, edited 2 times in total.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
JhotIII
Posts: 21
Joined: Thu Dec 01, 2005 2:33 pm

Post by JhotIII »

Hi
I have tried Your script. It seems that album artist is not updated correctly. When exceuting the script the album artist field is updated, but when shifting focus, and back to the same album or artists, the change has reverted. I manage to fix this by issuing an itm.UpdateAlbum after itm.UpdateArtists. I do not know if this is suppose to work this way, or if it is a bug in the scripting tool, as none of these should be necessary according to the scripting help as (itm.UpdateDB) should be enough ?
Thanks Joern
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

as none of these should be necessary according to the scripting help as (itm.UpdateDB) should be enough ?
These separate functions normally only need to be called in case you're only changing the casing (UpdateDB alone doesn't update casing, if that's the only change).
I must say this slipped my mind. (if that's correct English :-? )
First only the Artist field (and thus it's capitalisation) could be changed. After I changed the script to also handle the AlbumArtist field, I forgot to add the function you mentioned.

Thanks for letting us know, I'll change it.

Cheers
Steegy
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

Ok, here's the updated script (with preview, and some minor enhancements):

The code is splitted over 2 posts because it was too long. However, it's one single file!

For the Scripts folder:

Code: Select all

Option Explicit

'//////////////////////////////////////////////////////////////
'// PersonalTagEnhancer                 Updated on 03/04/06  //
'//////////////////////////////////////////////////////////////
'// Made by Steegy aka RC (Ruben Castelein)                  //	
'//                                                          //
'// >>> Fixes most important tags using personal preferences //
'//////////////////////////////////////////////////////////////

'>> ForumURL: http://www.mediamonkey.com/forum/viewtopic.php?t=8044
'>> ScriptName: PersonalTagEnhancer
'>> VersionNumber: 1.0
'>> Author: Steegy aka RC (Ruben Castelein)
'>>>>EndOfProperties



'///////////////////////////////////////////////////
'// FORM CREATION AND CALLING OF ENHANCER METHODS //
'///////////////////////////////////////////////////

Sub PersonalTagEnhancer
    
   Dim trackList
   Set trackList = SDB.SelectedSongList 
   If trackList.count=0 Then 
      Set trackList = SDB.AllVisibleSongList 
   End If 

   If trackList.count=0 Then 
      SDB.MessageBox "Select tracks to be updated", mtError, Array(mbOk)
      Exit Sub 
   End If 

  Dim UI
  Set UI = SDB.UI

  Dim DlgWidth
  DlgWidth = 500

  ' Create the window to be shown
  Dim Form
  Set Form = UI.NewForm
  Form.Common.SetRect 50, 50, DlgWidth, 400
  Form.Common.MinWidth = 200
  Form.Common.MinHeight = 150
  Form.FormPosition = mmFormScreenCenter
  Form.Caption = SDB.Localize("Personal Tag Enhancer")
  Form.StayOnTop = True

  ' Create a web browser component
  Dim WB
  Set WB = UI.NewActiveX(Form, "Shell.Explorer")
  WB.Common.Align = mmAlignClient      ' Fill all client rectangle
  WB.Common.ControlName = "WB"
  Dim doc
  Set doc = WB.Interf.Document

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

  ' Create a button that saves the report
  Dim Btn2
  Set Btn2 = UI.NewButton(Foot)
  Btn2.Caption = SDB.Localize("&Ok")
  Btn2.Common.SetRect DlgWidth - 205, 6, 85, 25
  Btn2.Common.Anchors = mmAnchorRight + mmAnchorBottom
  Btn2.UseScript = Script.ScriptPath
  Btn2.OnClickFunc = "OnOK"
  Btn2.Default = true

  ' Create a button that closes the window
  Dim Btn
  Set Btn = UI.NewButton(Foot)
  Btn.Caption = SDB.Localize("&Cancel")
  Btn.Common.SetRect DlgWidth - 105, 6, 85, 25
  Btn.Common.Anchors = mmAnchorRight + mmAnchorBottom
  Btn.UseScript = Script.ScriptPath
  Btn.OnClickFunc = "OnCancel"
  Btn.Cancel = True
  
  
  Dim Progress
  Set Progress = SDB.Progress
  Progress.Text = SDB.Localize("Personal Tag Enhancer: Loading preview of track enhancements...")
  Progress.MaxValue = trackList.count


  Form.SavePositionName = "PTEWindow"
  SDB.Objects("PTEForm") = Form  ' Save reference to the form somewhere, otherwise it would simply disappear


  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("Personal Tag Enhancer") & "</title>" & vbcrlf
  doc.write "  </head>" & 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 "H1{font-family:'Verdana',sans-serif; font-size:13pt; font-weight:bold; color:#AAAAAA; text-align:left}" & 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 "  <body>" & vbcrlf
  doc.write "    <H1>" & SDB.Localize("Changes by personal preferences:") & "</H1>" & vbcrlf
  doc.write "    <table border=""0"" cellspacing=""0"" cellpadding=""4"" width=""100%"">" & vbcrlf
  doc.write "      <tr class=""aleft"">" & vbcrlf
  doc.write "        <th>" & SDB.Localize("Artist") & "</th>" & vbcrlf
  doc.write "        <th>" & SDB.Localize("Title") & "</th>" & vbcrlf
  doc.write "        <th>" & SDB.Localize("Album") & "</th>" & vbcrlf
  doc.write "        <th>" & SDB.Localize("Album Artist") & "</th>" & vbcrlf
  doc.write "        <th>" & SDB.Localize("Genre") & "</th>" & vbcrlf
  doc.write "        <th>" & SDB.Localize("Track#") & "</th>" & vbcrlf
  doc.write "      </tr>" & vbCrLf
  
  
  Dim i, itm
  Dim artist, album, title, albumArtist, genre, trackOrder
  for i=0 to trackList.count-1
  
  If Progress.Terminate Then
    CloseDown
    Exit Sub
  End if
  Progress.Value = i+1
    
    doc.write "      <tr" & Style() & ">" & vbcrlf

    Set itm = trackList.Item(i)
    
    
   
    '///////////////////////////////////////////////////////////////////////
    '//////////////////////////////////////////
    '//////////////


	artist = FixCommonWords(ChangeCharacters(Trim(itm.ArtistName)))
	title = FixCommonWords(FixBrackets(ChangeCharacters(Trim(itm.Title))))
	genre = FixWrongGenre(Trim(itm.Genre))
	album = ChangeCharacters(Trim(itm.AlbumName))
	If album = "" Then 
       albumArtist = "" 
       trackOrder = 0
    Else
		albumArtist = FixCommonWords(ChangeCharacters(Trim(itm.AlbumArtistName)))
    	trackOrder = itm.trackOrder
    End If 

    '                                                         //////////////
    '                             //////////////////////////////////////////
    '///////////////////////////////////////////////////////////////////////

    
    Dim trackOrder_disp
    If trackOrder = 0 Then
    	trackOrder_disp = ""
    Else
    	trackOrder_disp = trackOrder
    End If
    
    Dim trackOrderItm_disp
    If itm.trackOrder = 0 Then
    	trackOrderItm_disp = ""
    Else
    	trackOrderItm_disp = itm.trackOrder
    End If
    
    doc.write outField(artist, itm.artistName)
    doc.write outField(title, itm.title)
    doc.write outField(album, itm.albumName)
    doc.write outField(albumArtist, itm.albumArtistName)
    doc.write outField(genre, itm.genre)
    doc.write outField(trackOrder_disp, trackOrderItm_disp)
    
    
    If artist <> "" And artist <> itm.artistName Then
      holdArtist.add itm, artist
    End If
    If albumArtist <> "" And albumArtist <> itm.albumArtistName Then
      holdAlbumArtist.add itm, albumArtist
    End If
    If title <> itm.title Then
      holdTitle.add itm, title
    End If
    If album <> "" And album <> itm.albumName Then
      holdAlbum.add itm, album
    End If
    If genre <> itm.genre Then
      holdGenre.add itm, genre
    End If
    If trackOrder <> itm.trackOrder Then
      holdTrackOrder.add itm, trackOrder
    End If
    
    doc.write "      </tr>" & vbcrlf
    
  next 'i
  
  doc.write "    </table>" & vbcrlf
  doc.write "  </body>" & vbcrlf
  doc.write "</html>" & vbcrlf
  doc.close
  SDB.Objects("holdArtist") = holdArtist
  SDB.Objects("holdAlbumArtist") = holdAlbumArtist
  SDB.Objects("holdAlbum") = holdAlbum
  SDB.Objects("holdTitle") = holdTitle
  SDB.Objects("holdGenre") = holdGenre
  SDB.Objects("holdTrackOrder") = holdTrackOrder
  
  Form.Common.Visible = True                ' Only show the form, don't wait for user input
End Sub
Last edited by Steegy on Mon Apr 03, 2006 8:43 am, edited 5 times in total.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

Code: Select all


'//////////////////////
'// ENHANCER METHODS //
'//////////////////////

Function ChangeCharacters(Tag)
	Tag = Replace(Tag, "_", " ", 1, -1, 1)
	Tag = Replace(Tag, "´", "'", 1, -1, 1)
	Tag = Replace(Tag, "`", "'", 1, -1, 1)
	
	ChangeCharacters = Tag
End Function


Function FixBrackets(Tag)
    Tag = Replace(Tag, "[", "(", 1, -1, 1)
    Tag = Replace(Tag, "]", ")", 1, -1, 1)
    Tag = Replace(Tag, "( ", "(", 1, -1, 1)
    Tag = Replace(Tag, " )", ")", 1, -1, 1)
    
	FixBrackets = Tag
End Function


Function FixCommonWords(Tag)
     Tag = ReplaceBadTagPortion(Tag, "featuring", "ft.")
     Tag = ReplaceBadTagPortion(Tag, "features", "ft.")
     Tag = ReplaceBadTagPortion(Tag, "feat", "ft.")
     Tag = ReplaceBadTagPortion(Tag, "feat.", "ft.")
     Tag = ReplaceBadTagPortion(Tag, "ft", "ft.")
     Tag = ReplaceBadTagPortion(Tag, "Ft.", "ft.")

     Tag = ReplaceBadTagPortion(Tag, "presenting", "pres.")
     Tag = ReplaceBadTagPortion(Tag, "presents", "pres.")
     Tag = ReplaceBadTagPortion(Tag, "pres", "pres.")
     Tag = ReplaceBadTagPortion(Tag, "Pres.", "pres.")

     Tag = ReplaceBadTagPortion(Tag, "versus", "vs.")
     Tag = ReplaceBadTagPortion(Tag, "vs", "vs.")
     Tag = ReplaceBadTagPortion(Tag, "Vs.", "vs.")
     
     Tag = ReplaceBadTagPortion(Tag, "dj", "DJ")
     
     Tag = ReplaceBadTagPortion(Tag, "Its", "It's")		'Good changes outweigh the bad ones (real "its")
     Tag = ReplaceBadTagPortion(Tag, "RMX", "Remix")
     
     Tag = ReplaceBadTagPortion(Tag, "dont", "don't")
     
     Tag = ReplaceBadTagPortion(Tag, "aint", "ain't")
     Tag = ReplaceBadTagPortion(Tag, "isnt", "isn't")
     Tag = ReplaceBadTagPortion(Tag, "cant", "can't")
     Tag = ReplaceBadTagPortion(Tag, "ill", "i'll")		'Good changes outweigh the bad ones (real "ill")
     Tag = ReplaceBadTagPortion(Tag, "wouldnt", "wouldn't")
     Tag = ReplaceBadTagPortion(Tag, "wouldve", "would've")
     Tag = ReplaceBadTagPortion(Tag, "shouldnt", "shouldn't")
     Tag = ReplaceBadTagPortion(Tag, "shouldve", "should've")
     
     FixCommonWords = Tag
End Function


Function FixWrongGenre(Tag)
	FixWrongGenre = Tag

    Tag = LCase(Tag)
	If Tag = "other" Or Tag = "unknown" Or Tag = "default" Or Tag = "genre" Or Tag = "misc" Then
		FixWrongGenre = ""
	End If
End Function




'/////////////////////////
'// HELPER FIX FUNCTION //
'/////////////////////////

Function ReplaceBadTagPortion(Tag, FromValue, ToValue)
  If InStr(1, Tag, FromValue, 1) = 1 Then
    Tag = Replace(Tag, FromValue & " ", ToValue & " ", 1, -1, 1)
    Tag = Replace(Tag, FromValue & ")", ToValue & ")", 1, -1, 1)
  End If
  If InStrRev(Tag, FromValue, -1, 1) = Len(Tag) - Len(FromValue) + 1 Then
    Tag = Replace(Tag, " " & FromValue, " " & ToValue, 1, -1, 1)
    Tag = Replace(Tag, "(" & FromValue, "(" & ToValue, 1, -1, 1)
  End If
  Tag = Replace(Tag, " " & FromValue & " ", " " & ToValue & " ", 1, -1, 1)
  Tag = Replace(Tag, "(" & FromValue & " ", "(" & ToValue & " ", 1, -1, 1)
  Tag = Replace(Tag, " " & FromValue & ")", " " & ToValue & ")", 1, -1, 1)
  Tag = Replace(Tag, "(" & FromValue & ")", "(" & ToValue & ")", 1, -1, 1)

  ReplaceBadTagPortion = Tag
End Function




'//////////////////
'// DECLARATIONS //
'//////////////////

Public holdArtist, holdAlbum, holdTitle, holdAlbumArtist, holdGenre, holdTrackOrder
Set holdArtist = CreateObject("Scripting.Dictionary")
Set holdAlbum = CreateObject("Scripting.Dictionary")
Set holdTitle = CreateObject("Scripting.Dictionary")
Set holdAlbumArtist = CreateObject("Scripting.Dictionary")
Set holdGenre = CreateObject("Scripting.Dictionary")
Set holdTrackOrder = CreateObject("Scripting.Dictionary")

Const mmAnchorRight = 4
Const mmAnchorBottom = 8
Const mmAlignTop = 1
Const mmAlignBottom = 2
Const mmAlignClient = 5
Const mmListDropdown = 2
Const mmFormScreenCenter = 4
Public styleOn




'//////////////////////////
'// FORM ACTION HANDLERS //
'//////////////////////////

Sub CloseDown
  Set holdAlbum = nothing
  Set holdAlbumArtist = nothing
  Set holdArtist = nothing
  Set holdTitle = nothing
  Set holdGenre = nothing
  Set holdTrackOrder = nothing
  SDB.Objects("PTEForm") = Nothing
  SDB.Objects("holdArtist") = Nothing
  SDB.Objects("holdAlbumArtist") = Nothing
  SDB.Objects("holdAlbum") = Nothing
  SDB.Objects("holdTitle") = Nothing
  SDB.Objects("holdGenre") = Nothing
  SDB.Objects("holdTrackOrder") = Nothing
End Sub


Sub OnCancel(Btn)
  CloseDown
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")
  Set holdGenre = SDB.Objects("holdGenre")
  Set holdTrackOrder = SDB.Objects("holdTrackOrder")

  
  Dim itm, str, sql
  Dim items, albumNames, artistNames
  Set items = CreateObject("Scripting.Dictionary")
  Set albumNames = CreateObject("Scripting.Dictionary")
  Set artistNames = CreateObject("Scripting.Dictionary")
  
  For Each itm In holdArtist
  
    str = holdArtist.item(itm)
    If Not items.exists(itm) Then
      items.add itm, itm
    End If
    itm.artistName = str
    If Not artistNames.exists(str) Then
      sql = "UPDATE Artists SET Artists.Artist = " & rdQS(str) & " WHERE Artists.Artist= " & rdQS(Itm.ArtistName)
      SDB.database.execSQL(sql)
      ' This will affect ALL instances of this artist, including album artist, and on other tracks.
      artistNames.add str, str
    End If
  Next 'itm
  
  For Each itm In holdAlbumArtist

    str = holdAlbumArtist.item(itm)
    If Not items.exists(itm) Then
      items.add itm, itm
    End If
    itm.albumArtistName = str
    If Not artistNames.exists(str) Then
      sql = "UPDATE Artists SET Artists.Artist = " & rdQS(str) & " WHERE Artists.Artist= " & rdQS(Itm.ArtistName)
      SDB.database.execSQL(sql)
      artistNames.add str, str
    End If
  Next 'itm
  
  For Each itm In holdAlbum

    str = holdAlbum.item(itm)
    If Not items.exists(itm) Then
      items.add itm, itm
    End If
    itm.albumName = str
    If Not albumNames.exists(str) Then
      sql = "UPDATE Albums SET Albums.Album = " & rdQS(str) & " WHERE Albums.Album= " & rdQS(Itm.AlbumName)
      SDB.database.execSQL(sql)
      ' This will affect ALL instances of this album, including other tracks.
      albumNames.add str, str
    End If
  Next 'itm
  
  For Each itm In holdTitle
    
    str = holdTitle.item(itm)
    If Not items.exists(itm) Then
      items.add itm, itm
    End If
    itm.title = str
  Next 'itm
  
  For Each itm In holdGenre
    
    str = holdGenre.item(itm)
    If Not items.exists(itm) Then
      items.add itm, itm
    End If
    itm.genre = str
  Next 'itm
  
  For Each itm In holdTrackOrder
  
    str = holdTrackOrder.item(itm)
    If Not items.exists(itm) Then
      items.add itm, itm
    End If
    itm.trackOrder = str
  Next 'itm
  
  
  
  
  Dim list
  Set list = SDB.NewSongList
  For Each itm In items
    list.Add(itm)
  Next
  
  list.UpdateAll
  
  Set items = nothing
  CloseDown
End Sub




'////////////////////////////////////
'// BASIC REPORT UTILITY FUNCTIONS //
'////////////////////////////////////

Function MapXML(original)
  Dim hold
  hold = Replace(original, "&", "&")
  hold = Replace(hold, "  ", "&nbsp; ")
  hold = Replace(hold, "<", "<")
  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
  MapXML = hold
End Function


Function MapField(fld)
  If fld="" Then
    MapField = "&nbsp;"
  Else
    MapField = MapXML(fld)
  End If
End Function


Function outField (fixed, normal)
  If fixed = normal Then
    outField = "<td>" & MapField(normal) & "</td>" & vbcrlf
  Else
    outField = "<td class=""highlight"" title=""" & SDB.Localize("Old Value: ") & Chr(13) & MapXML(normal) & """>" & MapField(fixed) & "</td>" & vbcrlf
  End If
End Function


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


Function rdQS(UnquotedString)
  rdQS = "'" & Replace(UnquotedString, "'", "''") & "'"
End Function
Add this to Scripts.ini:

Code: Select all

[PersonalTagEnhancer]
FileName=PersonalTagEnhancer.vbs
ProcName=PersonalTagEnhancer
Order=10
DisplayName=PersonalTagEnhancer
Description=PersonalTagEnhancer
Language=VBScript
ScriptType=0
If you have other personal enhancements that you would like to share, please do ...

Cheers
Steegy
Last edited by Steegy on Mon Apr 03, 2006 8:44 am, edited 2 times in total.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
onkel_enno
Posts: 2153
Joined: Fri Jan 14, 2005 1:45 am
Location: Germany
Contact:

Post by onkel_enno »

Hey Steegy,

great Script. Exactly what I need. Thank
A Progress bar would be fine. :)
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

Thanks.

I updated the script so it shows a progress bar while loading the preview/changes, and when done, it shows the form.
Unfortunately it was impossible to add a good progress indicator for the actual tagging of the tracks, because the part that takes time is one single MM command. So there's no iteration and so no progress bar.
It would be MediaMonkey's resposibility to provide a progress indicator for that.

@Devs:
A progress indicator for the SDBSongData.UpdateX commands would be nice.

For easy downloading, here's the script file (the same as posted above):
http://home.scarlet.be/ruben.castelein/ ... hancer.vbs
(For MediaMonkey's Scripts folder. Also needs an entry in Scripts.ini)

Cheers
Steegy

ADDITION (04/06/06): More help can be found here: http://www.mediamonkey.com/forum/viewto ... 2126#42126

ADDITION (28/10/06): Here's how to normalize text (remove accents and such): http://www.mediamonkey.com/forum/viewtopic.php?t=12949
Last edited by Steegy on Wed Dec 09, 2009 4:08 pm, edited 1 time in total.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Guest

Post by Guest »

Wow!
Thanks for this extraordinary usefull script!
Superfrodo
Posts: 29
Joined: Mon Apr 03, 2006 12:23 pm
Location: Netherlands

Post by Superfrodo »

Really thanks for this script.
I was thinking of creating the script for myself, but then I thought somebody else might have, and here you see...... :P
Made some adjustments for myself of course, but for the rest it's a super script!!!
Post Reply