forcing a field to lower case text

Is there a way to have a field only accept lower case text?

I have a field designated for a new short name for a selected user. SInce this MUST be lower case I would like to force the user to only input lower case. Is this possible? If not is there a way to convert the entered text to lower case easily? This would also have to detect and notify the user of this change.


Hi Dee,

my suggestion, connect an on changed handler to the text field

on changed theObject
	set content of theObject to do shell script "echo '" & (get content of theObject) & "' | tr A-Z a-z "
end changed

Using a shell script for something like this is completely unnecessary. The NSString class has built in support for changing the text field’s content to lowercase, and should be the first choice for this task.

My suggestion, is to use the ‘changed’ handler like this…

on changed theObject
	set content of theObject to (call method "lowercaseString" of ((content of theObject) as string))
end changed


Thanks, good to know