Quantcast
Viewing all articles
Browse latest Browse all 85594

MN Elements in XML Jobs

Hi All,

 

I need to pull out the following marginal tags in XML jobs.

 

I hope problem is in coding 18th line.

 

Screenshot:

 

Image may be NSFW.
Clik here to view.
Screen Shot 2014-07-17 at 11.14.24 AM.png

 

 

Coding is below:

 

var myDoc = app.activeDocument; 

var myLib = app.libraries[0];

var myXMLElement = app.activeDocument.xmlElements[0].evaluateXPathExpression("//marginalnote");

alert(myXMLElement.length);

for(i=myXMLElement.length-1; i>0; i--)

{
        var myText = myXMLElement[i].texts[0];               alert(myText.contents)               var myLibraryAsset = app.libraries[0].assets.item("box").placeAsset(myXMLElement[i].insertionPoints[-1])[0];               var myTextMove = myXMLElement[i].texts[0].move(LocationOptions.AT_END, myLibraryAsset.insertionPoints[0])           //Problem in this only                myLibraryAsset.appliedObjectStyle = myDoc.objectStyles.item("Box")        myLibraryAsset.fit(FitOptions.frameToContent)    }

 

Thanks in advance

Siraj


Viewing all articles
Browse latest Browse all 85594

Trending Articles