This calculation should do it, but note its limitations:
Let ( FirstWord = Leftwords ( YourTable::YourTextField ; 1 ) ;
Proper ( FirstWord ) & " " & Lower ( Right ( YourTable::YourTextField ; Length ( YourTable::YourTextField ) - Length (FirstWord) )
This assumes that there's a single sentence in your text field and that no words other than the first word should be capitalized. This may not be the case if your sentence contains proper nouns.
I think that a script along this one could solve:
Set Field ["do not specify any field name here";
t = Middle ( Get ( ActiveFieldContents ) ; Get ( ActiveSelectionStart ) ; Get ( ActiveSelectionSize ) ) ;
Substitute ( Get ( ActiveFieldContents ) ; t ; Upper ( Left ( t ; 1 ) ) & Lower ( Right ( t ; Get ( ActiveSelectionSize ) - 1 ) ) )
Any selected text, after running the above script, will have the first letter capitalized and the rest in lower case.
Thanks for the responses,
I have tried the following calculation:
Let ( FirstWord = Leftwords ( Issues Tracking::Synopsis ; 1 ) ; Proper ( FirstWord ) & " " & Lower ( Right ( Issues Tracking::Synopsis ; Length ( Issues Tracking::Synopsis ) - Length ( FirstWord) ) )
and get an error message that there are too many "(" or ")"
Am I missing something?
I can't seem to get either calculation to work. Thanks for trying.
How doesn't it work? I tested my method to make sure it works before posting here so I know it works and Raybaudi's method should also work.
Describing how it fails for you might give us a clue that will get this up and working for you.
I am very new to this so please bear with me. I may be missing something very basic. When I put in the calculation and then run the script, all it does is moves the second word in the sentence over a space. I am doing this as an "Insert Calculated Result" script. I am selecting the sentence and then running the script.
I don't have the details of this worked out but here's a general algorithm. Since it starts as uppercase, skip the first character and leave it upper case. There are Loop controls in scripting. Start off by getting the length of the string and save it in a var. Set another var CharPointer to 2. Get the character at location CharPointer with one of the text functions. Test it if it's a period. If so set another var CapComing to 2. Set the character to lower case and replace the original (if it's a period or space or something doing lower case won't hurt). Inc the var that's the character pointer, test if it's reached string length. Repeat loop until string length is reached. While processing each char if CapComing is > 0 decrement. If it happens to be 1, that's the start of a new sentence (two chars after a period) so leave it be.
Don't use Insert Calculated Result. Instead, use Set Field. That may be the issue here.
You can also use this expression in a calculation field set to return text. That option leaves your original text unchanged, so it can be a useful way to compare the original to your reformatted text to see if it works the way you want before attempting to script it.