Skip to main content
dublove
Legend
Sep 30, 2025 10:47 AM UTC
Question

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

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

Like this:

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

 

3 replies

dublove
dubloveAuthor
Legend
Sep 30, 2025 11:23 AM UTC

I've found the answer to this.
Thanks.

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

 

Translate
m1b
Community Expert
Community Expert
Oct 1, 2025 2:27 AM UTC

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

Translate
dublove
dubloveAuthor
Legend
Oct 2, 2025 12:46 PM UTC

@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.

Translate