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

Script for InDesign Book functions

Explorer ,
Dec 08, 2023 Dec 08, 2023

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

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

 

 

 

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

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?

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

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.

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

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.

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

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