Can you please show us a series of screenshots that demonstrate how you would accomplish this in the UI, without scripting?
It's very hard to tell what you wish to accomplish.
My question is that when i select my power math equation " [&x+2, y+3&] " then run script, script automatically add these tags.
<inlineequation><inlinemediaobject><textobject role="xpressmath">[&x+2, y+3&]</textobject></inlinemediaobject></inlineequation>
2: Script automatically add these xml tags in my InDesign CS4 file. Like GREP as done "Positive Lookahead" "Positive Lookbehind ".
Unfortunately i past my screenshots its disappear on the screen so i send manual code.
Sorry for the delay.
Is this any script when i select my power math equation data then add xml tags automatically
Oh, you just want to operate on the selection?
This is pretty easy then:
var d=app.activeDocument, root=d.xmlElements, ie = root.xmlElements.add("inlineequation", app.selection), im = root.xmlElements.add("inlinemediaobject", ie.texts), to = root.xmlElements.add("textobject", im.texts); to.xmlAttributes.add("role", "xpressmath");
I feel like that's a little kludgey and that there's a better way to add objects and maintain the hierarchy, but that was the fastest way I could make it work.
Thank you sooooo much.
Your code worked absolutely great. Thank you so much! It was exactly what i needed.
Kudos to you.
Once again thank you so much!!!
I should add, if you have a number of these to do, there is probably a better way. For instance, if you can build a regular expression that identifies these equations ("anything in brackets"?), then you have the script search for them and automatically tag all of them. Or even, I suppose, search for them, highlight them, and let the user decide yes/no if that is a valid equation. etc...
There are a lot of possibilities.
Hello John Sir,
Thank you so much for you replay.