15 Replies Latest reply on Jul 19, 2018 7:40 AM by Kukurykus

    How to select active layer?


      It appears that in order to resize the layer it has to be selected(from UI perspective) and active from API perspective. Otherwise I get error on any function call that this function is not supported.


      So before resizing I do


      var a = doc.artLayers.getByName("iPad");
      app.activeDocument.activeLayer = a;


      This doesn't visually change selected layer hence calling resize function fails after that. The only way to get it work, manually click on layer(any layer), then it works.

      What is the proper way to resize layer without user interaction?