0 Replies Latest reply on Sep 14, 2015 2:56 AM by banl_05

    page anchor with selected style

    banl_05 Level 1

      Hi Everyone,

       

      How can i placing library item into page and selected style anchor into the library item. Please any one can help me....


      Here is my code


      var myDocument = app.activeDocument;

       

      FindEmail(myDocument);

       

      function FindEmail(elm)

      {

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

          {

              XMLelementName=elm.xmlElements[i].markupTag.name.toString();

       

              if(XMLelementName=="cl:sidebar")

              {

                  elm.xmlElements[i].select();

                var myPlacedAsset=app.libraries.item(0).assets.itemByName("MN1_TEXT").placeAsset(elm.xmlEleme nts[i].insertionPoints[0])[0];

       

                  var myElement = elm.xmlElements[i];

                  myPlacedAsset.appliedObjectStyle=app.activeDocument.objectStyles.item("ObjStyle");

       

                  var mymove=myElement.move(LocationOptions.atBeginning,myPlacedAsset.insertionPoints[0]);

       

              }

       

              FindEmail(elm.xmlElements[i]);

          }

       

      }

       

      Your help will be much appreciated. Thanks in advance

       

      Balaji B.