Use a Script to Automatically Assign Parent/Master Pages • Adobe InDesign

Published: 18 April 2022
on channel: Becky’s Graphic Design®, LLC
2,243
70

Manually assigning Parent/Master pages in a long document can be exhausting, especially if your pages have been shuffled. Instead of hand-assigning the Parents, use this script to identify each instance of a single paragraph style, then assign a new Parent page accordingly.

↓↓↓↓↓↓↓↓↓↓↓↓↓
!!! IMPORTANT !!! Script text (replace # with an open angle bracket, YouTube doesn't like those):
↑↑↑↑↑↑↑↑↑↑↑↑↑

var myDocument = app.activeDocument;
var myParas = myDocument.stories.everyItem().paragraphs.everyItem().getElements();
var myPage = myDocument.pages;
for(i=0; i#myParas.length; i++)
{
if(myParas[i].appliedParagraphStyle.name == "Sidebar")
{
//Works only in CS5 and later
myParas[i].parentTextFrames[0].parentPage.appliedMaster = myDocument.masterSpreads.item("B-Parent");
//for CS4 use this
//myParas[i].parentTextFrames[0].parent.appliedMaster = myDocument.masterSpreads.item("B-Parent");
}
}

0:00 - Intro
0:25 - The Problem
1:01 - Manually Applying Master Pages takes too Long
1:23 - Intro to Scripts
1:44 - Open a Text Editor
2:02 - THE CODE
2:15 - Variables to Change
2:48 - Find Style Name
3:15 - Assign a Parent/Master page
3:53 - The Notes Line //
4:21 - Make a Descriptive File Name
5:11 - Save As a JSX File
5:35 - Where to Save the Script
6:48 - Open the Scripts Panel
7:14 - Running the Script
7:40 - The Results

Licensed Intro/Outro Music:
Lake Michigan by Staffan Carlén.

Visit our website at:
https://www.BeckysGraphicDesign.com


Watch video Use a Script to Automatically Assign Parent/Master Pages • Adobe InDesign online, duration hours minute second in high quality that is uploaded to the channel Becky’s Graphic Design®, LLC 18 April 2022. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 2,243 times and liked it 70 visitors.