Case conversion...

Thanks, I'll have a look at this and see how it works.

Apologies for the thread bump.

I came across this thread while researching ways to batch fix the titles of my music files. I actually followed a link in the comments of another site whose script I'd already tried which worked well for everything except the filename. It looks like, while this script is well put together and may be helpful, it doesn't fix the issue I'm having.

I always included a space between the track number and the rest of the title in the filename and using these scripts will convert many words to lowercase when I don't want them to e.g. "01 the End". I want to know is there any way to fix this, or is it something I'm just going to have to deal with else be forced to add in another character?

Also, that lightning bolt character for ACϞDC is excellent. I've already edited the two ACϞDC songs I had to include that over a "/".

Do not apply the script to the _FILENAME.
Or:
Update the filename after you have updated the fields with either another action or the converter Tag-Filename.

So there's no way to code something to account for this then, I take it?

Edit: Another point about the scripts. I've noticed that it doesn't seem to alter the capitalisation for some words that other sources suggest it should.

For example "Born to Run" is what wikipedia suggests the song name should be written like, but the filename and tag scripts make it "Born To Run". I'm not an expert on capitalisation rules, but which ought to be right?

:slight_smile: Glad to assist!

There is disagreement on the case of "to" in an infinitive. Some say that it should be capitalised, and in my opinion it often looks better that way in song titles. That's why my scripts include optional sections to force "to" to upper-case before certain common verbs. You can disable those sections, if you wish.

However, all sources agree that when "to" is used as a adverb, it should be "To" in titles. This is one of many situations where capitalisation by script can never be 100% reliable. Mp3tag scripts cannot analyse parts of speech and so cannot detect how a word is being used, which is what would be needed. Therefore, you will always need to make corrections manually after running the scripts.

In the end, these are usage conventions, not rules, so read up on them and make your own decisions.

N/m

How fix 'On' with 'feat' converted to lowercase?
e.g. Still Holding on feat. Aruna (Mike Shiver Remix)

In which direction should the case be converted? is this the favoured result or is it the error situation?
Anyway: as language is not logical and not formal you have to create a replace action to deal with this string.

If you are asking about my scripts, they do not distinguish between "on" used as a preposition (should be lowercase in titles) and "on" used as an adverb or an adjective (should be uppercase in titles). Unfortunately, scripts cannot recognize parts of speech. Here are the workarounds that I know about:

• You could put only the song title in the Title tag. That would fix your example because my script always capitalizes the last word in a title. You would put everything following "on" in another tag, for example in a Comment. That is what I do to prevent text following a title from causing a problem.

• As ohrenkino suggested, you could create a simple Replace action for "on" (case-sensitive) and apply it only to title tags that have the problem. The tricky part is creating a filter to group those titles before applying the action, as you will want to exclude those that don't need to be changed.

• You could simply edit the offending titles by hand. It is not possible to create capitalization scripts that avoid all editing by hand.

Doug Mackie

ohrenkino
Doug Mackie
Thanks, this error appears on many import tracks from iTunes.

I would replace it with:

\b(\l)\s(&)\s(\l)\b

As it currently ignores ÄÖÜÕÅÆØ :rolleyes:

Good point.

Here is a small test to visualize the problem ...

Mp3tag function $regexp() ... test for special characters:

TEST <== 'ä ö ü ß Ä Ö Ü â ê î ô û Â Ê Î Ô Û Õ õ'

$regexp(%TEST%,'[a-zA-Z]',)
	'ä ö ü ß Ä Ö Ü â ê î ô û Â Ê Î Ô Û Õ õ'

$regexp(%TEST%,'[a-zA-Zäöüß]',)
	'    Ä Ö Ü â ê î ô û Â Ê Î Ô Û Õ õ'

$regexp(%TEST%,'[[:lower:]]',)
$regexp(%TEST%,'\l',)
	'    Ä Ö Ü      Â Ê Î Ô Û Õ '

