


spacefish wrote:OMG What a great script! I had a bunch of tracks I wanted to batch remove the leading zero from the track number thinking I'd never use the case fixer. Was I wrong! What a powerful tool. Thanks so much.
genegraham wrote:Bex,
I'd love to use this script, but when I try to install it I get stopped by a dialog box that says, "Installation Error."
I'm running Vista, and MM3 version 3.0.3.1140.
Any ideas?
Thanks!

drjboulder wrote:genegraham wrote:Bex,
I'd love to use this script, but when I try to install it I get stopped by a dialog box that says, "Installation Error."
I'm running Vista, and MM3 version 3.0.3.1140.
Any ideas?
Thanks!
Have you tried running the Monkey as administrator while installing?
Not logged in as admin, but by opening the Monkey by right clicking on the Monkey's .exe and choosing "Run As Administrator". The Double click the .MMIP file for this script.
MoDementia wrote:I would like to see and option for "the" in the little words list to ignore it if it is preceeded by
& The
and The
(Number) i.e. 2008 The

Function fixUp(s, prevChars, nextChar,prevWord)
Dim forceIndex, littleIndex, i
Dim capMe, allCaps, foreignPref
Dim upcased, littleUpped, forceUpped
littleWordList = LittleWords 'Split(SDB.IniFile.stringValue("CaseModify","littleWordString")," ")
forceCapList = ForceCasedWords 'Split(SDB.IniFile.stringValue("CaseModify","forceCapString")," ")
forceIndex = -1
littleIndex = -1
capMe = false
allCaps = false
upcased = UCase(s)
foreignPref = isForeignPref.test(s)
For i = 1 to UBound(forceCapList)
forceUpped = UCase(forceCapList(i))
If forceUpped = upcased Or forceUpped = upcased & nextChar Then
forceIndex = i
Exit For
End If
Next 'i
For i = 1 to UBound(littleWordList)
littleUpped = UCase(littleWordList(i))
If littleUpped = "THE" and (prevWord = "&" or prevWord = "AND" or IsNumeric(prevWord)) Then
Else
If littleUpped = upcased Or littleUpped = upcased & nextChar Then
littleIndex = i
Exit For
End If
End If
Next 'i
If forceIndex >= 0 Then
s = forceCapList(forceIndex)
Else
If Len(s) = 1 And nextChar = "." Then
' if it's a single character followed by a period (an initial), caps it
allCaps = True
ElseIf Not vowels.test(s) And Not cardinal.test(s) Then
' if it's all consonants, no vowels, and not a cardinal number, caps it
allCaps = True
ElseIf romanNumerals.test(s) And UCase(s) <> "MIX" And UCase(s) <> "MI" And UCase(s) <> "DI" Then
' if it's roman numerals (and not 'mix' or 'di' which are valid roman numerals), caps it
allCaps = True
ElseIf prevChars = "" Or (nextChar = "" And Not foreignPref) Then
'if it's the first or last word, cap it
capMe = True
ElseIf Not whiteSpace.test(prevChars) Or (nextChar <> "" And InStr(")}]",nextChar)) Then
' if it follows a punctuation mark (with or without spaces) or if it's before a close-bracket, cap it
capMe = True
ElseIf littleIndex < 0 And Not foreignPref Then
' if it's not on the 'little word' list, cap it
capMe = True
End If
If allCaps Then
s = UCase(s)
ElseIf capMe Then
s = uppercase(s)
Else
s = LCase(s)
End If
If isMc.Test(s) And Len(s) > 2 Then
' if it's Mc or O', cap the 3rd character (this assumes no names like McA)
s = Mid(s,1,2)&UCase(Mid(s,3,1))&LCase(Mid(s,4))
End If
If foreignPref Then
' if it's l', d' or dell', lowercase the first letter and uppercase the first letter after the apostrophe
Dim pos
pos = InStr(s,"'")
If pos < 1 Then
pos = InStr(s,"`")
End If
If pos > 0 And pos < Len(s) Then
s = Mid(s,1,pos)&UCase(Mid(s,pos+1,1))&LCase(Mid(s,pos+2))
End If
End If
End If
fixUp = s
End Function
Function updateCase(s)
Dim currentWord, result, fixed, theChar, lastNonWordChars, prevWord
Dim forceIndex
Dim i
currentWord = ""
prevWord = ""
result = ""
lastNonWordChars = ""
For i = 1 to Len(s)
theChar = Mid(s,i,1)
If alphaNum.test(theChar) Then
currentWord = currentWord & theChar
Else
If currentWord <> "" Then
fixed = fixUp(currentWord,lastNonWordChars,theChar,prevWord)
If Right(fixed,1) = theChar Then 'handle stuff like w/
fixed = Left(fixed,Len(fixed)-1)
lastNonWordChars = ""
Else
lastNonWordChars = theChar
End If
result = result & fixed
prevWord = Ucase(fixed)
currentWord = ""
Else
lastNonWordChars = lastNonWordChars & theChar
If theChar = "&" Then
prevWord = theChar
End If
End If
result = result & theChar
End If
Next 'i
If Len(currentWord) > 0 Then
result = result & fixUp(currentWord,lastNonWordChars,"",prevWord)
End If
updateCase = result
End Function
ElseIf prevChars = "" Or (nextChar = "" And Not foreignPref) Then
ElseIf prevChars = "" Then ' Or (nextChar = "" And Not foreignPref) Then
Users browsing this forum: Exabot [Bot] and 12 guests