Get current page number in InDesign CS5 from Javascript

PeterMmm picture PeterMmm · Sep 22, 2010 · Viewed 9.7k times · Source

What is the DOM expression to get current page where the cursor is:

app.activeDocument.currentPage ?

Answer

Skilldrick picture Skilldrick · Sep 22, 2010

You want:

app.activeWindow.activePage.name;

This will give you the actual page number name as a string (i.e. if your pages are numbered in roman then this will give 'v' for the fifth page).