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

Paragraph Styles Reset to Base differs from file to file

New Here ,
Mar 19, 2019 Mar 19, 2019

I'm working on scripting changes to literally thousands of files, and I'm running into an inconsistency between the files that's causing problems for my scripts.

This is best show through an example:

I have two files - File 1 and File 2.

File 1
When I go to paragraph styles, and I "Reset to Base". That removes all the settings. So far so good. Now, when I look at the Drop Caps and Nested Styles tab, I see that the "Align Left Edge" is CHECKED. Here's what it looks like after "Reset to Base"

File 2

When I go to paragraph styles, and I "Reset to Base". That removes all the settings. So far so good. Now, when I look at the Drop Caps and Nested Styles tab, I see that the "Align Left Edge" is UNCHECKED. Here's what it looks like after "Reset to Base"

This inconsistency is creating problems in my scripts.

So, my questions are:
1. Why is the "Reset to Base" different from 1 file to another?
2. Is there a way to get "Reset to Base" consistent for any file that I open?

Any suggestions would be greatly appreciated.

Thanks,

Patrick

1.9K
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

correct answers 1 Correct answer

Community Expert , Mar 19, 2019 Mar 19, 2019

No paragraph style has also an inherited predefined style. Problem is, that in different versions of InDesign this no Paragraph Style was defined differently. So you can't rely on this one.

I strongly recommend to create an own p-base style and only base other file on that one.

Translate
Community Expert ,
Mar 19, 2019 Mar 19, 2019

I think you may be misunderstanding what "Reset to Base" does. It is not a hard reset to default settings.

Reset to Base returns the Paragraph Style to the original style it was based on.

So if the original Paragraph Style has an "Align Left Edge" setting, resetting the current style will keep it on.

Check the other PP styles in the affected document to see which one has "Align Left Edge" set.

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 ,
Mar 19, 2019 Mar 19, 2019

You can also check the General settings under your current style to see what other PP style it is based on. Screen Shot 2019-03-19 at 1.06.48 PM.png

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 ,
Mar 19, 2019 Mar 19, 2019

Thanks very much for the response. In all cases, the styles in question are based on [No Paragraph Styles].

So, another way to ask this would be to say, how can I get the [No Paragraph Style] consistent from 1 file to another?

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 ,
Mar 19, 2019 Mar 19, 2019

No paragraph style has also an inherited predefined style. Problem is, that in different versions of InDesign this no Paragraph Style was defined differently. So you can't rely on this one.

I strongly recommend to create an own p-base style and only base other file on that one.

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 ,
Mar 19, 2019 Mar 19, 2019

So, another way to ask this would be to say, how can I get the [No Paragraph Style] consistent from 1 file to another?

The [No Paragraph Style] style is not editable and it should be the same in all documents (Minion Pro, 12pt, auto leading, etc.).

If you Reset to Base when the base is [No Paragraph Style] you should get something like this where all of the changes made to [No Paragraph Style] under Style Settings are removed:

Screen Shot.png

Screen Shot 1.png

It would be possible to have different definitions for a style with the same name in different documents. In that case when you copy and paste from one doc to another, the destination definition is used. If you want the source definition, you would have to use the Load Styles command and choose the incoming definition.

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 ,
Mar 19, 2019 Mar 19, 2019

Any suggestions would be greatly appreciated.

Willie’s right if the files have been converted from earlier versions of InDesign the [No Paragraph Style] could have different specs.

