This macro was formerly named: Augment or Filter Text.
If you have a version prior to Version 7.0, you will likely want to disable it before using this version.
Examples: Selecting from the Menu
Examples: Using Immediate Actions
PURPOSE
This macro is used to modify the selected text or, if no text is selected, the clipboard text. The text can be augmented or transformed in over seventy ways. Here are four simple examples:
The macro has been designed to provide Immediate Actions (via dedicated hot keys) for those used frequently; whereas selection from a list for those used less often.
By default, this macro is triggered using a hyper key (⌃⌥⇧⌘), plus letter T for general use. When this hot key is pressed a Prompt With List of Additions, Conversions, and Filters will appear. If one of the list options is selected, the choice will be applied to the text.
Due to the efficiency of the Keyboards Maestro Prompt With List action, any of the above Additions, Conversions, or Filters can be applied to the selected text (or clipboard text) with just a few keystrokes. However, for those that are applied frequently, there is an even faster option: direct actions applied using a designated hot key. These are referred to as Immediate Actions.
By default, ten additional hot keys are set for ten corresponding Immediate Actions.
Hyper+b
Hyper+i
Hyper+l
Hyper+v
Hyper+w
Hyper+x
Hyper+f
Hyper+s
Hyper+p
Hyper+d
If any of the above Immediate Actions are not needed, the hot keys can be removed from this macro.
SETTINGS
Refer to the comments above the three text variables local_Additions, local_Conversions, and local_Filters.
TESTED WITH
• Keyboard Maestro 11.0.3
• Sonoma 14.5 (23F79)/MacBookPro18,2
• Sonoma 14.5 (23F79)/VariableMacBookPro16,1
• Mojave 10.14.16/Macmini6,2
• High Sierra 10.13.6/iMac11,1445
VERSION HISTORY
( expand / collapse )
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 this header comment.
2.3 - No change to macro functionality. Improved this header comment.
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: Profile - _jims - Keyboard Maestro Discourse 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 ).
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 below: Syntax Description: SETTINGS (Additions)
4.0
a) Added Titles to the two Prompt With List actions.
b) Added an option to return the the Additions from the Filters Prompt With List.
c) Added an Addition: Quote Block
d) Modified the following Additions: Folding Section (added a horizontal rule below the text), the three KM Variables (improved the PWL labels), and KM Macro Download Annotation (improved the download annotation)
e) Improved the RegEx pattern that searches the Additions (that potentially include an Immediate Action hot key). The previous version did not function as expected for the modified Folding Section and the added Quote Block. Added a comment above the RegEx pattern to explain each RegEx element.
f) Updated the TESTED WITH section.
5.0
a) Renamed ‘Code Block’ to ‘Fenced Code Block’; added Fenced Code awk
, bash
, diff
, html
, objectivec
, perl
, python
, ruby
, xml
. Also added ‘Fenced Code Syntax’.
b) Improved the descriptions for local_Additions: <mark>
, <ins>
, and <del>
.
c) Updated the TESTED WITH.
6.0
a) Changed the macro name from Augment or Filter Text to Augment or Transform Text.
b) Transformations include the Filters and a new set: Conversions
c) The Conversions include eight conversions to unicode characters. This is done with a JXA function.
d) All actions (Additions, Conversions, and Filters) appear in a single Prompt With List.
e) Immediate Actions are no longer restricted to Additions.
f) Added three default Immediate Actions. See Hyper+s (plain text to Sans Serif Bold), Hyper+p (rich text to plain text) , and Hyper+d (all smart to dumb quotes).
g) Immediate Actions are denoted at the end of the Prompt With List items. For example, for <hk>s:ssb • Sans Serif Bold
, the PWL item is: ssb • Sans Serif Bold〈 s 〉
h) Added <div align="center"></div>
to the Additions; added '" • Convert All Quotes (Single and Double) to Dumb Quotes
to the Filters.
i) Eliminated the notification if no text is selected and the Clipboard is being used.
j) Improved the comments throughout.
7.0
a) Added a Prompt With List option to modify the macro. This makes it easier to modify the configuration.
b) Added a Prompt With List header line that displays the first 80 characters of the selected text (or if it being used, the Clipboard).
c) Displays an error if an Immediate Action hot key in repeated in the configuration.
d) Displays a dialog if no text is selected and if the Clipboard does not include text.
e) Modified the logic to significantly improve performance.
Download: Augment or Transform Text.kmmacros (151 KB)
Macro-Notes
- Macros are always disabled when imported into the Keyboard Maestro Editor.
- The user must ensure the macro is enabled.
- The user must also ensure the macro's parent macro-group is enabled.
System Information
- macOS 14.5 (23F79)
- Keyboard Maestro v11.0.3