Copy link to clipboard
Copied
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
baseName should work
app.activeDocument.masterSpreads[0].baseName="myspread"
Copy link to clipboard
Copied
baseName should work
app.activeDocument.masterSpreads[0].baseName="myspread"
Copy link to clipboard
Copied
Well, THAT'S embarrassing! Obviously I looked through the master spreads DOM with head firmly planted in posterior.
Thanks for helping to extract!
Ken
Copy link to clipboard
Copied
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.