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

Set activeLayer above current activeLayer

Community Beginner ,
Jul 23, 2013 Jul 23, 2013

Hello

I want the second Layer from the bottom to be my activeLayer.

I have already selected the bottom Layer by doing this:

#target photoshop

app.bringToFront();

var background = app.activeDocument.layers[app.activeDocument.layers.length -1];

app.activeDocument.activeLayer = background;

But I do not know how to set the activeLayer to be the one directly above my backgroundlayer.

Any suggestions?

TOPICS
Actions and scripting
357
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
Adobe
Guru ,
Jul 23, 2013 Jul 23, 2013
LATEST

The answer is in how you are selecting the background. Just change the -1 to -2 for the second to the bottom layer. In other words you are selecting by index so just change the index to select a different layer.

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