Copy link to clipboard
Copied
Hi all,
I'm trying to add folios to currently unnumbered pages using a pretty simple script like:
app.activeDocument.masterSpreads.item("A-Parent").textFrames.add({
geometricBounds: ["62", "40", "63", "47"],
contents: "?",
itemLayer: "Layer 1",
parentStory: {appliedParagraphStyle: ""}
})
This creates the box just fine, but I have no idea what to use for the "contents: "?" to insert a current page number marker. I'm not even sure how to look this up. Is it even possible?
Thanks for any help!
-Don
aTextFrame.contents = SpecialCharacters.autoPageNumber
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#SpecialCharacters.html
Copy link to clipboard
Copied
aTextFrame.contents = SpecialCharacters.autoPageNumber
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#SpecialCharacters.html
Copy link to clipboard
Copied
Yes! And now that I know what to look for, I know how to find them in the API. Thank you!
Copy link to clipboard
Copied
Hi @dona56558947 ,
see a list of special character enumerators at the InDesign DOM documentation compiled by Gregor Fellenz:
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#SpecialCharacters.html
So this is working:
contents : SpecialCharacters.AUTO_PAGE_NUMBER ,
Hm. What do you like to do with:
parentStory: { appliedParagraphStyle : "" }
If you want to apply the "no paragraph style" style do this:
parentStory: { appliedParagraphStyle : app.documents[0].paragraphStyles[0] }
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
I was still working on the styling part. Since there are no folios in these docs currently, there is no paragraph style to apply. I've now added another step to first create a "Folio" paragraph style and properly style these new folios.
Thanks!