Skip to main content
deckarduk
Inspiring
May 11, 2023
Answered

InDesign Javascript Pages Palette question...

  • May 11, 2023
  • 1 reply
  • 1046 views

Hi there,

Is there a way to get the page names from the Pages Palette, under each page icon, using javascript?

I can access the page numbers however I need the page names.

Thanks.

This topic has been closed for replies.
Correct answer rob day

Thanks Rob 👍

I've just realised, I'm expecting the master page prefix too that's why I asked.

I'm presuming I can get that from somewhere and concatenate the two.

Thanks again.


var p = app.activeWindow.activePage;
alert(p.appliedMaster.name + "  " + p.name)

 

1 reply

rob day
Community Expert
Community Expert
May 11, 2023

Hi @deckarduk , A page has name and documentOffset properties.—name should give you the name listed in the pages panel:

 

var p = app.activeWindow.activePage;
alert("\rActive page name: " + p.name + "\rActive page absolute number: "+(p.documentOffset + 1))

 

Result:

deckarduk
deckardukAuthor
Inspiring
May 11, 2023

Hi Rob,

Thanks for the help.

Apologies, I should have explained better, I can get the 'absolute' page number.

Is there a way to get the information, e.g. 'Chap01-3', under each page icon as shown on the screen grab?

Thanks again.

rob day
Community Expert
Community Expert
May 11, 2023

Yes, the name property:

 

var p = app.activeWindow.activePage.name;
alert(p);