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

InDesign Javascript Pages Palette question...

Participant ,
May 11, 2023 May 11, 2023

Copy link to clipboard

Copied

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

Views

389

Translate

Translate

Report

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

Votes

Translate

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

 

Screen Shot 23.png

Votes

Translate

Translate
Community Expert ,
May 11, 2023 May 11, 2023

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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
Participant ,
May 11, 2023 May 11, 2023

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Yes, the name property:

 

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

 

Screen Shot 22.png

Votes

Translate

Translate

Report

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
Participant ,
May 11, 2023 May 11, 2023

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

 

Screen Shot 23.png

Votes

Translate

Translate

Report

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
Participant ,
May 11, 2023 May 11, 2023

Copy link to clipboard

Copied

LATEST

Great, thanks for the help Rob 👍

Votes

Translate

Translate

Report

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