Skip navigation
Currently Being Moderated

Object layer options

Jul 30, 2012 10:55 AM


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...

  • Currently Being Moderated
    Jul 30, 2012 10:47 PM   in reply to wimkees

    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( !="Layer 1" || !="NL" ){
                myGName.currentVisibility = false;





    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points