script to remove comma...need help

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

Moderators: Peke, Gurus

djsontap

script to remove comma...need help

Post by djsontap »

OK... i have alot of songs that the artist is in the form of

Lastname, first name

i would like to change it too

first name last name

i would like a little help on making a script that would do this.

Thank you
psyXonova
Posts: 785
Joined: Fri May 20, 2005 3:57 am
Location: Nicosia, Cyprus
Contact:

Post by psyXonova »

Ok, here it is...
paste this at the end of the scripts.ini

Code: Select all

[RemoveComma]
FileName=RemoveComma.vbs
ProcName=RemoveComma
Order=30
DisplayName=&Remove Comma
Description=Remove Comma
Language=VBScript
ScriptType=0
paste this inside a new txt file name it removecomma.vbs and save it inside the scripts folder

Code: Select all

'==========================================================================
'
' NAME: remove comma
'
' AUTHOR: psyXonova
' DATE  : 30/10/2005
'
' COMMENT: 
'==========================================================================


Sub RemoveComma
  ' Define variables
  Dim list, itm, i, OriginalArtist, LastName, FirstName, commaposition

  ' Get list of selected tracks from MediaMonkey
  Set list = SDB.CurrentSongList

  ' Process all selected tracks
  For i=0 To list.count-1
    Set itm = list.Item(i)
	OriginalArtist = itm.ArtistName
	commaposition = InStrRev(OriginalArtist, ",")
	FirstName = Mid(OriginalArtist, commaposition+2)
	LastName = Left(OriginalArtist, commaposition-1)
	itm.artistname = FirstName & " " & LastName

  Next
  ' Write all back to DB and update tags
  list.UpdateAll
End Sub
Select the files you want and run the script....
Post Reply