Skip to main content
dublove
Legend
Aug 18, 2025 4:08 AM UTC
Answered

I only know the object style name. How can I get and modify the size options?

I only know the object style name. How can I get and modify the size options?
Something simpler.
My image object style name is mypic, and I want to modify its width.
mypic.transformAttributeOptions.transformAttrWidth = 60;
I want to reassign it to 80,

Something like this:

if(transformAttributeOptions.transformAttrWidth !=80){  
transformAttributeOptions.transformAttrWidth =80;  
abc();  
}  
else{  
aaa();  
}

 

rob day
rob dayCorrect answer
Community Expert
Aug 18, 2025 3:11 PM UTC

I only know the object style name.

 

Use itemByName

 

var os = app.activeDocument.objectStyles.itemByName("AA");
os.transformAttributeOptions.transformAttrWidth = 80;

or

app.activeDocument.objectStyles.itemByName("AA").transformAttributeOptions.transformAttrWidth = 80;

3 replies

rob day
Community Expert
rob dayCommunity ExpertCorrect answer
Community Expert
Aug 18, 2025 3:11 PM UTC

I only know the object style name.

 

Use itemByName

 

var os = app.activeDocument.objectStyles.itemByName("AA");
os.transformAttributeOptions.transformAttrWidth = 80;

or

app.activeDocument.objectStyles.itemByName("AA").transformAttributeOptions.transformAttrWidth = 80;
Translate
dublove
dubloveAuthor
Legend
Aug 18, 2025 3:47 PM UTC

Thank you very much.
Just as you said, I found this method.

Translate
brian_p_dts
Community Expert
Community Expert
Aug 18, 2025 5:27 PM UTC

Yes, because we showed this method in the other thread on this topic...

Translate