You can apply paragraph style (which contains the alignment you want) via
Try to find () separating them in
groups using the (). And then change to $2 (which is your second group /
your content) and apply the correct para style you want. Use grep
find/change script methods.
All you need is use map tags to styles in the tags panel…
Hi Corullon and Loic,
Thanks for your response.I have got it.But now I have a tag for alignment as <p style="text-align: left;"> .I am able to only map tags with <p> and so but I am unable to apply my styles for tags, <p style="text-align: left;"> for alignment.What do I have to do now?
I would do using a script, as I mentioned.
But comparing my first found group with a string. If the string is the same
as found, apply the paragraph aligning to the left. Else, applying another
one or doing nothing.
Am I clear?
Em 20 de mai de 2017 8:48 AM, "revathiv80720177" <firstname.lastname@example.org>
Adobe Community <https://forums.adobe.com/?et=watches.email.thread>
Alignment in InDesign using Scripts
resposta de revathiv80720177
em InDesign Scripting - Visualize a discussão completa
Hi Corullon and Loic,
I have to apply paragraph styles to tags in xml while importing xml. Now I can apply styles only for tags <B> and so.But for alignment I have tags as <P style="text-align: left;"> or <P align =center> ,in xml.I am mapping tags to styles as <B stylename="Bold Style" />.But how shall I map my alignment tag to style, <P style="text-align: left;"> or <P align =center>.I tried to map it as <P align center stylename ="left align">.But it was invalid mapping.How shall I map my alignment tag to styles.
A solution would have been to use XSLT and namespaced attributes such aid:pstyle and aid:cstyle so a node can call a specific text style on import.
Once that said, I gave this a try yesterday but although my xsl worked fine on Oxygen plus my transformed XML nicely injected in InDesign. It just failed when the transformation occured inside indesign.
Obviously the style="text-align: left;" syntax isn't properly understood by the inner xslt engine :\
Thank you for your response.Is there any possibility to apply this tag for alignment or I have to change the tag in xml.Guide me.
I thought i just did. if you need styles applied on import, and given that you can't Map a same node with différent styles, then the solution is change the xml structure so either tag names are changed or use the namespaced aid:pstyle attribute.