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

Object Layer Options, change for all AI links?

Community Beginner ,
Feb 18, 2013 Feb 18, 2013

Copy link to clipboard

Copied

Hi,

I am working in ID CS5 and have a document with several dozen linked AI files. They are all built the same way in AI, with 5 layers. I need to print the document for different people, who need different layers visible. Right now I had set up the document with all 5 AI layers visible but I would like to be able to turn off, say, Layer 1 and Layer 2, - depending on the target audience - for all linked AI files, then turn them back on, and so forth.

Is that scriptable?

Thanks so much!

S

ps, Right now I am able to get a menu item containing the "Object Layer Options" when direct-selecting a link, and even made a keyboard shortcut for it, but this shortcut does not work when selecting multiple graphics frames, nor can I find the menu command anywhere in Find/Change.

TOPICS
Scripting

Views

1.2K

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

correct answers 1 Correct answer

Enthusiast , Feb 19, 2013 Feb 19, 2013

Hi,

until now the script does not have a GUI. So you have to set your choice in the first scriptline.

var input = ['layerName01', 'layerName02', 'add as many layers as you want', '...', 'and so on']/*Names of Layers to switch on or off*/, onOrOff = false/*true = visible, false = not visible*/;

Votes

Translate

Translate
Enthusiast ,
Feb 18, 2013 Feb 18, 2013

Copy link to clipboard

Copied

Hi,

not as fine but try this:

var input = ['Ebene 1', 'Ebene 2']/*Names of Layers to switch on or off*/, onOrOff = false/*true = visible, false = not visible*/;

var currDocGraphics = app.activeDocument.allGraphics;

l = currDocGraphics.length;

while(l--){

    currImage = currDocGraphics;

    if(currImage.imageTypeName == 'Adobe PDF'){

        i = input.length;

        while(i--){

            try{

    currImage.graphicLayerOptions.graphicLayers.itemByName(input).currentVisibility = onOrOff;

       } catch (e){

            }

    }

   }

        }

No GUI today 😉

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
Community Beginner ,
Feb 19, 2013 Feb 19, 2013

Copy link to clipboard

Copied

Hi, sorry, but I am still new to scripting. I copy and paste into ExtendScript Toolkit, save as .js but nothing happens when I run the script in ID. What am I doing wrong?

Thanks

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
Enthusiast ,
Feb 19, 2013 Feb 19, 2013

Copy link to clipboard

Copied

Hi,

until now the script does not have a GUI. So you have to set your choice in the first scriptline.

var input = ['layerName01', 'layerName02', 'add as many layers as you want', '...', 'and so on']/*Names of Layers to switch on or off*/, onOrOff = false/*true = visible, false = not visible*/;

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
Community Beginner ,
Feb 21, 2013 Feb 21, 2013

Copy link to clipboard

Copied

Got it! I saved a series of scripts for the layers I need, with an ON and and an OFF version for each. Thanks so much! Vielen Dank!

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
Enthusiast ,
Feb 22, 2013 Feb 22, 2013

Copy link to clipboard

Copied

LATEST

dafür nich' 😉

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