

From here we can find allPageItems object, with this description: Lists all page items contained by the Page.That's where we need to go to find out how to get the items in a page ↓ This page is littered with green links that lead to the single page object.The method item() may be confusing to someone who is new to INDD scripting, so decided to use the shorter pages. So to get a specific page, we could do:.In this page you can, for example, see that em() method "Returns the Page with the specified index or name." and not a pageItem, like your code seems to assume.This could be a good reference site for you.

In other words, you are trying to add the paragraph style to the page. Your variable myParagraph points to a page with the index 1, not an item in the page. Looking at the code you posted, you're skipping over a few things. I'm also taking a somewhat general approach so that you can use this knowledge to hunt down other things you might need. I'm not going to answer everything in the original question since the answer you posted with the code examples seemed have an actual issue that needed explaining. Script 3 var myDocument = app.activeDocument MyParagraph.applyParagraphStyle(myParagraphStyle,true)

Script 2 var myDocument = app.activeDocument Somehow, ID tells me "myParagraph.applyParagraphStyle" is "not a function".
