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

How to find Overridden ParagraphStyle contents in a doc?

Contributor ,
May 11, 2023 May 11, 2023

Copy link to clipboard

Copied

Trying to log  overridden ParagaphStyle content aand its style name in a doc and need the same for characterStyle override also!

TOPICS
How to , Scripting

Views

237

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

correct answers 1 Correct answer

Contributor , May 11, 2023 May 11, 2023

I tried this way, I'm able get paragraphStyle Override Name and its contents,

var myDoc = app.activeDocument;
var paraStyle = myDoc.allParagraphStyles;
var myStory = myDoc.stories;
     for (s = 0; s < myStory.length; s++) {
            for (p = 0; p < myStory[s].paragraphs.length; p++) {
                var story_para = myStory[s].paragraphs[p];
                if(story_para.styleOverridden == true){
                      var wordContent=  story_para.contents;
                      var pageNo= s
...

Votes

Translate

Translate
Contributor ,
May 11, 2023 May 11, 2023

Copy link to clipboard

Copied

I tried this way, I'm able get paragraphStyle Override Name and its contents,

var myDoc = app.activeDocument;
var paraStyle = myDoc.allParagraphStyles;
var myStory = myDoc.stories;
     for (s = 0; s < myStory.length; s++) {
            for (p = 0; p < myStory[s].paragraphs.length; p++) {
                var story_para = myStory[s].paragraphs[p];
                if(story_para.styleOverridden == true){
                      var wordContent=  story_para.contents;
                      var pageNo= story_para.parentTextFrames[0].parentPage.name;
                      var phStyleName=  story_para.appliedParagraphStyle.name;
                     $.writeln("Overridden content: " + story_para.contents+"; pgNo: " +pageNo +"; 
 ParaStyleName:"+ phStyleName);
                }
            }       
        }

But i tried the same way to get Overridden characterStyles and its contents but i don't get any similar property  "styleOverridden". If any other way available to get Overridden characterStyle contents please let me know!

 

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 ,
May 11, 2023 May 11, 2023

Copy link to clipboard

Copied

LATEST

Have you tried inspecting each character's styleOverridden property rather than paragraph?

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