PURPOSE
This macro is used to modify selected text or the clipboard text, if no text is selected. The text can be augmented* or filtered** in many ways. Here are three simple examples:
Task done → ~~Task done~~ —one of several Markdown additions
"Hi there." → “Hi there.” —dumb quotes converted to smart quotes
local_Var → %Variable%local_Var% —Keyboard Maestro variable
The macro has been designed to provide immediate additions (via dedicated hot keys) for those used frequently; whereas selection from two lists*** for those used less often.
*text Additions can easily be added to the 36 initially configured
**text Filters can be easily added to the 21 initially configured
***there is one Keyboard Maestro Prompt For List for text additions and one list for text filters
DEMONSTRATION
The following video includes four quick demonstrations of this macro: https://youtu.be/Yvnwopo6fio
SETTINGS / HOT KEYS
By default, this macro is triggered using a hyper key (⌃⌥⇧⌘), plus letter T for general use. When this Hot Key is pressed the a text Additions Prompt With List will appear. If one of the 36 default options is selected, the choice will be immediately applied to the text. Alternatively, if /+<return> is typed the Skip below additions, continue to text Filters choice will dismiss the text Additions and a second Prompt With List with text Filters will appear. Here one of the 21 Filter default choices can be similarly applied.
Due to the efficiency of the Keyboards Maestro Prompt With List action, any of the above 57 (36+21) text transformations can be applied to selected text with just a few keystrokes. However, for Additions that are applied frequently, there is an even better option: immediate addition with a designated Hot Key (a.k.a. Immediate Additions). By default, eight additional Hot Keys are set for eight corresponding Immediate Actions.
(In the following selected_text will be augmented with the indicated additional text.)
Hyper+b
**selected_text**
Hyper+i
*selected_text*
Hyper+l
[selected_text](A_LINK)
Hyper+v
%Variable%selected_text%
Hyper+w
selected_text : [%Variable%selected_text%]
Hyper+x
selected_text
………………………………
%Variable%selected_text%
Hyper+m
DOWNLOAD Macro File:
<mark>selected_text</mark>
*Note: This macro was uploaded in a DISABLED state. It must be ENABLED before > it can be run. If it does not trigger, the macro group might also need to be ENABLED.*
Hyper+f
<details><summary>Macro-image</summary>
selected_text
</details>
If any of the eight above Immediate Additions are not needed, the Hot Keys can be removed from this macro.
Refer to the comments above the two text variables local_Additions and local_Filters for more information about adding Additions, Filters, or Immediate Addition Hot Keys—like the eight indicated above.
TESTED WITH
• Keyboard Maestro 10.2
• Ventura beta 13.2 (22D49)/MacBookPro16,1
• Mojave 10.14.16/Macmini6,2
• High Sierra 10.13.6/iMac11,1445
VERSION HISTORY
1.0 - Initial version
2.0 - In the Filters section, added:
• Smart Smart Single Quotes to Dumb Single Quotes
• Reddit User Link to Reddit User
• Quoted URL to URL
The three additions to the Filter section employ regular expressions since the Keyboard Maestro Filter action does not provide these options.
2.1 - Bug fix. Delete Past Clipboard 0 should only be executed when %SystemClipboard% <> %Variable%local_SysCb%
2.2 - a) Added to local_Additions corresponding to the following Hot Keys: Hyper+w, x, m, and f. b) Improved the macro header comments.
2.3 - No change to macro functionality. Improved the macro header comments.
2.4 - Changed the two Prompt With List actions to Automatic Width.
2.5
a) Removed superfluous colon ( : ) from Hyper+w.
b) Corrected typographical errors in the header comment.
c) Updated TESTED WITH information.
3.0
a) Simplified the format of local_Filters.
b) Added a Filter: KM Forum User URL to @User (example conversion: https:/forum.keyboardmaestro.com/u/_jims/activity to @_jims.
3.1
a) Added a Filter: Plain Text
b) For KM Forum User URL to @User generalized the regex search to enable more conversions (e.g., Markdown links: [@_jims](Profile - _jims - Keyboard Maestro Discourse) ).
c) For Convert Double Quotes to Dumb Quotes changed from the Filter action to the Search and Replace action because there may be times when the smart quotes do not match.
d) Corrected a typo in this comment and deleted a n/a note in the comment: Syntax Description: SETTINGS (Additions)
DOWNLOAD Macro File:
Augment or Filter Text.kmmacros (98 KB)
Note: This macro was uploaded in a DISABLED state. It must be ENABLED before it can be run. If it does not trigger, the macro group might also need to be ENABLED.