With scripting you should be able to load styles from a single master file and use the incoming style definition. But you still wont be able to alter the root [No Paragraph 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
New Here ,
Mar 19, 2019 Mar 19, 2019

Willie and Rob,

Thanks so much. Your comments and guidance have showed me the way that I need to go.

You see, we're using a third-party plugin in InDesign to work with these files, and the plugin is throwing errors when a paragraph style doesn't match the original [No Paragraph Style] settings, but I didn't understand that completely until I saw your comments. We've been trying to script things to make changes to all the styles base on an assumption that the plugin was evaluating the values of certain properties like diacriticPosition and dropCapDetail. We were getting very inconsistent results, and couldn't figure it out.

It turns out that the plugin was simply comparing the values for these properties back to [No Paragraph Style], and if the two don't match, it was throwing an error. That's why things were so inconsistent, because different files have different values for the [No Paragraph Style] root style.

Now, using scripting, I can actually identify the root style, grab the value of these properties from that, and use those values to reset all other paragraph styles to match, and that has eliminated our error.

Interestingly, when I use scripts to address [No Paragraph Style], I'm finding that there are actually three styles in each document that carry that name, though they have different style ID's.

In any case, you guys rock! Thank you so much. My project can now get back on track. Good thing, too, because I've got about 3500 InDesign files that have to be adjusted, and so scripting was the only realistic way of doing this.

Much, much appreciation for you guys. Thank you.

Patrick

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 ,
Mar 20, 2019 Mar 20, 2019

patrickp43904048  wrote

…Interestingly, when I use scripts to address [No Paragraph Style], I'm finding that there are actually three styles in each document that carry that name, though they have different style ID's.…

Hi Patrick,

can you tell a bit more about this?

That is more than unusual.

There should be only one single paragraph style with the name "[No Paragraph Style]" with index 0 in the array of document.allParagraphStyles. However, this name could vary between different language versions of InDesign. In my German version the name is "[Kein Absatzformat]".

What is the history of the document telling about different versions of InDesign?
Or are there any entries that can trace back the origin of the document to MENA or CJK versions of InDesign?

Regards,
Uwe

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 ,
Mar 20, 2019 Mar 20, 2019

Guten Tag Uwe,

Thanks for the comment. It did seem unusual to me, too. Maybe best to illustrate with an example.

First, know that I'm fairly new to JS, so my JS code may not be the best.  However, here's an example from a file.


I used the following code to create a log file with the ID, Name, and three properties that have been giving us problems. HEre is a snapshot of the code I've used for the log, just so you've see what I did:

And here are the results in the Log file:

I've run this now, on a small subset of files (only about 5 so far), and I'm finding that the results are pretty consistent so far. Each file I've looked at has the same three styles with identical id's and names. I do feel like I'm missing something, because none of these have an id of "0" the way you suggest one should.

Unfortunately, I cannot tell you much about the history of the files. I can only tell you that there are thousands of them the have been provided to us from a client.

Any thoughts or tips would be greatly appreciated.

Danke schön,

Patrick

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 ,
Mar 20, 2019 Mar 20, 2019

If you are using ExtendScript Toolkit, which gets installed with ID, try using $.writeIn to get the results in the ESTK console. This lists all of the active doc’s pstyle names and IDs:

for(i = 0; i < app.activeDocument.paragraphStyles.length; i++){

    var pName = app.activeDocument.paragraphStyles.name;

    var pID = app.activeDocument.paragraphStyles.id;

   

    $.writeln("Name: " + pName + "   " + "ID: " + pID)

  

}

Screen Shot 3.png

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 ,
Mar 20, 2019 Mar 20, 2019

Also the loop in your code is looping thru all of the open documents and then overwriting the document name each time in your log. I think your log is showing [No Paragraph Style] from 3 different documents

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 ,
Mar 20, 2019 Mar 20, 2019

To get the result I think you are looking for you have to nest two loops, one for the documents and one for each doc's styles. Something like this:

//get all the open documents

for(i = 0; i < app.documents.length; i++){

    var d = app.documents;

    var dName = app.documents.name;

    $.writeln("\rDocName: " + dName + "\r")

   

    //get the document's styles

    for(j = 0; j < d.paragraphStyles.length; j++){

        var pName = d.paragraphStyles.name;

        var pID = d.paragraphStyles.id;

        $.writeln("Style Name: " + pName + "    Style ID"  + pID)

    }

}

Returns something like this in the console:

DocName: Untitled-2

Style Name: [No Paragraph Style]    Style ID136

Style Name: [Basic Paragraph]    Style ID140

Style Name: ID Default    Style ID143

Style Name: My New Style    Style ID271

DocName: Untitled-1

Style Name: [No Paragraph Style]    Style ID136

Style Name: [Basic Paragraph]    Style ID140

Style Name: ID Default    Style ID143

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 ,
Mar 20, 2019 Mar 20, 2019

Hi Rob,

the results of your $.writeln() logs in the JavaScript console of the ESTK are showing the same ID number for both documents. But that is because you are working with two new documents of the same InDesign installation. If we consider documents from different sources with perhaps different feature sets the ID numbers for e.g. [No Paragraph Style] could be different. However, the index numbers of [No Paragraph Style] would be always the same; always value 0 .

So, nothing unusual here.

Regards,
Uwe

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 ,
Mar 20, 2019 Mar 20, 2019

patrickp43904048  wrote

…none of these have an id of "0" the way you suggest one should. …

Hi Patrick,

id number and index number are totally different things. Two different properties of a paragraph style.

The id number value for [No Paragraph Style] could be different per document. That depends on the number of features loaded when InDesign starts. E.g. CS8 vs CC 2019. Or MENA version of CC 2019 vs International English version of CC 2019.

Regards,
Uwe

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

Uwe and Rob,

Thank you both so much. You've been very helpful. I very much appreciate it. As I said, I'm new to automating InDesign with Javascript, and I'm new to Javascript, too. I have more background with VB, for sure.

In any case, I appreciate the detailed and clear explanations, they've been very helpful. It's reassuring to know that there are people out there in the world with real expertise who are willing to help others learn.

So, I get the difference between index and ID number, and everything you've both said makes lots of sense. I'm just about to dive into it again, now. I think that this will have given me enough information to get through this specific issue. I'm sure there will be others, though, so I'm sure I'll be back before too long.

Thanks,

Patrick

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