Skip to main content
Participating Frequently
April 16, 2024
Answered

Is it possible to merge sections within one document?

  • April 16, 2024
  • 3 replies
  • 1645 views

Hello, I currently use a check-in/check-out plugin system at work for pages of documents. When I check out multiple pages of the same document, they each come in as a separate section of a single document. I need to merge them so the pages are all one section. Is this possible to do other than clicking each page individually in the Pages panel? Some documents have quite a few pages!

 

Thanks!

This topic has been closed for replies.
Correct answer Peter Kahrel

That seems to have fixed the sections, but not marrying the spreads I'm afraid. There may just be no way to do it easily.


Ah! If you had mentioned marriage earlier I would have made a different proposal!

 

Here's an updated script, it incorporates what Robert suggested about document and spread shuffling:

 

s = app.documents[0].sections.everyItem().getElements();
for (i = s.length-1; i > 0; i--) {
  s[i].remove();
}

app.documents[0].documentPreferences.allowPageShuffle = true;
app.documents[0].spreads.everyItem().allowPageShuffle = true;

3 replies

Peter Kahrel
Community Expert
Community Expert
April 17, 2024

To merge a document's sections, remove all sections after the first one. This doesn't remove any pages, just the section settings:

s = app.documents[0].sections.everyItem().getElements();
for (i = s.length-1; i > 0; i--) {
  s[i].remove();
}
Joanna101Author
Participating Frequently
April 17, 2024

Thank you! I'm not sure how to use that code though. Is there a way to do this in the menus? Sorry I'm not sure I have the privileges to do this.

Peter Kahrel
Community Expert
Community Expert
April 17, 2024

In the menus you'll have to use the method you mentioned: click a page in the Pages panel and undo the section in the 'Numbering and Sections Options' window.

 

The code is a script. You can save it as a plain-text file, using the .jsx file type. Then copy it to your Scripts Panel folder. To find that, open the Scripts panel (Window > Utilities > Scripts, then right-click the User folder and select Explorer (Windows) or Finder (Mac). That opens your file manager. Open the Scripts Panel folder and copy the xxxxxx.jsx file to that folder. After a few seconds it'll appear in the Scripts panel. Double-click it to execute the script.

 

If you don't have permissions to write to that folder, ask your system administrator.

Joanna101Author
Participating Frequently
April 17, 2024

The plugin is for a newspaper editorial system, NewsEngin, and allows users to pull content from the editorial system onto the page directly from the website. The pages are checked in and out from the server and can be checked in under different statuses. When the page is finished, it can be sent to a status that publishes the page to an e-Edition on the publication's website.

I spoke with the NewsEngin help desk and they weren't helpful, they didn't understand the problem at all. One of the things I do is make magazines for the publications, which aren't printed or published the same way as regular newspaper page. I do center spreads so I need the right and left pages married into spreads. The help desk didn't seem to understand that unfortunately.

Community Expert
April 17, 2024

Ok - I think I understand your issue more clearly now. 

Thanks for explaining. 

 

Just as an added bonus - can you share a sample document of how it appears - and also how you would like it to appear?
It can be screenshots or it can be a file. 
Whatever suits you.

If it's sensitive you can PM me and anyone else who replies with the files. 

Just so we have a full understanding of the issue.

Joanna101Author
Participating Frequently
April 17, 2024

Here is the screenshot of the page view, as you can see the pages are staggered and not married into spreads due to each separate page being a new section. That is the problem I'm having. Just wondering if there is a setting I can use to quickly do this as a whole instead of dragging each right page up to marry it to the left. Some of our files are quite large.

Community Expert
April 17, 2024

Can you tell us more about the plugin that you have - seems quite specific. Maybe you'd need to contact the makers of the plugin.