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

script about jump to masterpage

Community Beginner ,
Sep 06, 2021 Sep 06, 2021

Copy link to clipboard

Copied

Hello all professional members,

have someone can teach me a script how to jump to master page A (when I have master B, master C, etc)

 

I jsut found a similar one but it just based on the page applied whcih master to jump...

can't jump to specific master page A...

many thanks if someone can teach me!

 

try {
var page = app.windows[0].activePage;

if (page.appliedMaster.pages.length === 0) {
}
app.windows[0].activePage = page.appliedMaster.pages[];
} catch (e)
{
}

TOPICS
Scripting

Views

133

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 1 Correct answer

Community Expert , Sep 06, 2021 Sep 06, 2021

Hi miloes329,

try the following script snippet where you have to change the name of the master if you do not have an English version of InDesign:

// NOTE: The name can be different in different localized versions of InDesign.
// And the name of the master could  also be renamed of course.
var nameOfMaster = "A-Master";
var masterSpread = app.documents[0].masterSpreads.itemByName( nameOfMaster );

if( masterSpread.isValid )
{
	app.layoutWindows[0].activeSpread = masterSpread ;
}else
{
	alert( "Ma
...

Votes

Translate

Translate
Community Expert ,
Sep 06, 2021 Sep 06, 2021

Copy link to clipboard

Copied

Hi miloes329,

try the following script snippet where you have to change the name of the master if you do not have an English version of InDesign:

// NOTE: The name can be different in different localized versions of InDesign.
// And the name of the master could  also be renamed of course.
var nameOfMaster = "A-Master";
var masterSpread = app.documents[0].masterSpreads.itemByName( nameOfMaster );

if( masterSpread.isValid )
{
	app.layoutWindows[0].activeSpread = masterSpread ;
}else
{
	alert( "Master not found:" + "\r" + nameOfMaster )
};

 

Regards,
Uwe Laubender

( ACP )

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 Beginner ,
Sep 06, 2021 Sep 06, 2021

Copy link to clipboard

Copied

LATEST

It works perfectly!

Thanks Laubender!!

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