InDesign CS: Applying XML tags and attributes to a range of text

I’ve got a situation where I need to quickly and repetitively apply XML tags and attributes in InDesign CS. (I may also need to do this in CS2 down the line, but CS is the pressing problem.) What I’m trying to do is:

  1. Apply an XML tag (in this case, “span”) to a manually selected range of text.

  2. Apply a specific attribute (“class”) and attribute value (“category”) to the XML tag that was just created.

(Desired end-result in XML: Selected Text)

Simple, right? Except I can’t figure out the AS syntax for applying these tags and attributes to save my life. Looking at the InDesign CS dictionary, there’s a command called “markup” that seems like it should work, but I can’t figure out how to get it to apply to a selected range of text.

Anybody got any good ideas?

Sorry ggaspard, not got the answer but wanted to ‘wake up’ this thread becasue I am looking for the same thing… did you or anyone have an answer for this?

looking for the method to apply tags in InDesign CS2 using applescript (there seem to be lots of referneces to removing tags, but none about adding them!) please reply to let be know

Thanks in advance, Ken

Would it work to dump the text out of InDesign, style it in MS Word or TextEdit, then reimport it?

Also, don’t know if this is useful but Late Night Software has a free XML toolkit for Applescript.
http://www.latenightsw.com/freeware/XMLTools2/index.html

Hi

Not sure if this covers what your after but it seems awfully familar.
Checkout this recent post for more details!
http://bbs.applescript.net/viewtopic.php?id=22576