$regexp(%TEST%,'[[:upper:]]',)
$regexp(%TEST%,'\u',)
	'ä ö ü ß    â ê î ô û       õ'

$regexp(%TEST%,'[^[:lower:]]',)
$regexp(%TEST%,'[^\l]',)
$regexp(%TEST%,'\L',)
	'äöüßâêîôûõ'

$regexp(%TEST%,'[^[:upper:]]',)
$regexp(%TEST%,'[^\u]',)
$regexp(%TEST%,'\U',)
	'ÄÖÜÂÊÎÔÛÕ'

DD.20150720.1125.CEST

Hi. I tried the above quoted reg. exp. on an album to capitalize the first letter of each word. It worked for some tracks, but not for others.For example;
H.M.S. Pinafore: Act I. “We sail the ocean blue” (Sailors), became
H.M.S. Pinafore: Act I. "We Sail The Ocean Blue (Sailors), which is what I want.
However; H.M.S. Pinafore: Act I. “Hail, men-o’-war’s men” (Buttercup), became,
"H.M.S. Pinafore: Act I. “Hail
Any idea why this happens?
Prior to trying this, I simply used the installed case conversion action and this worked for capitalising after quotes. Now however case conversion capitalises the first letter of each word except the first word. Also replacing quote marks with double apostrophes with a simple replace nolonger works.
Any help would be gratefully received.
Regards,
embra 55

The simple advice: don't do it to _ALL but only to specific fields.
And for those you can use an action of the type Format value.
I would guess that only English tracks and there only the fields TITLE and ALBUM would be cut out for such an action.
Even ARTIST would not be a good idea as Amy MacDonald and Paul McCartney would disapprove as they would appear as Amy Macdonald and Paul Mccartney after the conversion.

Interesting script. Is there a reason you recommend running the directory action first before the combined tag and filename actions? Why can't they be run as part of one overall action file?

In relation to the first word not being capitalised following a number, is there a way to avoid this occurring and to ensure the first word after a number does get capitalised?7

One of the problems I have been having with a script that functions in a similar way is getting it to behave by capitalising the first word after a round open bracket and including several exceptions to this capitalisation rule like not adding a capital if it includes the word 'feat., 'ft.' or 'features '.

[#0]
T=1
F=_TAG
1=1
2=

[#1]
T=4
F=_TAG
1=\b(A|An|The|And|But|Or|So|After|Before|Out|When|While|Since|Until|Although|Even If|Because|About|Above|Across|Against|Along|Alongside|As|At|Below|By|During|For|From|In|Into|Of|Off|On|Onto|Over|Than|Through|Till|To|Under|Up|With|Within|Without)\b
2=$lower($1)
3=0

[#2]
T=4
F=_TAG
1=^\s*(\w+)
2=$caps($1)
3=0

[#3]
T=4
F=_TAG
1=(\w+)\s*$
2=$caps($1)
3=0

[#4]
T=1
F=_FILENAME
1=1
2=

This is a script that I have slightly modified based on someone within these forums and I can't even pretend to understand how it works although I would appreciate enlightenment.

@sheepdisease
Do you really have to add your problem to multiple threads?
If someone understand what you need and has a solution, you will read it.
So please stop filling every other thread with the same question. Thanks.

I am not copying the original question to any other thread. When someone points me to another thread for reference I am looking and trying to understand how it works.

This is a rather comprehensive script which I have asked specific questions about and would appreciate a reply from the author or someone else who knows how it works with information relating to it and how it could be modified to deal with a change from square brackets to round brackets.

Referring to Grammartron:

This seems to work well on the title and other tags but the directory action does not seem to do anything with regards to removing full caps. Can anyone see what the problem is?

I think that for Filenames (and folder names) you actually have to change something like add an underscore and remove it afterwards so that Windows actually changes the case.

What I wonder: why do you go through such an ordeal of actions (which are hardly to maintain) instead of simply renaming the directory based on the tags? I mean: if the tags have the correct case, why not recycle that and simply transfer spelling and case to the filename and the folder name?