Skip to main content
Known Participant
June 30, 2022
Answered

Jump to page in active story

  • June 30, 2022
  • 2 replies
  • 253 views
I have two diff stories in my InDesign file.
 
In the first story there are two Table of contents pages. and in the second story there is actual content.
 
How to jump to an active story s page only.
 
Using below code to Jump to a specific page but it is considering TOC pages also.
 
eg. when I jump to 23 rd page, it actually jumps to the 21 st page.
 

var doc = app.documents[0];

 
var page = doc.pages.item(Number(23));
app.activeWindow = doc.layoutWindows[0];
app.activeWindow.activePage = page;
 
Thanks in advance.
This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer Laubender

Hi @Hetal5C4C ,

it's perhaps more the 24th page in the document and not simply page 21 ( both could be true of course ), because counting begins with 0. doc.pages[0] or doc.pages.item(0) is the first page in any document.

 

Test this to call the page by name:

var page = doc.pages.itemByName("23");

 

Regards,
Uwe Laubender
( Adobe Community Professional )

2 replies

LaubenderCommunity ExpertCorrect answer
Community Expert
June 30, 2022

Hi @Hetal5C4C ,

it's perhaps more the 24th page in the document and not simply page 21 ( both could be true of course ), because counting begins with 0. doc.pages[0] or doc.pages.item(0) is the first page in any document.

 

Test this to call the page by name:

var page = doc.pages.itemByName("23");

 

Regards,
Uwe Laubender
( Adobe Community Professional )

Hetal5C4CAuthor
Known Participant
July 1, 2022

Whoa.. great..

It's works by calling the page by Name.

 

Thanks.