OL Learn

How to apply variable styles to Text Script


I wanted to share my technique for taking advantage of how Text Scripts automatically suppress blank lines (very useful for Address Blocks made up of several fields), but also apply different styles to the individual fields.

In short, click the “Expand” button to convert the Text Script to its underlying Javascript, then wrap the field you want to style in a span element. Lastly, style the span(s).

Figure_01 Figure_02


I hope this helps someone out there!


Thank you TDGreer for sharing your technique. the more we have user in the community doing this, the more interesting this forum will be.


Thank you for sharing it. As a note:

It is also possible to get the same result without expading to script. The span with class can be typed in Prefix und Suffix.



This approach is even better, thank you!