Use Case
Provide a text expansion (typed string) macro that handles the following:
- Starts on a word boundary
- Uses the punctuation that was typed
- Case of Output Replacement String is set based on Case of Typed String
So, the output could be any of these:- anybody
- Anybody
- ANYBODY
- plus the typed punctuation.
MACRO: Text Expansion with RegEx [Example]
~~~ VER: 2.0 2019-05-17 ~~~
DOWNLOAD:
Text Expansion with RegEx [Example].kmmacros (14 KB)
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.
This macro was built in response to:
Typed String Typing Speed - Faster?
ReleaseNotes
Author.@JMichaelTX
PURPOSE:
- Example of Text Expansion that Handles Case and Punctuation
HOW TO USE
- First, make sure you have followed instructions in the Macro Setup below.
- Macro is triggered by Typed String
- Start a new word that uses the typed text of "anb" (any case) and ends with a Space, Period, Comma, or Question Mark.
- IF all text is all CAPS, then the output will be all upper case
- IF only the first character is CAPS, then the output will be with only the first character in uppder case.
MACRO SETUP
-
Carefully review the Release Notes and the Macro Actions
- Make sure you understand what the Macro will do.
- You are responsible for running the Macro, not me. ??
.
- Assign a Trigger to this maro.
- Move this macro to a Macro Group that is only Active when you need this Macro.
- ENABLE this Macro.
.
-
REVIEW/CHANGE THE FOLLOWING MACRO ACTIONS:
(all shown in the magenta color)- Set to the word or string to be output
- Should be all lower case, no punctuation
- Set to the word or string to be output
REQUIRES:
- KM 8.2+
- macOS 10.11.6 (El Capitan)
TAGS: @TypedString @TextExpansion @RegEx
USER SETTINGS:
- Any Action in magenta color is designed to be changed by end-user
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 Variables or Clipboards,
OR IF/THEN and PAUSE Actions
USE AT YOUR OWN RISK
- While I have given this a modest amout of testing, and to the best of my knowledge will do no harm, I cannot guarantee it.
- If you have any doubts or questions:
- Ask first
- Turn on the KM Debugger from the KM Status Menu, and step through the macro, making sure you understand what it is doing with each Action.