Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Rename Master Spreads with Script

Engaged ,
Jul 05, 2017 Jul 05, 2017

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

TOPICS
Scripting
895
Translate
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

Community Expert , Jul 05, 2017 Jul 05, 2017

baseName should work

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

Translate
Community Expert ,
Jul 05, 2017 Jul 05, 2017

baseName should work

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

Translate
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
Engaged ,
Jul 06, 2017 Jul 06, 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

Translate
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
Community Beginner ,
Apr 15, 2025 Apr 15, 2025
LATEST

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
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