Paste Subscript or Superscript into Rich Text Doc/Area (via Typed String)

##Macro Library Paste Subscript or Superscript into Rich Text Doc/Area (via Typed String)


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

####DOWNLOAD:
<a class="attachment" href="/uploads/default/original/2X/0/08264274347367858f73c578a99e6ebeff0027a9.kmmacros">Paste Subscript or Superscript into Rich Text Doc-Area (via Typed String).kmmacros</a> (18 KB)




####NOTE:  Trigger uses a Typed String with Regex
```
Subscript Trigger:  	 ;`\w+`
Superscript Trigger:	 ;\^\w+`
```
This allows you to type any number of letters and/or numbers between the <kbd>;\`</kbd> and <kbd>`</kbd> delimiters.  This delimiter can be easily changed in the macro.

**Please feel free to post any bugs, issues, or suggestions for improvement that you find.**


----------
<img src="/uploads/default/original/2X/a/a30365ce23b06528e0e5637a6b0d4093362995ff.gif" width="705" height="372">
----------

> Author:        @JMichaelTX

> PURPOSE:  Paste Subscript or Superscript based on Typed String into Rich Text Doc/Area

> APPS:  Requires an App that supports a Rich Text Document/text area.

> HOW TO USE:

> (1) In a Rich Text document or text aread, Trigger this macro by typing:
>     • The Prefix for sub/super script
>     • any number of letters and/or numbers,
>      • and terminated by the Suffix (default is a Backquote).

>     EXAMPLES:
```
       ;`2`      <=== for a SUBscript of 2
       ;^2`      <=== for a SUPERscript of 2
       ;`123`  <=== for a SUBscript of 123
       ;^S`      <=== for a SUPERscript of S
```

> (2) The macro will 
>         • Add a SPACE character in the normal font/style, and Move back one character. 
>         • Paste the numbers/letters that you typed with the same, but in sub/super-script format
>         •  Then delete the added SPACE, so you are ready to continue typing in normal font immediately after the sub/super-script.

> USER SETTINGS:

>   • Any Action in magenta color is designed to be changed by end-user
>   • Typed String Delimiters (Prefix and Suffix).  Current Delimiters are:
```
       • Prefix for SUBscript:      ;`
       • Prefix for SUPERscript:    ;^
       • Suffix for both:           `
```
>   • Style of Sub/Super-script
>       • Currently the ONLY style applied is either "subscript" or "superscript", but you could change the font if you wished.

> ACTION COLOR CODES
>   • To facilitate the reading, customizing, and maintenance of this macro,
>       key Actions are colored as follows:
>   • GREEN      -- Key Comments designed to highlight main sections of macro
>   • MAGENTA -- Actions designed to be customized by user
>   • YELLOW   -- Primary Actions (usually the main purpose of the macro)
>   • ORANGE  -- Actions that permanently destroy Varibles or Clipboards

> REQUIRES:  
> (1)  Keyboard Maestro Ver 7.0.3+
> (2)  Yosemite (10.10.5)+


----------


<img src="/uploads/default/original/2X/f/f1e08a6dd02d37d6dcc0ec59500a0885c26eb550.png" width="680" height="1199">
2 Likes

Macro has been revised. See original post above.

Thank you so much. That is exactly what I needed.