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.

error1.png

 

 

 

its removing next paragraph paragraph style. how fix thix issue.

 

 

error2.png

how places xml content story, without replacing existing content.




More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

Adobe Reader DC install error 150410

Error: 100600 Update failed, updates have been disabled by your system policy

ReferenceError: Window does not have a constructor : 325