Specify fixed case words for Case Checker addon [#18292] [#18575]
Moderators: jiri, drakinite, Addon Administrators
-
- Posts: 47
- Joined: Tue Mar 23, 2010 9:11 pm
Specify fixed case words for Case Checker addon [#18292] [#18575]
When I was using MM4, the Case Checker addon allowed me to specify words that needed to be in a fixed case pattern, such as the name of the band SuidAkra. I currently don't see how I can do that with the Case Checker addon for MM5. Is it possible to do so, and if not, would it be possible to add that functionality in?
Dave F.
Re: Specify fixed case words for Case Checker addon
It is not in GUI now (was it? Which version of CaseChecker you use?), but you can open file Scripts\caseChecker\dialogs\dlgCaseChecker.js in some text editor (NotePad is enough) and add "SuidAkra" to forceCapString variable. I.e. now it begins and then it will be
I recommend to backup original file, so you can restore it, if something bad happens.
Code: Select all
var forceCapString = "AC|EBN|OZN|...
Code: Select all
var forceCapString = "SuidAkra|AC|EBN|OZN|...
Re: Specify fixed case words for Case Checker addon
The build in CaseChecker never allowed user customization in the the interface.
Although you can edit the script itself, any customization will be lost with every MediaMonkey update.
Although you can edit the script itself, any customization will be lost with every MediaMonkey update.
Download MediaMonkey | License
Help: Knowledge Base | MediaMonkey for Windows 5 | MediaMonkey for Android
Lowlander (MediaMonkey user since 2003)
Help: Knowledge Base | MediaMonkey for Windows 5 | MediaMonkey for Android
Lowlander (MediaMonkey user since 2003)
Re: Specify fixed case words for Case Checker addon
As it's a relatively simple but useful addition to allow custom capitalization, I've added and tracked it here: https://www.ventismedia.com/mantis/view.php?id=18292
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
I uploaded many addons to MM's addon page, but not all of those were created by me. "By drakinite, Submitted by drakinite" means I made it on my own time. "By Ventis Media, Inc., Submitted by drakinite" means it may have been made by me or another MediaMonkey developer, so instead of crediting/thanking me, please thank the team. You can still ask me for support on any of our addons.
-
- Posts: 5
- Joined: Sun Nov 21, 2021 6:03 pm
Re: Specify fixed case words for Case Checker addon [#18292]
Hi everybody, I have a similar question regarding a specific fixed case for an entire sentence.
In MM4 I tailored the old Case.vbs file to my needs: for example, if I wanted to lowercase all "del" but correctly show the name Lana Del Rey (with an uppercase "Del"), I added "del" to littleWordString and then added the following exception in the Function updateCase(s):
This way, only the "Del" inside the singer's name would be uppercase.
Is there a way to do such thing in MM5 dlgCaseChecker.js file as well?
In MM4 I tailored the old Case.vbs file to my needs: for example, if I wanted to lowercase all "del" but correctly show the name Lana Del Rey (with an uppercase "Del"), I added "del" to littleWordString and then added the following exception in the Function updateCase(s):
Code: Select all
If Instr(result,"Lana del Rey") Then result=Replace(result,"Lana del Rey", "Lana Del Rey")
Is there a way to do such thing in MM5 dlgCaseChecker.js file as well?
Re: Specify fixed case words for Case Checker addon [#18292]
I believe you can simply add "Lana Del Ray" to the custom string list in the dialog, and it'll work as expected. Make sure you're using a 5.0.2 beta build for the most recent version of Case Checker.
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
I uploaded many addons to MM's addon page, but not all of those were created by me. "By drakinite, Submitted by drakinite" means I made it on my own time. "By Ventis Media, Inc., Submitted by drakinite" means it may have been made by me or another MediaMonkey developer, so instead of crediting/thanking me, please thank the team. You can still ask me for support on any of our addons.
-
- Posts: 5
- Joined: Sun Nov 21, 2021 6:03 pm
Re: Specify fixed case words for Case Checker addon [#18292]
I've tried, but that's not the case. I'm using version 5.0.1.2433 but I don't think it's a stable version issue.
In MM4 I have the following script in the Case.vbs file:
Code: Select all
Function updateCase(s)
Dim currentWord, result, fixed, theChar, lastNonWordChars
Dim forceIndex
Dim i
currentWord = ""
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)
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
currentWord = ""
Else
lastNonWordChars = lastNonWordChars & theChar
End If
result = result & theChar
End If
Next 'i
If Len(currentWord) > 0 Then
result = result & fixUp(currentWord,lastNonWordChars,"")
End If
If Instr(result,"Lana del Rey") Then result=Replace(result,"Lana del Rey", "Lana Del Rey")
If Instr(result,"P!NK") Then result=Replace(result,"P!NK", "P!nk")
updateCase = result
End Function
In MM5, the function updateCase(s) block is the following:
Code: Select all
function updateCase(s) {
var fixed, theChar;
var forceIndex;
var currentWord = "";
var result = "";
var lastNonWordChars = "";
for (var i = 0; i < s.length; i++) {
theChar = s[i];
if (alphaNum.test(theChar)) {
currentWord = currentWord + theChar;
} else {
if (currentWord !== "") {
fixed = fixUp(currentWord, lastNonWordChars, theChar);
if (fixed.slice(-1) === theChar) { // handle stuff like w/
fixed = fixed.substring(0, fixed.length - 1);
lastNonWordChars = "";
} else {
lastNonWordChars = theChar;
}
result = result + fixed;
currentWord = "";
} else {
lastNonWordChars = lastNonWordChars + theChar;
}
result = result + theChar;
}
};
if (currentWord.length > 0) {
result = result + fixUp(currentWord, lastNonWordChars, "");
}
return result;
};
Re: Specify fixed case words for Case Checker addon [#18292]
In MediaMonkey 5.0.2 you can set it within the tool itself. This is why it was recommended, as 5.0.1 doesn't feature this.
Download MediaMonkey | License
Help: Knowledge Base | MediaMonkey for Windows 5 | MediaMonkey for Android
Lowlander (MediaMonkey user since 2003)
Help: Knowledge Base | MediaMonkey for Windows 5 | MediaMonkey for Android
Lowlander (MediaMonkey user since 2003)
-
- Posts: 5
- Joined: Sun Nov 21, 2021 6:03 pm
Re: Specify fixed case words for Case Checker addon [#18292]
Installed 5.0.2.2519, added both "Lana Del Rey" and "P!nk" to the "Recommended changes to capitalization - Update properties?" dialog box, clicked OK, but unfortunately nothing changed.
I think, the issue is really with the special charachters (eg. spaces, exclamation points, etc..).
Did you manage to succesfully add a custom string that includes a space and/or a special character that works for MM5?
If yes, could you please post the code from dlgCaseChecker.js?
Re: Specify fixed case words for Case Checker addon [#18292] [#18575]
Thanks - Looks like that was a bug. To be fixed as: https://www.ventismedia.com/mantis/view.php?id=18575vocikag991 wrote: ↑Mon Nov 22, 2021 7:25 pm Installed 5.0.2.2519, added both "Lana Del Rey" and "P!nk" to the "Recommended changes to capitalization - Update properties?" dialog box, clicked OK, but unfortunately nothing changed.
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
I uploaded many addons to MM's addon page, but not all of those were created by me. "By drakinite, Submitted by drakinite" means I made it on my own time. "By Ventis Media, Inc., Submitted by drakinite" means it may have been made by me or another MediaMonkey developer, so instead of crediting/thanking me, please thank the team. You can still ask me for support on any of our addons.
-
- Posts: 5
- Joined: Sun Nov 21, 2021 6:03 pm
Re: Specify fixed case words for Case Checker addon [#18292] [#18575]
Thanks! Now it works! Can you please let me know in which file the custom string list is located?drakinite wrote: ↑Mon Nov 22, 2021 10:07 pmThanks - Looks like that was a bug. To be fixed as: https://www.ventismedia.com/mantis/view.php?id=18575vocikag991 wrote: ↑Mon Nov 22, 2021 7:25 pm Installed 5.0.2.2519, added both "Lana Del Rey" and "P!nk" to the "Recommended changes to capitalization - Update properties?" dialog box, clicked OK, but unfortunately nothing changed.
Re: Specify fixed case words for Case Checker addon [#18292] [#18575]
The custom string list is saved in persistent.json (in your appdata folder). But you don't need to edit it. There's a full customization menu when you click the little gear in the top right.
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
I uploaded many addons to MM's addon page, but not all of those were created by me. "By drakinite, Submitted by drakinite" means I made it on my own time. "By Ventis Media, Inc., Submitted by drakinite" means it may have been made by me or another MediaMonkey developer, so instead of crediting/thanking me, please thank the team. You can still ask me for support on any of our addons.
-
- Posts: 5
- Joined: Sun Nov 21, 2021 6:03 pm
Re: Specify fixed case words for Case Checker addon [#18292] [#18575]
Thanks! I know there is the customization menu but I just wanted to know which files to save in case I should make a backup.
Re: Specify fixed case words for Case Checker addon [#18292] [#18575]
I see No problem.vocikag991 wrote: ↑Tue Nov 30, 2021 5:34 pm Thanks! I know there is the customization menu but I just wanted to know which files to save in case I should make a backup.
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
I uploaded many addons to MM's addon page, but not all of those were created by me. "By drakinite, Submitted by drakinite" means I made it on my own time. "By Ventis Media, Inc., Submitted by drakinite" means it may have been made by me or another MediaMonkey developer, so instead of crediting/thanking me, please thank the team. You can still ask me for support on any of our addons.