Superscript and subsrcipts for chemistry symbols

Hi,
I am trying to setup a macro that allows me to convert superscripts and subscripts on the fly as I type. Something like for example CO2 need to become CO₂. I am new to Keyboard Maestro but tried to use a text macro assuming that when the '_2' character is typed the macro will convert it into superscript text but that does not work! Could you please help.

The below macro should work for subscripts. You could easily modify it using different trigger to also work for superscripts.


<img src="/uploads/default/original/2X/9/9fa034801953dfe7d1745afcb7087c7530a06e23.gif" width="70" height="17"> 2016-05-14 18:54 CT (Sat)

OK, I have now made a major revision to the macro so that it works with BOTH SUBscripts and SUPERscripts;

See:
[MACRO: Paste Subscript or Superscript into Rich Text Doc/Area (via Typed String)](https://forum.keyboardmaestro.com/t/make-subscript-any-length-of-numbers-and-or-letters/3721)

The action in the macro you show is disabled, as can be seen by the grey background and the dimmed text. So it will do nothing.

There may be other issues, but that would be the first one to deal with.