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.


How do I designate all pages for an AppliedMaster script?

New Here ,
Aug 31, 2021 Aug 31, 2021

Copy link to clipboard

Copied

Hello all,

 

I feel like this should be a "duh" thing but I've tried everything I can think of and have come up empty.

 

Attempting to apply a master page to all the pages in my document in a script. I am aware that this is easy to do in InDesign, but we have a multi-step script that needs to include this step. The code below applied the master page to the first page, but does not work for multi-page documents.

 

app.documents[0].pages[0].appliedMaster = app.documents[0].masterSpreads.item ('GGS-Master');

Also, if you can suggest a source for looking up javascript terms, I'd appreciate it!

 

Thanks,

Amanda

TOPICS
How to, Scripting

Views

38

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

correct answers 1 Correct answer

Adobe Community Professional , Aug 31, 2021 Aug 31, 2021
Hi Amanda, you could work with method everyItem() to access all document pages: https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Pages.html So your code could be written like that: app.documents[0].pages.everyItem().appliedMaster = app.documents[0].masterSpreads.item('GGS-Master'); InDesign's vast document object model ( DOM ) description compiled by Gregor Fellenz: https://www.indesignjs.de/extendscriptAPI/indesign-latest/#about.html Regards, Uwe Laubender ( ACP )

Likes

Translate

Translate
Adobe Community Professional ,
Aug 31, 2021 Aug 31, 2021

Copy link to clipboard

Copied

Hi Amanda,

you could work with method everyItem() to access all document pages:

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Pages.html

 

So your code could be written like that:

app.documents[0].pages.everyItem().appliedMaster = 
app.documents[0].masterSpreads.item('GGS-Master');

 

InDesign's vast document object model ( DOM ) description compiled by Gregor Fellenz:

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#about.html

 

Regards,
Uwe Laubender

( ACP )

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
New Here ,
Aug 31, 2021 Aug 31, 2021

Copy link to clipboard

Copied

LATEST

Thank you very much, @Laubender! I was so close and this was perfect.

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