5 Replies Latest reply on Aug 14, 2010 1:24 PM by Marijan Tompa [tomaxxi]

    Placing grouped library element in anchor

    Green4ever Level 3



      I am trying to place a library element (object style H1 applied) at starting of each paragraph, which has the paragraphstyle H1. I think error occurs in the highlighted text. Can any one help on this please.... And also please tell me what the error is...



      var doc = app.documents[0];
      var Lib = app.libraries[0];
      app.findTextPreferences = NothingEnum.nothing;
      app.changeTextPreferences = NothingEnum.nothing;
      app.findTextPreferences = null;
      app.findTextPreferences.appliedParagraphStyle = "H1";


      myFind = doc.findText(true);
      var myCount=0;
      for (i=0; i<myFind.length; i++)
         myText = Lib.assets.item ("H1boxa").placeAsset (myFind[i].insertionPoints[0])[0];
          myText.appliedObjectStyle = "H1";


      Thanks in Advance.....