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

Need help scripting Master Spread page count

New Here ,
Jun 30, 2021 Jun 30, 2021

Copy link to clipboard

Copied

Hi, I need help to script the number of pages in the master spread to 1 (or any other number). I keep getting files where the page count is usually 2 and I currently I manually change it to one. Is this process scriptable?

TOPICS
Scripting

Views

300

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

correct answers 1 Correct answer

Community Expert , Jun 30, 2021 Jun 30, 2021

Hi @BarlaeDC,

We could delete the pages of A-Master, I posted my comment on the other duplicate thread.

https://community.adobe.com/t5/indesign/need-help-to-script-masterspread-page-count/m-p/12147998#M435262

-Manan

Votes

Translate

Translate
Community Expert ,
Jun 30, 2021 Jun 30, 2021

Copy link to clipboard

Copied

Hi,

I am not sure I understand what you are trying to achieve.

Are you trying to change the number of page in the one (or more) Masters when you start a file?

 

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
New Here ,
Jun 30, 2021 Jun 30, 2021

Copy link to clipboard

Copied

I'm trying to script changing the number of pages in the Masters, from two down to one in my specific case. I get a number of files with the master spread pages number set to the wrong count and I'd like to automate setting them to the right count (as needed).

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 ,
Jun 30, 2021 Jun 30, 2021

Copy link to clipboard

Copied

If the solution mentioned in the other thread works then we can extend it to make all the masterspreads in the document to have a single page by something like the following

for(var i = 0; i < app.documents[0].masterSpreads.length; i++)
{
	for(var j = 1; j < app.documents[0].masterSpreads[i].pages.length; )
		app.documents[0].masterSpreads[i].pages[-1].remove()
}

-Manan

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 ,
Jul 01, 2021 Jul 01, 2021

Copy link to clipboard

Copied

LATEST

I am still not sure why scripting it if chaging the settings to single page will achieve it with 1 click. I must be missing something here.

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 ,
Jun 30, 2021 Jun 30, 2021

Copy link to clipboard

Copied

Hi,

 

Do you mean that you want to change A-Master to only have 1 page, rather than 2. I don't think that is doable, although you could script the creation of a new MasterSpread that only has 1 page which is just

 

app.activeDocument.masterSpreads.add(1);

 

Then just use that master, you could probably script it to update all the pages to use the new master but I haven't investigated that.

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 ,
Jun 30, 2021 Jun 30, 2021

Copy link to clipboard

Copied

Hi @BarlaeDC,

We could delete the pages of A-Master, I posted my comment on the other duplicate thread.

https://community.adobe.com/t5/indesign/need-help-to-script-masterspread-page-count/m-p/12147998#M43...

-Manan

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