Answered
This topic has been closed for replies.
Hi Michel!
Thank you for your video! It seems just like i want the effect to be.
Can you post the link to the script online so anyone can use it?
… Supposing you place on the master page(s) the left/right pages text frames containing the 3 paras, one per page indicator, on a specific layer you call "PageNumber_0", this could be enough simplistic and securized to play your game! If the layout moves, play it again!
About the first/last pages, the paras containing "NP" is just without color!
Why complicate when we can make simple! 😉
/*
_FRIdNGE-0652_PageNumber.jsx
by FRIdNGE, Michel Allio [16/09/2020]
*/
var myDoc = app.activeDocument,
myPages = myDoc.pages,
P = myPages.length, p,
myLayer0 = myDoc.layers.itemByName("PageNumber_0"),
myLayer1 = myDoc.layers.itemByName("PageNumber_1");
if ( myLayer1.isValid ) myLayer1.remove();
myLayer1 = myLayer0.duplicate();
myLayer1.name = "PageNumber_1";
myLayer0.visible = false;
myLayer1.visible = true;
for ( p = 0; p < P ; p++ ) {
var myPage = myDoc.pages[p];
if ( myPage.appliedMaster !== null ) {
var I = myPage.appliedMaster.pageItems.length, i;
for ( i = 0; i < I; i++ ) {
var myPageItem = myPage.appliedMaster.pageItems[i];
if ( myPageItem.itemLayer == myLayer1 ) {
if ( (myPage.side == PageSideOptions.LEFT_HAND && myPageItem.parentPage.side == PageSideOptions.LEFT_HAND) ||
(myPage.side == PageSideOptions.RIGHT_HAND && myPageItem.parentPage.side == PageSideOptions.RIGHT_HAND) ) {
var myTFrame = myPageItem.override(myPage);
if ( p == 0 ) myTFrame.texts[0].paragraphs[0].fillColor = myDoc.swatches.item("None");
if ( p == P-1 ) myTFrame.texts[0].paragraphs[2].fillColor = myDoc.swatches.item("None");
}
}
}
}
}
alert( "Done! …\r\rby FRIdNGE, Michel Allio [16/09/2020]" )
(^/)
Sign up
Already have an account? Login
To post, reply, or follow discussions, please sign in with your Adobe ID.
Sign inSign in to Adobe Community
To post, reply, or follow discussions, please sign in with your Adobe ID.
Sign inEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.
