Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

[JS][CS3] Applying an Object Style

Participant ,
Sep 12, 2009 Sep 12, 2009

Hi.

This is a simple one, I am trying to apply an already made Object Style to a text frame.

I am using a similar method as used to apply a paragraph style:

myFrame.appliedObjectStyle.name= "GreenBox";

and also
myFrame.appliedObjectStyle= "GreenBox";

But these dont work.

I have researched the forums and found something like:

myFrame.applyObjectStyles(GreenBox , true);

and

myFrame.applyObjectStyles(GreenBox);

but these dont work either.

Can someone give me a hand with the correct syntax please?

Thanks in advance

Roy

TOPICS
Scripting
956
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 12, 2009 Sep 12, 2009

Roy Marshall wrote:

I have researched the forums and found something like:

myFrame.applyObjectStyles(GreenBox , true);

and

myFrame.applyObjectStyles(GreenBox);

but these dont work either.

the problem is in S after applyObjectStyle ... should be applyObjectStyle - without S at end

robin

www.adobescripts.co.uk

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 12, 2009 Sep 12, 2009

I have just answered this by finding another thread...

myFrame.applyObjectStyle(app.documents[0].objectStyles.item("GreenBox"), true);
I would like to know what the 'True' means though.
Any thoughts?
Cheers
Roy

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 13, 2009 Sep 13, 2009
LATEST

void applyObjectStyle (using: ObjectStyle[, clearingOverrides: bool=true][, clearingOverridesThroughRootObjectStyle: bool=false])
Applies the specified object style.

ParameterTypeDescription
usingObjectStyleThe object style to apply.
clearingOverridesboolIf true, clears the Button's existing attributes before applying the style. (Optional) (default: true) (Optional)
clearingOverridesThroughRootObjectStyleboolIf true, clears attributes and formatting applied to the Button that are not defined in the object style. (Optional) (default: false) (Optional)

-- so you can use one or even two trues; it's default is 'true'.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines