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

###MACRO: Paste Subscript or Superscript into Rich Text Doc/Area (via Typed String)
~~~~~ VER: 2.0 2016-05-14 ~~~~~

2016-05-14 18:42 CT (Sat)

####DOWNLOAD:
Paste Subscript or Superscript into Rich Text Doc-Area (via Typed String).kmmacros (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 ;` and ` 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.


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)+


2 Likes

Macro has been revised. See original post above.

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