Capitalise First Word

Using Rename, if you tick Modify Capitalisations and choose Capitalise All Words, it will change the first letter of each word to upper case, as you would expect.

There is another option - Capitalise first word - which I would expect to simply change the first letter of the first word only to upper case.

What this option actually does, however, is to change all letters in all words to lowercase.

It seems to work here:


This is what I get


"08-12-2006" is the first word of that filename, as far as Opus is concerned. (Have a look at the first line in my example screenshot.)

A rename script could give you different behaviour if you need it to skip things like dates at the start of the filename.

I can understand that if it treats the number as the first word it will not capitalize it, but why does it change all subsequent words to lowercase? Is that the intention?

Yes.

Here's a simple rename script that just uppercases the first character and leaves the other characters as they were:

Option Explicit

Function Rename_GetNewName ( strFileName, strFilePath, _
		fIsFolder, strOldName, ByRef strNewName )
	strNewName = UCase(Left(strNewName,1)) & Right(strNewName,Len(strNewName)-1)
End Function


Thanks.

What would be really useful would be a script which Capitalised the first letter of every word except prepositions - i.e. every word except: for, from, and, to, of, by, or

The Titlecase rename script does that and a few other things.

Thank you for pointing me to that. I have had a look at Titlecase.

It looks as if it could be very useful but I have spotted a couple of things:

  1. The write up on the intial post is rather misleading - implying that it simply capitalises the first and last words when, as subsequently amended, it actually capitalises all words except prepositions - which is what most people would want: its is just the write-up which needs amending.

  2. Its list of prepositions omits the word "from" so that "from" actually gets capitalised.

  1. I'm not sure where you're getting that from but Titlecase, by definition, considers capitalising all words in a string (except prepositions etc.). From Wikipedia:

Title Case: All words are capitalised except for certain subsets defined by rules that are not universally standardised. The standardisation is only at the level of house styles and individual style manuals.

The example screenshot shows that happening, too.

(If you mean the 2nd post in the thread, that was someone asking how to make the script capitalise the last word no matter what, e.g. even if it is the word "the", and me providing a modification of the script to do that. It's not something the script in the root post will do as-is.)

  1. Scroll to the middle of the script and you can add/remove words there as you wish:


[quote="leo"]1. I'm not sure where you're getting that from but Titlecase, by definition, considers capitalising all words in a string (except prepositions etc.). From Wikipedia:

Title Case: All words are capitalised except for certain subsets defined by rules that are not universally standardised. The standardisation is only at the level of house styles and individual style manuals.

The example screenshot shows that happening, too.

(If you mean the 2nd post in the thread, that was someone asking how to make the script capitalise the last word no matter what, e.g. even if it is the word "the", and me providing a modification of the script to do that. It's not something the script in the root post will do as-is.)[/quote]

I see what you mean. The first post does say that it converts it to Title Case, so if you know what that means (which I didn't) then it is clear, I suppose.

Thank you. That is very useful.