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

P: Photoshop JavaScript bug with merge and layer visibility

Community Beginner ,
Jan 06, 2017 Jan 06, 2017

Copy link to clipboard

Copied

Here are sample PSD file and simple script that iterates through all top layers and make them invisible. In case there is a LayerSet script call merge() to it before making it invisible. The problem is after calling merge() to LayerSet_1 already processed and invisible Layer_1 become visible again. The issue is only occur if Layer_1 is selected when script is launched. If LayerSet_1 is selected - there are no issues.
https://www.dropbox.com/sh/jg7ttctcramooxd/AAD4ZAJXTVi6eKuOTkB9t7hDa?dl=0

Bug Won't fix
TOPICS
macOS , Windows

Views

140

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

Adobe Employee , Jan 06, 2017 Jan 06, 2017
Hi,

Thanks for the sample image/script, I can reproduce this and will investigate further. One workaround is to set the active layer with the current loop layer:

for (var i = 0; i < doc.layers.length; ++i) {           
            var layer = doc.layers[i];
            app.activeDocument.activeLayer = layer;
...

Thanks for the report!

Eric

Votes

Translate

Translate
1 Comment
Adobe Employee ,
Jan 06, 2017 Jan 06, 2017

Copy link to clipboard

Copied

LATEST
Hi,

Thanks for the sample image/script, I can reproduce this and will investigate further. One workaround is to set the active layer with the current loop layer:

for (var i = 0; i < doc.layers.length; ++i) {           
            var layer = doc.layers[i];
            app.activeDocument.activeLayer = layer;
...

Thanks for the report!

Eric

Votes

Translate

Translate

Report

Report