1 Reply Latest reply on Jul 30, 2012 10:47 PM by csm_phil

    Object layer options



      In an annual report there are many imported (and linked) AI graphics. They all have 4 layers, named EN, GE, NL and Layer 1.

      First we make the NL annual report in which we place the AI-files with only the Layer 1 and NL layer turned on (set to visible).

      Then we copy this annual report (in Windows) to the EN version and translate the body text. So far so good.


      Question: is it possible to make a simple script that makes (for all linked AI-graphics) the NL layer invisible and the EN layer visible. That would be a huge time saver...

        • 1. Re: Object layer options
          csm_phil Level 4

          Hi Wimkees,


          Please try the below JS code, This code will hide the EN & and GE to set the visibility OFF, So remaining layer of NL & Layer 1 is visibility is ON.


          I hope youe expect this!


          var myDoc = app.activeDocument;
          var myGraphics = myDoc.links;
          for (var i = myGraphics.length-1; i >= 0; i--) {
              var myArt = myGraphics[i]; 
              var myGraph = myArt.graphicLayerOptions.graphicLayers;
              for (var a=myGraph.length-1; a>=0; a--){
                  var myGName = myGraph[a];
                  if(myGName.name !="Layer 1" || myGName.name !="NL" ){
                      myGName.currentVisibility = false;