Access UPPERCASE setting by script in Illustrator

I need to read that option from TextFrame. Is there a way?
There's FontCapsOption in CharacterAttributes, but it seems it does different thing..
Thanks in advance.

I need to read that option from TextFrame. Is there a way?
There's FontCapsOption in CharacterAttributes, but it seems it does different thing..
Thanks in advance.
What you're looking for is the capitalization attribute.
alert(app.activeDocument.textFrames[0].textRange.characterAttributes.capitalization)
app.activeDocument.textFrames[0].textRange.characterAttributes.capitalization = FontCapsOption.ALLCAPS
alert(app.activeDocument.textFrames[0].textRange.characterAttributes.capitalization)
on a blank document, this sample code just targets the first text frame and changes the capitalization setting to all caps. All of the Font Cap options you mentioned are what are used here
FontCapsOption.ALLCAPS | All Caps |
FontCapsOption.ALLSMALLCAPS | All Smallcaps |
FontCapsOption.NORMALCAPS | Normal Caps |
FontCapsOption.SMALLCAPS | Small Caps |
EDIT:
Wanted to also add. The above is a display change to the text. The text may internally be set as "Lorem Ipsum" but changed to display setting as All Caps would display as "LOREM IPSUM" while maintaining the internal text as "Lorem Ipsum". To access the Change case functionality you can either do a heavier coding approach to change the text contents or use the executeMenuCommand to access those commands.
https://ten-artai.com/illustrator-ccver-22-menu-commands-list/
app.executeMenuCommand("UpperCase Change Case Item")
app.executeMenuCommand("LowerCase Change Case Item")
app.executeMenuCommand("Title Case Change Case Item")
app.executeMenuCommand("Sentence case Change Case Item")Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.