Skip to main content
dublove
Legend
August 18, 2025
Answered

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

  • August 18, 2025
  • 1 reply
  • 230 views

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();  
}

 

Correct answer rob day

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;

1 reply

rob day
Community Expert
rob dayCommunity ExpertCorrect answer
Community Expert
August 18, 2025

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;
dublove
dubloveAuthor
Legend
August 18, 2025

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

brian_p_dts
Community Expert
Community Expert
August 18, 2025

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