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

Collect paragraph overrides and store it in XMl file

Community Beginner ,
May 02, 2018 May 02, 2018

Copy link to clipboard

Copied

Hi Experts,

Is there any way to collect what are the things are manually altered (override) for all the paragraphs in all stories of a doc? And I would like to export the details with my XML as a comment or an processing instruction.

Thanks

pr

TOPICS
Scripting

Views

782

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 Beginner ,
May 03, 2018 May 03, 2018

Copy link to clipboard

Copied

Hi ACP/STAFFs,

Can someone please help me. The requirement be like the option we have in the style sheet pallet [+] (highlight style overrides, but I need these overrides as data)

Thanks

Pr

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
People's Champ ,
May 03, 2018 May 03, 2018

Copy link to clipboard

Copied

Hi Pr,

With InDesign's preflight, you can generate a list of all text that has paragraph-style overrides. I think it doesn't tell you what the specific overrides involved are, but you can generate a list of this info, showing the page number and the text in question.

If you need more info than that -- a list of what specific overrides are happening -- it would need to be scripted.

Feel free to get in touch for a quote.

Thanks,

Ariel

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 Beginner ,
May 03, 2018 May 03, 2018

Copy link to clipboard

Copied

Hi Ariel,

Thanks for the response. Yes I would like to keep the few overrides alone and would like to retain it. Like above/below space, tracking, and rules. Can you please help me write a script. A start up may help me here to build further steps.

Thanks

Pr

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
Guide ,
May 03, 2018 May 03, 2018

Copy link to clipboard

Copied

One approach could be to start off from an IDML export. InDesign scripting has methods to perform the unzip (unpackageUCF) or you unzip them from command line, and then you iterate files and strip off all other information, e.g. using ExtendScript XML processing or an external XSLT processor. The actual overrides are already separated by InDesign's IDML exporter, you just have to weed out all layout and style info.

Otherwise you have to iterate text style runs (the unit of subdivision with shared overrides) and find out the individual overrides one by one by comparing properties against the applied styles. I did something similar to tunnel overrides and styles into HTML attributes for a CMS roundtrip where the CMS pretended to be media neutral (marketing wise) and turned out to heavily prefer HTML. Took me a week or two to get the basics straight, but it never went into production. Add any more amount of time to discover and fight edge cases. E.g. Tabs? Line breaks to <br/>? Not every difference (comparing to the styles) is caused by an override, it could also be any run-in style (grep style, line style, dropcap etc.). How do you deal with anchored objects, bullets, text variables, generated image captions. Should pstyles or cstyles get mapped to tags. And so forth.

Dirk

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 Beginner ,
May 03, 2018 May 03, 2018

Copy link to clipboard

Copied

We thought like so, but in some cases, for the huge indesign documents with XML wont convert into IDML and quits frequently. And in other hand, removing all other standard attributes from XML will leads another round of work instead of picking them straight from the indesing. Thanks for you suggestions.

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 04, 2018 May 04, 2018

Copy link to clipboard

Copied

Hi,

Going through the entire list of possible changes would be a task, even just using the text Ranges as mentioned above, even in a simple document ( which based on the comment above you don't have) we are talking 1000's of entries to check, to this end I have some questions which might make this more managable.

1 - Are there specific overrides that you need to check or is it any override ? ( you mentioned some above but I don't know if that is the complete list)

2 - Do you need to know which paragraph style they override ? (odd question I know, and you probably do)

3 - is it possible to split the InDesign documents? then you could use IDML output

4 - How many paragraph styles are there? a rough number would be useful

Regards

Malcolm

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 Beginner ,
May 04, 2018 May 04, 2018

Copy link to clipboard

Copied

Hi Malcom,

1. Yes these are the only items I need to collect.

2. Not necessarily needed.

3. In it has the XML, then I may end up with parsing errors and my customer needs it as single XML component.

4. As we are using STD design there are 100+ style in doc.

And just to know, irrespective of the style counts and the content weight  (number of paragraph/stories) and overridden items, indesign option [+] in style sheet will reflect it in milliseconds, how does Adobe developers achieving it?

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 04, 2018 May 04, 2018

Copy link to clipboard

Copied

Hi,

You might be able to find out some of them by using code like this, don't have time right now to right it for all the settings but here it is for tracking. (not tested properly)

var myTrackingString = app.activeDocument.paragraphStyles.everyItem().tracking.toString();

var myTextRanges = app.activeDocument.textFrames.everyItem().textStyleRanges.everyItem().tracking;

for ( var i = 0; i < myTextRanges.length; i++)

{

    if ( myTrackingString.indexOf ( myTextRanges) === -1 )

    {

        // we have overridden tracking

          // could just call myTextRanges.appliedParagraphStyle to get name of style.

     }

}

Pro - really fast

Con - don't really know which style was overridden, but could be used to know that you have an overridden style and then you could do more expensive coding to find out which one if required. (edit, as I realised we could just ask the text range for it style to find out what was over-ridden)

Hope this helps

Malcolm

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 05, 2018 May 05, 2018

Copy link to clipboard

Copied

LATEST

The more I think about it, the more I see the pitfalls of my proposed solution, so I don't think it would be suitable, too many overrides could slip through the gaps.

The only option (in JavaScript) that I can see is to iterate of each textStyleRange, and check if it is overridden and then check the values you care about are overridden or not. (if I get a chance later I will add a code sample of this)

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
Guide ,
May 04, 2018 May 04, 2018

Copy link to clipboard

Copied

> how does Adobe developers achieving it?

There are other technologies than scripting. For example I have a plugin that can tell you the originating style (even nested styles) for every attribute, or whether it is an override. Unfortunately I have neglected that pet project for years beyond occasional recompile of a Mac version (still no CC icons - to tell its age ...) for own use, and it is strictly visual (typical palette tree view, following the selection) so adding scriptability or a specialized XML export would be a week. Don't even ask about Windows.

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