3 Replies Latest reply on May 16, 2014 1:23 AM by kanaga kumar

    Anno layer

    kanaga kumar Level 1

      Dear Friends,

       

      I need all anno styles map in anno layer, the below script doing only created anno layer.

      My requirement is find the anno paragraph style and map in anno layer (see the screen shot for my requirement.)

       

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

      var myLayer = myDocument.layers.add();

      myLayer.name = "Anno";

      myLayer.layerColor = UIColors.TEAL;

      myLayer.ignoreWrap = false;

      myLayer.visible = true;

       

      My Requirement.png

       

      Thanks

      kanaga kumar.k

        • 1. Re: Anno layer
          Jump_Over Level 5

          Hi,

          You can not apply a layer to

          • paragraphStyle
          • text
          • story
          • etc;

          you even can not do it to a textFrame if it is treated or inside a group of objects.

           

          So reconsider your goal.

           

          Jarek

          • 2. Re: Anno layer
            Chinnadk Level 4

            Hi Kanakumar,

             

            Is this you need?

             

            var doc = app.activeDocument;

            app.findTextPreferences = NothingEnum.nothing;

            app.changeTextPreferences = NothingEnum.nothing;

            app.findTextPreferences.appliedParagraphStyle = doc.paragraphStyles.item("anno");

            var myfind = doc.findText();

            for(var i=0;i<myfind.length;i++)

            {

                myfind[i].parentTextFrames[0].itemLayer = doc.layers.item("anno");

            }

            app.findTextPreferences = NothingEnum.nothing;

            app.changeTextPreferences = NothingEnum.nothing;

             

            Regards,

            Chinna

            • 3. Re: Anno layer
              kanaga kumar Level 1

              Dear Chinna,

               

              Many thanks for your help, and your are brilliant.

               

              Thanks