Copy link to clipboard
Copied
Hello, I need some help to understand how to script the number of pages in the master page to 1.
I keep having to manually set the page count to 1, so I'd like to see if there was a way to script this?
 
If you intend to delete the pages in a spread you can use something like the following
app.documents[0].masterSpreads.itemByName("A-Master").pages[-1].remove()
This will remove the last page of the master spread named A-Master. If the masterspread has only a single page the above code removes the masterspread totally. So you could iterate the masterspreads and delete pages until it's left with only a single page
-Manan
Copy link to clipboard
Copied
This is a duplicate of https://community.adobe.com/t5/indesign/need-help-scripting-master-spread-page-count/td-p/12147718
Please answer on that thread
Copy link to clipboard
Copied
If you intend to delete the pages in a spread you can use something like the following
app.documents[0].masterSpreads.itemByName("A-Master").pages[-1].remove()
This will remove the last page of the master spread named A-Master. If the masterspread has only a single page the above code removes the masterspread totally. So you could iterate the masterspreads and delete pages until it's left with only a single page
-Manan