Create New Parent Element of tag
Hi...
I want to create new parent element of tag through scripting just like we do manully in indesign.

Thank you.......
Hi...
I want to create new parent element of tag through scripting just like we do manully in indesign.

Thank you.......
Hello payalm,
Try this below code for your reference,
var myDoc = app.documents[0]
var myCurrentNode = app.selection[0];
var parentNode = myCurrentNode.parent.xmlElements.add('TestNode');
parentNode = parentNode.move(LocationOptions.BEFORE,myCurrentNode);
myDoc.recompose();
myCurrentNode = myCurrentNode.move(LocationOptions.AT_BEGINNING,parentNode);
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.