Skip to main content
Inspiring
December 6, 2021
Answered

How to get Next Page Number from activePage in indesign using javascript ?

  • December 6, 2021
  • 1 reply
  • 596 views

I used the following lines to get next Page but unable to fetch nextPage number. How to get it?

var currentpage= myElement.texts[0].parentTextFrames[0].parentPage;
var nextpage= doc.pages.nextItem(currentpage).name;

 I tried using .name propery to get the name of the next page but it shows invalid property!

Is there any other way to get the nextPage name! If so Please help me.

This topic has been closed for replies.
Correct answer Kasyan Servetsky

var nextpage = doc.pages[currentpage.documentOffset + 1].name;

1 reply

Kasyan Servetsky
Kasyan ServetskyCorrect answer
Legend
December 6, 2021

var nextpage = doc.pages[currentpage.documentOffset + 1].name;