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

Clear overrides When apply object style

Explorer ,
Dec 05, 2019 Dec 05, 2019

I needs to check the property before apply the object style. please advice

TOPICS
Scripting
717
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 05, 2019 Dec 05, 2019

Did you look into the methods

undefined clearObjectStyleOverrides ()

and

undefined applyObjectStyle (using:ObjectStyle, [clearingOverrides:Boolean=Boolean], [clearingOverridesThroughRootObjectStyle:Boolean=Boolean])

 

Look at the method details from the following link

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#PageItem.html#d1e208048__d1e209699

 

-Manan

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
Explorer ,
Dec 05, 2019 Dec 05, 2019

clearingOverridesThroughRootObjectStyle. Am not clear how do i use this method when i apply object style

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 05, 2019 Dec 05, 2019
LATEST

Many objects/pageItems have the property "overridden". So, you can check if the object is overridden before applying an override. This line of code below checks if a pageItem has been overridden, and if it hasn't, it overrides it.  

 

if ( !pageItem.overidden ) {

    pageItem.applyObjectStyle("Style to Apply", 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