Thanks — good idea.
Suggested checkbox behavior (what to add to Case ? Title / Title Enhanced / Sentence)
- Checkbox label: Preserve words with mid-word caps (or Preserve words with mid-word capitals/non-alpha)
- Semantics: When checked, the Case operation should skip (leave unchanged) any word that meets either condition:
1. The word contains an uppercase letter at any position other than the first character (i.e., /[A-Z]/ in word.slice(1)), OR
2. The word contains any non-alphabetic character (digits, punctuation) anywhere (i.e., /[^A-Za-z]/).
- Interaction:
- Applies only to Title, Title Enhanced and Sentence modes.
- Skipped words are not modified at all (no lowercasing, no Title Enhanced exceptions).
- Words that do not meet the test are treated normally by the chosen case mode (including Title Enhanced rules/exceptions).
- Rationale / examples:
- "iPhone" ? preserved (mid-word cap). "FBI" ? preserved (all caps contains mid-word cap by rule 1 or could be treated with <ic>).
- "PowerPoint" preserved; normal words like "agent" -> "Agent".
Workaround you can use now (JavaScript renaming)If you want this behavior immediately you can use the integrated JavaScript renamer. Paste this script into the JavaScript Renaming dialog (Special ? Javascript) and run it. It Title-cases words but preserves words having internal uppercase letters or any non-alpha characters:
- Code: Select all
// Preserve mid-word caps or non-alpha while Title-casing other words
(function(){
// work on the base name (no extension)
var s = name;
// split but keep separators (spaces, tabs). Adjust separator regex if you want to include punctuation as separators.
var parts = s.split(/(\s+)/);
for (var i = 0; i < parts.length; ++i) {
var w = parts[i];
// only transform real words (skip whitespace)
if (!w || /^\s+$/.test(w)) continue;
// if word contains any non-alpha or contains Uppercase beyond first char -> preserve
var hasNonAlpha = /[^A-Za-z]/.test(w);
var hasMidCap = /[A-Z]/.test(w.slice(1));
if (hasNonAlpha || hasMidCap) {
// leave as-is
continue;
}
// else Title-case the word (first char upper, rest lower)
parts[i] = w.charAt(0).toUpperCase() + w.slice(1).toLowerCase();
}
newName = parts.join("");
})();