Skip to main content
Inspiring
Jul 5, 2017 7:16 PM UTC
Answered

Rename Master Spreads with Script

I have a bunch of books in production for a series and I want to rename the master spreads in a bunch of files, but I can't see how to do it.

I know I can simply change the NamePrefix but when I try to change "Name" an error occurs, which makes sense given the object model shows that to be read only.

is there really no way to rename a master through a script?

Thank you,
Ken

rob day
rob dayCorrect answer
Community Expert
Jul 5, 2017 8:04 PM UTC

baseName should work

app.activeDocument.masterSpreads[0].baseName="myspread"

3 replies

Participating Frequently
Apr 15, 2025 10:44 AM UTC

To expand on this a little bit, because I wasted a morning figuring it out, the name property is a composite of two parts the .baseName and the .namePrefix, so what you will see returned from

app.activeDocument.masterSpreads[0].name

is
app.activeDocument.masterSpreads[0].baseName and app.activeDocument.masterSpreads[0].namePrefix split by a hyphen.

 

The baseName and namePrefix are read/write, while name is read-only.

Translate
rob day
Community Expert
rob dayCommunity ExpertCorrect answer
Community Expert
Jul 5, 2017 8:04 PM UTC

baseName should work

app.activeDocument.masterSpreads[0].baseName="myspread"

Translate
KenWKAuthor
Inspiring
Jul 6, 2017 6:38 PM UTC

Well, THAT'S embarrassing! Obviously I looked through the master spreads DOM with head firmly planted in posterior.

Thanks for helping to extract!
Ken

Translate