Remove Initial Blanks in the Title

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

Moderators: Peke, Gurus

arcspin
Posts: 48
Joined: Wed Nov 22, 2006 3:12 pm

Remove Initial Blanks in the Title

Post by arcspin »

Hey all,
I have noticed that I have a fair amount of song where the title starts with a blank.

I was woundering if you have a nice little script that delites the first blank letter in the title ???


Cheers,
//Peter
psyXonova
Posts: 785
Joined: Fri May 20, 2005 3:57 am
Location: Nicosia, Cyprus
Contact:

Post by psyXonova »

This will remove all leading and trailing spaces from the titles of the currently selected songs
Depending on how many songs you run it, it will take some time

here it is

Code: Select all

'==========================================================================
' Save this file as removeBlanks.vbs in your scripts folder.
' Add the following lines to scripts.ini (without the ')
'
'[RemoveBlanks]
'FileName=RemoveBlanks.vbs
'ProcName=RemoveBlanks
'DisplayName=Remove Blanks from Title
'Order=1
'Language=VBScript
'ScriptType=0
'
'==========================================================================


Sub RemoveBlanks
  ' Define variables
  Dim list, itm, i, OriginalTitle, NewTitle

  ' 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)
	OriginalTitle = itm.Title
	NewTitle = Trim(OriginalTitle)

	itm.Title = NewTitle
  Next
  ' Write all back to DB and update tags
  list.UpdateAll
End Sub
Hope this helps
arcspin
Posts: 48
Joined: Wed Nov 22, 2006 3:12 pm

Thank you

Post by arcspin »

Thank you for the quick response and thank you for the script.
Everything works out just fine !

This is for sure the best and versitile mediaplayer / organizer out there


Cheers and have a wounderfull weekend

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

Post by psyXonova »

Glad I helped...
Have a nice weekend as well :lol:
stylewyse
Posts: 9
Joined: Tue Dec 05, 2006 5:11 am

Post by stylewyse »

Could you be so kind as to tell me how to remove characters (from the start) of the file? (if it's also in your tags obviously, else i could've simply overwritten them)

I'm sure it's simple, but in the help files it's always about KEEPING a number of characters from the left, or inate keeping a FIXED number of characters from the right, both which are not an option. (and although i could've probably removed it by hand with all the time i wasted looking in all the wrong places, it's the principal of not fixing about 75 files by hand if it can be automated :))
sommo

Post by sommo »

Could this be maded into MM3?

Also
What about the same with Track Title, Album Name, Album Artist,Artist?

Thanks!
RedX
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Post by RedX »

sommo wrote:Could this be maded into MM3?

Also
What about the same with Track Title, Album Name, Album Artist,Artist?

Thanks!
Have you tried it in MM3 the way i see it it should work as it is since it doesn"t use any sql.

Regards,
red
sommo

Post by sommo »

Ma bad! (I meant a installer)
But it works :P
Post Reply