Copy link to clipboard
Copied
Hi community,
is there a way to set and change the transparency of a complete layer in InDesign?
I've several layers in my InDesign document. The items (usually PDFs) on the top layer need to be semi-transparent while working with the document, but must be fully visible in the later PDF.
The layer-sets are always named in the same way (e.g. Construction-Paths, Bilder, Texte).
Thanks in advance
Jens
You'd have to set the transparency of all the items on those layers. Here's a script that does that.
At lines 3-5 you include the names of the layers that should be targeted.
Then at 'opacity' you set the desired opacity. To return to 'normal', set it to 100.
(function () {
const layers = [
'Construction-Paths',
'Bilder',
'Texte',
];
const opacity = 50;
function setOpacity (layer) {
if (!layer.isValid) {
return;
}
var items = layer.pageItems.
...
Copy link to clipboard
Copied
You'd have to set the transparency of all the items on those layers. Here's a script that does that.
At lines 3-5 you include the names of the layers that should be targeted.
Then at 'opacity' you set the desired opacity. To return to 'normal', set it to 100.
(function () {
const layers = [
'Construction-Paths',
'Bilder',
'Texte',
];
const opacity = 50;
function setOpacity (layer) {
if (!layer.isValid) {
return;
}
var items = layer.pageItems.everyItem().getElements();
for (var i = 0; i < items.length; i++) {
try {
items[i].transparencySettings.blendingSettings.opacity = opacity;
} catch (_) {
}
}
}
for (var i = 0; i < layers.length; i++) {
setOpacity (app.documents[0].layers.item(layers[i]));
}
}());
Copy link to clipboard
Copied
Thank's al lot! I will test it tomorrow morning.
Jens
Copy link to clipboard
Copied
Works like a charm... 🙂
Find more inspiration, events, and resources on the new Adobe Community
Explore Now