Fixing ALL UPPERCASE

Any ideas about how to improve MediaMonkey for Windows 4? Let us know!

Moderator: Gurus

dastriebel
Posts: 6
Joined: Wed Nov 12, 2003 1:55 pm
Location: Switzerland

Fixing ALL UPPERCASE

Post by dastriebel »

Wow im working now with MM for about 2 month and its real great. But there is one thing im missing: A function to fix the TAG if it come's from FreeDB
IN ALL UPPER CASE
to
Lower Case With The First Letter Upper Case.

Thanks
AlanB

use a script.

Post by AlanB »

You can solve this problem with scripts.

I used the second script on http://www.mediamonkey.com/scripts.htm as a starting point. The script (.vbs file) shows how to work on selected files, it can read and write the title (and/or artist), it just needed some code adding to parse and case change the title string to get it to do the job. The documentation is also there for how to incorporate and activate the script in MediaMonkey (the .ini file), again quite simple to edit to provide your own script name. But do back up your database before testing any new scripts! (they can do a lot of damage quite easily).

If you cannot write the script yourself, I will try to find and post the script I write. It was very simple and didn't always get the case 100% correct on titles containing punctuation. But since there are not too many of that sort, it was easier to vet and modify manually if necessary.

Alan
jiri
Posts: 5427
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

Post by jiri »

I have just posted a script that handles automatic case conversions here: http://www.songs-db.com/forum/viewtopic.php?p=3471. Please check it out and let me know if there are any problems in it.

Jiri
AlanB

beat me to it

Post by AlanB »

Well I dug out my script, but I see that jiri has beaten me to it. I have to say I like the idea of keeping certain words in lower case. Mine was a much simple approach, i.e. anything at the start or following space, comma or ( was uppercase, the rest lower...

Function CapCase(in_string)

Dim index
Dim shift_next
Dim char
Dim out_string

shift_next = True
For index = 1 To Len(in_string)
char = Mid(in_string, index, 1)
If shift_next Then
char = UCase(char)
else
char = LCase(char)
End If

shift_next = (char = " ") Or (char = "(") Or (char = ",")

out_string = out_string + char
Next

CapCase = out_string

End Function

Sub CapCaseTitle
' Define variables
Dim list, itm, i, tmp, tmp1

' Get list of selected tracks from MediaMonkey
Set list = SDB.SelectedSongList
If list.count=0 Then
Set list = SDB.AllVisibleSongList
End If

' Process all selected tracks
For i=0 To list.count-1
Set itm = list.Item(i)

tmp = itm.Title
tmp1 = CapCase(tmp)
if tmp <> tmp1 then
itm.Title = tmp1
itm.UpdateDb
end if
Next
End Sub

With a script.ini insert like

[CapCaseTitle]
FileName=MyScripts.vbs
ProcName=CapCaseTitle
Order=2
DisplayName=CapCase &Title
Description=CapCase Title field
Language=VBScript
ScriptType=0

Obviously it is straght forward to modify for fields other than Title, or to do several fields at a time.

Alan
Post Reply