Reply To: Set AppliedMaster to paragraph

#75448
Ariel Walden
Member

Hi Doug,

You don’t mention which version of InDesign you’re trying to get this to work on, and the method did slightly change at some point, but certainly from CS6 onwards, to find the page, you can do this:

app.selection[0].parentTextFrames[0].parentPage

However, this is slightly simplistic: for instance, if the text frame of the selected paragraph is sitting on the pasteboard, the above line will return Null.

Likewise, you would need to check what happens if your text frame is in a table, footnote, etc.

Learning to script InDesign is a very worthwhile exercise in my opinion. Nevertheless, if deadlines loom, etc., you may want to check out https://www.id-extras.com/products/mastermatic.

This article was last modified on May 17, 2015

Comments (0)

Loading comments...