Skip to main content
January 16, 2012
Answered

How to change all text in a textframe to uppercase?

  • January 16, 2012
  • 1 reply
  • 1781 views

I am trying to change the text to uppercase and I found the changeCaseTo and CaseChangeType for textRanges but I can't get them to work...

Here is my code:

app.activeDocument.textFrames[0].textRange.changeCaseTo = CaseChangeType.UPPERCASE

This doesn't error out but it doesn't do what it's supposed either

Any ideas what I am doing wrong?

This topic has been closed for replies.
Correct answer CarlosCanto

changeCaseTo(type) is a function, use it like this

app.activeDocument.textFrames[0].textRange.changeCaseTo (CaseChangeType.UPPERCASE);

1 reply

CarlosCanto
Community Expert
CarlosCantoCommunity ExpertCorrect answer
Community Expert
January 16, 2012

changeCaseTo(type) is a function, use it like this

app.activeDocument.textFrames[0].textRange.changeCaseTo (CaseChangeType.UPPERCASE);

January 16, 2012

Thank you for the quick response!

The funny part is that I've tried that and it was returning an error saying that changeCaseTo is not a function... Now after restarting the machine all works fine!