Skip to main content
Inspiring
July 5, 2017
Answered

Rename Master Spreads with Script

  • July 5, 2017
  • 2 replies
  • 1080 views

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

Correct answer rob day

baseName should work

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

2 replies

Participating Frequently
April 15, 2025

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.

rob day
Community Expert
rob dayCommunity ExpertCorrect answer
Community Expert
July 5, 2017

baseName should work

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

KenWKAuthor
Inspiring
July 6, 2017

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

Thanks for helping to extract!
Ken