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

Is there a way to set and change the transparency of a complete layer?

Community Beginner ,
Feb 09, 2023 Feb 09, 2023

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

TOPICS
Feature request
428
Translate
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

Community Expert , Feb 09, 2023 Feb 09, 2023

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.
...
Translate
Community Expert ,
Feb 09, 2023 Feb 09, 2023

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]));
  }

}());

 

Translate
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 09, 2023 Feb 09, 2023

Thank's al lot! I will test it tomorrow morning.

 

Jens

Translate
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 10, 2023 Feb 10, 2023
LATEST

Works like a charm... 🙂

Translate
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