Is there a way to dynamically retrieve all the possible variants of a globally defined object, such as Justification, from a script?
In other words, I want to enumerate all the values under Justification—such as Justification.LEFT, Justification.CENTER, Justification.RIGHT, etc.—into an array dynamically, instead of hardcoding all the variations myself.
I tried code like the example below, but it seems that each value does not actually exist in Illustrator until it is explicitly referenced in the source code.
var justificationArray = [] ;
for(var propName in Justification) {
justificationArray.push(propName) ;
}
alert(justificationArray) ;
Use case:
Addressing an issue where specified text attributes are ignored when their values match the default values of the character/paragraph styles applied to that text. For types of Object, plan to dynamically retrieve values, convert them to an Array, and generate different values by shifting the index.
Trouble assigning TextFrame to Justification.Left
Apply Character direction to textframe characters via Extendscript
Removing underline not working in Illustrator using Extendscript
"All Caps" option turn "ON" by default when (Java)scripting a textfield… Why? How to avoid?
... View more