Move more then one xml element to particular script labeled textframe
#include "glue code.jsx";
var mydoc = app.activedocument;
var mylabel = "received";// change label
var mypage = app.properties.activewindow && app.activewindow.activepage;
var mytextframes = app.activedocument.textframes.everyitem().getelements().slice(0);
l = mytextframes.length,
//____________________ xml rule set
var myruleset = new array (new move_element);
with(mydoc){
var elements = xmlelements;
__processruleset(elements.item(0), myruleset);
}
function move_element(){
this.name = "r";
this.xpath = "//a";
this.apply = function(myelement, myruleprocessor){
with(myelement){
// app.select(myelement);
// try{
while (l--)
{
if (mytextframes[l].label != mylabel) continue;
myelement.placexml(mytextframes[l])
// break;
mytextframes[l].fit(fitoptions.frame_to_content);
}
// }catch(e){}
}
return true;
}
}
i need move more 1 xml element particular script labeled text frame at time can move 1 element.
also while move element script throws below error message.
its removing next paragraph paragraph style. how fix thix issue.
how places xml content story, without replacing existing content.
More discussions in InDesign Scripting
adobe
Comments
Post a Comment