Skip to main content
dublove
Legend
September 30, 2025
Question

How do I apply properties to the style of the a1 object under the AA group?

  • September 30, 2025
  • 1 reply
  • 121 views

I'm lost again, or perhaps I've forgotten.

Like this:

var enObjWidth = app.documents[0].objectStyleGroups.itemByName(AA).itemByName(a1).transformAttributeOptions.transformAttrWidth;

 

1 reply

dublove
dubloveAuthor
Legend
September 30, 2025

I've found the answer to this.
Thanks.

var reObjWidth = app.documents[0].objectStyleGroups.itemByName(AA).
    objectStyles.itemByName(a1).transformAttributeOptions.transformAttrWidth;

 

m1b
Community Expert
Community Expert
October 1, 2025

You should quote "AA" and "a1". Otherwise you must have those variables existing, eg. var AA = "AA", a1 = "a1";

dublove
dubloveAuthor
Legend
October 2, 2025

@m1b 

I just feel that the execution efficiency below is a bit low:

app.documents[0].objectStyleGroups.itemByName(“AA”).objectStyles.itemByName(“a1”)

No other issues were found.