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

Clear overrides When apply object style

Explorer ,
Dec 05, 2019 Dec 05, 2019

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

558

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

}

Votes

Translate

Translate

Report

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