Copy link to clipboard
Copied
Hello,
per script I want to create a new MasterPage and create a primaryTextFrame on it? TextFrame is no problem, but I can't get it set to primary.
Copy link to clipboard
Copied
Click on the symbol on the upper part of the left edge of the text frame once. It will change it to a primary text frame.
Copy link to clipboard
Copied
Hello,
yes, but I want to create it via JavaScript.
Copy link to clipboard
Copied
Why do you want a script, when a single click will solve your problem?
Copy link to clipboard
Copied
It is only a small part of a script. I want to create a new document with several pages. For this I need a primaryTextFrame for different MasterPages
Copy link to clipboard
Copied
There's a property createPrimaryTextFrame, which is a creation property, that is, you have to set the property when you create a document. You can't change an existing frame to a primary frame. here's how to use it:
doc = app.documents.add ({
documentPreferences: {
createPrimaryTextFrame: true,
// And whatever else
}
);
Copy link to clipboard
Copied
The MasterSpread object has a primaryTextFrame property. I've enver used it but I would imagine it would be something like:
myParentSpread.primaryTextFrame = myParentSpread.textFrames.add();
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#MasterSpread.html
Copy link to clipboard
Copied
Nope, doesn't work: "Invalid object for this request".
Copy link to clipboard
Copied
Hmm, bug? If you have a PTF set on the parent, then mySpread.primaryTextFrame.isValid is true, but you're right, doesn't seem you can set it on the fly. Weird.
Copy link to clipboard
Copied
Definitely seems like a bug. Added it to user voice: https://indesign.uservoice.com/forums/601180-adobe-indesign-bugs/suggestions/46003087-masterspread-p...