Copy link to clipboard
Copied
Im trying to create an alternate layout – One for digital and one for print. I've managed to map the paragraph styles from the master but indesign doesn't have a feature to map object styles in the way I need.
The way it will work is there'll be a style for active and one for inactive. However the colours used on the print and digital versions will be different so they cant be the same style.
For example in the master design I could have the object style 'on' activated and in the alternate layout, have 'on/alt' activated. The problem I can see is if I change the master then to use the 'off' object style I want it to automatically update the alternate layout to 'off/alt'. It doesn't have to be 'fully automatic'. If it's possible to run the script on save or as a relinking graphic that would be ideal too.
Desired digital view
Desired print view
Thanks everyone in advance.
Copy link to clipboard
Copied
Okay,
I've tried to give scripting this a go (don't judge the quality of this, I'm definitely no script writer!)
// Empty array for use later
var printPages = [];
// Select active document in inDesign
var activeApp = app.activeDocument;
// Grab all the pages in the document
var pages = activeApp.pages;
// Grab only alternate layout pages which are titled Print
for ( i = 0; pages.length > i; i++ ){
if ( pages.appliedAlternateLayout.alternateLayout == "Print") {
// Push these pages indexes to an empty array
printPages.push(i);
}
}
// Loop through correct pages and add to the selection –– DOESN'T LOOP YET ****
for ( i = 0; printPages.length > i; i++ ) {
selection = pages[printPages].allPageItems;
}
// Check selection exists
if ( selection == undefined ){
alert("Please make a selection and try again.");
exit();
}
// Find all objects within the selection and have the 'Active Fill' object style and change them to the 'Print Fill' object style
for ( i = 0; selection.length > i; i++ ) {
printObjectStyle = activeApp.objectStyles.itemByName("Print Fill");
if ( selection.appliedObjectStyle.name == "Active Fill" ) {
selection.applyObjectStyle(printObjectStyle, true, true);
}
}
I've found two problems, the second being the most irritating