Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

InDesign Javascript Pages Palette question...

Contributor ,
May 11, 2023 May 11, 2023

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.

TOPICS
SDK
683
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Community Expert , May 11, 2023 May 11, 2023

Yes, the name property:

 

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

 

Screen Shot 22.png

Translate
Community Expert , May 11, 2023 May 11, 2023
var p = app.activeWindow.activePage;
alert(p.appliedMaster.name + "  " + p.name)

 

Screen Shot 23.png

Translate
Community Expert ,
May 11, 2023 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:

Screen Shot 21.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 11, 2023 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 11, 2023 May 11, 2023

Yes, the name property:

 

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

 

Screen Shot 22.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 11, 2023 May 11, 2023

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 11, 2023 May 11, 2023
var p = app.activeWindow.activePage;
alert(p.appliedMaster.name + "  " + p.name)

 

Screen Shot 23.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 11, 2023 May 11, 2023
LATEST

Great, thanks for the help Rob 👍

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines