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.
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*/;
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 😉
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
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*/;
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!
Copy link to clipboard
Copied
dafür nich' 😉