3 Replies Latest reply on Nov 8, 2012 7:51 AM by sundar_r

    Move text frames to a separate layer

    sundar_r

      I am new to Indesign scripting. I have an simple task, which needs your help.

       

      Task: I want to move all the text frames which contains a particular swatches applied to the content. I had wirtten the below script, but it's not working. The execution get finished without errors, but the result in nothing happened.

       

      var mydoc=app.documents.item(0);

      var mytexts=mydoc.stories.everyItem().paragraphs.everyItem().getElements();

       

      for (i=0;i<mytexts.length;i++) {

          var mytext=mytexts[i];

         

          if (mytext.contents.fillColor=="swatches"){

          mytext.parentTextFrames.everyItem().itemLayer=mydoc.layers.item("test");

          }

      }

       

      Hope you experts will rectify this.

       

      Thanks much in advance