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

create object style based on another object style

New Here ,
Dec 20, 2017 Dec 20, 2017

In scripting when I create a new object style based on another object style the result is the new object style don't match with the properties of the based on object style.

Is it possible to reset all properties to the based on object style properties obviously with script?

TOPICS
Scripting
786
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 ,
Dec 20, 2017 Dec 20, 2017

Can you show your code?

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
New Here ,
Dec 20, 2017 Dec 20, 2017

I'm using apple script but you can answer also with java

the simple code is:

tell application "Adobe InDesign CC 2018"

    set DOC to document 1

    tell DOC

        tell object style group "FIGURE"

            make object style with properties {name:"NewStyle", based on:object style "FIG-L---D"}

        end tell

    end tell

end tell

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
Engaged ,
Mar 02, 2019 Mar 02, 2019
LATEST

I think you have to explicitly specify the attributes of each object style you create, as well specifying which styles are based on another style. Then changes to a basic object style will propagate to any object styles based on it. For example, using JavaScript, the inset spacing and paragraph style of the second style below (myObjectStyleO) change automatically when changes are made to the first style (myBasicObjectStyle):

myBasicObjectStyle = myDocument.objectStyles.add({name:"Red", fillColor:"RD", gradientFillAngle:0, strokeWeight:0, enableParagraphStyle:true, appliedParagraphStyle:"Numbers", enableTextFrameGeneralOptions:true});

myBasicObjectStyle.textFramePreferences.insetSpacing = [1,0,0,0];

myObjectStyleO = myDocument.objectStyles.add({name:"Orange", basedOn:myBasicObjectStyle, fillColor:"OD", gradientFillAngle:0, strokeWeight:0, enableParagraphStyle:true, appliedParagraphStyle:"Numbers", enableTextFrameGeneralOptions:true});

myObjectStyleO.textFramePreferences.insetSpacing = [1,0,0,0];

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