This script for placing library item into page and applying object style to the item. In line 16, script shows that "assets" property does not support. Please resolve this.
if (app.documents.length==0){ alert("Please open the Document"); exit(); } if (app.libraries.length==0){ alert("Please open the Library"); exit(); } app.findTextPreferences=app.changeTextPreferences=null; app.findTextPreferences.appliedParagraphStyle="MN"; var myfound=app.activeDocument.findText(); alert(myfound.length); for(i=0; i<myfound.length; i++){ var mylib=app.libraries.assets.itemByName("Box").placeAsset(myfound[i].insertionPoints[0]); var mymove=myfound[i].move(LocationOptions.atBeginning, mylib.insertionPoints[0]) mylib.appliedObjectStyle="MN_Obj"; }