Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Locked

Need help to script MasterSpread page count

New Here ,
Jun 30, 2021 Jun 30, 2021

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?

Screen Shot 2021-06-30 at 11.48.35 AM.png

TOPICS
Scripting

Views

58

Likes

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

Copy link to clipboard

Copied

Likes

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

Copy link to clipboard

Copied

LATEST

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

 

Likes

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