Copy link to clipboard
Copied
I found a handy javascript online for Indesign that changes the page label color to green – which is great. I often color code my pages with green or red labels to keep track of client selects and as a script I can map these commands to keyboard shortcuts. Does anyone know how to ammend the script to reset the color label to the default label color of none?:
PageColorOptions.NOTHING
Works too I think
Copy link to clipboard
Copied
I think you can set it = null;
Copy link to clipboard
Copied
I think you can set it = null;
By @brian_p_dts
You are right:
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Page.html
Copy link to clipboard
Copied
PageColorOptions.NOTHING
Works too I think
Copy link to clipboard
Copied
pageColor
Array of 3 Reals (0 - 255)
PageColorOptions
PageColorOptions.NOTHING
PageColorOptions.USE_MASTER_COLOR
UIColors
The color label of the Page, specified either as an array of three doubles, each in the range 0 to 255 and representing R, G, and B values, or as a UI color. Can return: Array of 3 Reals (0 - 255) or UIColors enumerator or PageColorOptions enumerator.
Copy link to clipboard
Copied
Hi @brian_p_dts , null is throwing an error for me—"Invalid value for set property 'pageColor'. Expected Array of 3 Reals (0 - 255) or UIColors enumerator or PageColorOptions enumerator, but received null.".
I think it needs to be:
Copy link to clipboard
Copied
Copy link to clipboard
Copied
if ( app.activeWindow.activePage.pageColor == PageColorOptions.NOTHING ) app.activeWindow.activePage.pageColor = UIColors.GREEN;
else app.activeWindow.activePage.pageColor = PageColorOptions.NOTHING;
(^/) The Jedi
Copy link to clipboard
Copied
Funny: associate a keyboard shortcut [ctrl+<] played with the left hand, to this simplistic script:
if ( app.activeWindow.activePage.pageColor == PageColorOptions.NOTHING ) app.activeWindow.activePage.pageColor = UIColors.GREEN;
else if (app.activeWindow.activePage.pageColor == UIColors.GREEN ) app.activeWindow.activePage.pageColor = UIColors.RED;
else if (app.activeWindow.activePage.pageColor == UIColors.RED ) app.activeWindow.activePage.pageColor = PageColorOptions.NOTHING;
No Color >> Green Color >> Red Color >> No Color >> Green Color …
(^/)
Copy link to clipboard
Copied
Hi @jenniferd93478144 ,
well, the default for page label color is:
PageColorOptions.USE_MASTER_COLOR
Regards,
Uwe Laubender
( Adobe Community Expert )