0 Replies Latest reply on Mar 6, 2013 7:45 AM by thevoiddigital

    Indesign text tagging

    thevoiddigital

      Hi

       

      Is it possible to tag a portion of text, so a Text or Word object without it sitting in a Story?

       

      Something like this.

       

      var app:Application = InDesign.app;

      var doc:Document = app.activeDocument;

      var root:XMLElement = doc.xmlElements.firstItem()

      var selection:Object = doc.selection[0];

       

      var node:XMLElement = root.xmlElements.add("MyTagName");

      XMLElement(node).markup(selection);

       

      This throws the following error

       

      Error: Cannot change the element to be associated with this object. Try creating a new element.

       

      or

       

      var node:XMLElement = root.xmlElements.add("MyTagName", selection);

       

      puts the new element inside a Story element.

       

      Thanks for any help.