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

Script for InDesign Book functions

Explorer ,
Dec 08, 2023 Dec 08, 2023

Copy link to clipboard

Copied

Hi!

We are setting up a solution on our InDesign 2022 Server that based on a large XML file with "Chapter" elements create an InDesign book with an InDesign document for each chapter.

We are using an IDML template as the base for this work.

The page nubers are updated automatically when for each document, but not the Paragraph numbers. All documents "restarts" at 1.

I'm using a numbering list called "Chapter" for all numbered paragraphs and I have three levels:
X
X.X
X.X.X
Each document can have 2 or more parts on the highest level = 1, 2, ...
So the next document shall start with 3 and so on.

But I have found no way to make this happening just by settings in the IDML template.

My next approach is a script. My intention is to use the "Update numbering/Update chapter and Paragraph numbering" function in the Book panel. But I can't find any info on how to access that by script.

 

I could really use some tips.
Regards/Jan

TOPICS
Scripting

Views

136

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 08, 2023 Dec 08, 2023

Copy link to clipboard

Copied

What you're after is

myBook.updateAllNumbers();

 

You can find it in any object-model viewer, e.g.

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

 

 

 

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 08, 2023 Dec 08, 2023

Copy link to clipboard

Copied

But I have found no way to make this happening just by settings in the IDML template.

 

Why use an IDML template? Doesn't that complicate things? Why not an InDesign template?

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 08, 2023 Dec 08, 2023

Copy link to clipboard

Copied

The supplier advised us on that. Maybe to make sure the template is less version dependent? Or to get rid of some settings? Honestly I don't know for sure.

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 08, 2023 Dec 08, 2023

Copy link to clipboard

Copied

But surely you're not trying to edit the IDML, or are you? You can at least open the file in InDesign, then get the numbering to ork on your local desktop. When things work the way you want them, move the workflow to ID Server. And I wouldn't use IDML. If you need to provide the file in an earlier version you can always export the IDML for that occasion. Using IDML just creates unnecessary overhead.

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 08, 2023 Dec 08, 2023

Copy link to clipboard

Copied

LATEST

Hi again, Peter.
No, we also have a Desktop solution so I'm doing all kinds of testing there before moving it to the server. That's why I'm trying to keep my script tests functional on the server as well by not using any UI related code.
I tested this a few minutes ago on a book on my Desktop and it did the trick:

var book = app.books[0];
book.updateChapterAndParagraphNumbers ();


So on Monday I'll ask our Server "Manager" to include it in the script we run on the server before closing the book.
And I see what you mean with the IDML. I have been a little frustrated by that to be honest. I'll talk to our external supplier about it as well.
Tnx Peter

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