2 rename scripts: Name cleanup (incl. unwanted/hidden Unicode chars) & Capitalize only ALLCAP WORDS

These 2 rename scripts do following respectively:

  • Replace/clean up names in files including some basic changes, such as normalizing spaces, various dash characters. It also replaces/removes some nasty Unicode characters, e.g. emotes in downloaded Youtube videos, Unicode characters which look like Latin characters e.g. Α (u0391) vs A or ο (u03bf) vs o which aren't easily detected, and few more. URIencoded strings such as %20, %2A, %3F are also replaced with their counterparts, except shell characters such as <>|:*?"/\ etc are automatically replaced with closest char e.g. * -> x, : -> ;, " -> ' or _ otherwise after the conversion to prevent unintended consequences. Nastiest of them all are the hidden Unicode characters such as the foo‎bar.txt example shows, where there's a hidden LTR char between foo & bar and you cannot find it with FAYT or search by entering foobar, or ΑΒΕΗΚΜΝΤΥον.txt by typing ABE (you can copy-paste the highlighted texts into VSC and see for yourself). You can also control all individual replacements, whereas the basic name replacement is performed last, so that quotes, multiple spaces, etc. can be normalized after other changes.

  • Change the casing of files, which might have random ALLCAPS in between, without having to affect the rest of the filename, e.g. My file withALLCAPS.string.txt can be converted to My file withAllcaps.string.txt. This cannot be achieved by using the standard Capitalize Words preset or alike. It also allows you to define the regexp for tokenization & ALLCAPS detection, a minimum width & ignore words in the UI.

I've been using these for quite a while, and see them as stable (except adding a few comments for this post). Import via Rename dialog and feel free to give feedback and/or adjust to your needs.

Cleanup.orp (12.6 KB)

Case - Capitalize only ALLCAP WORDS.orp (4.7 KB)

5 Likes