5 Replies Latest reply on Feb 3, 2017 4:05 AM by garym50436266

    Script for unlocked layers only


      Hi All,
      I'm very new to scripting so still learning as I go.


      I have picked the following script up from this forum and changed a few things within. I'm looking to move all text frames from unlocked layers to a layer named 'HIDDEN'. The problem with this script is that it won't work with any of the layers locked and I have tried many things with no success.


      var myDoc = app.activeDocument;


          var myLayer = myDoc.layers.add({name:"HIDDEN"}); 

      }catch(e){myLayer = myDoc.layers.item('HIDDEN')};

      myDoc.textFrames.everyItem().itemLayer = myLayer;


      I would be grateful for any help.


      Many Thanks