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

Object style mapping

New Here ,
Aug 15, 2018 Aug 15, 2018

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.

Screen Shot 2018-08-15 at 11.53.44.png

Desired digital view

Screen Shot 2018-08-15 at 11.55.14.png

Desired print view

Thanks everyone in advance.

TOPICS
Scripting

Views

243

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
New Here ,
Aug 17, 2018 Aug 17, 2018

Copy link to clipboard

Copied

LATEST

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

  1. I can't currently get the selection to loop through each page if there was several (Line 22)
  2. I've realised that when icon on the alternate layout is updated it doesn't actually change it's object style, rather it just applies overrides to it's current style. Does anyone know of a workaround to this?

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