New to KM! Can someone help me understand some very basic text related questions?

I have been trying to make Macros through trial and error for a week now and would like to know how to surround a selected sentence and add either "” around it or () or make my own custom characters. I know there is probably a very simple solution to this.

Also, is there a way to add custom colors to different characters so they are more easy to find in a wall of text?

Thanks in advance!

There is. This is my example to surround the copied text in a HTML H1 label. I'm sure you know how to revise it for your own purpose.
image

You may need to offer more details. There is an action to apply a style to the text in, for instance, the SystemClipboard. But I'm not sure if this is what you want.
image

Thanks! Been trying to figure this out.

What I would like to do is be able to wrap a sentence or line in quotes or parentheses. Have the parenthesis stand out as a different color and have the surrounded text a different color then the parenthesis. I will experiment with your suggestions!

@Barlow in what app?

Tested the following action in Word.
image

The blue color does not work. But the red color for quotes works.
image

I am just using various text edit apps.

Thank you so much!

Here is an example to get you started.
It uses quotes, but you can change those to parenthesis or any character/string you would like.

I have tested this in TextEdit and Word 365, and it seems to work well running Keyboard Maestro 9.2 on macOS 10.14.6 (Mojave).
One caveat: The quotes (or other added characters) may not match the font of the source document unless you specifically apply that font to the KM Set System Clipboard to Text action.

Below is just an example written in response to your request. You will need to use as an example and/or change to meet your workflow automation needs.

Please let us know if it meets your needs.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

MACRO:   Apply Style (Rich Text) to Selection [Example]

-~~~ VER: 1.0    2021-03-20 ~~~
Requires: KM 8.2.4+   macOS 10.11 (El Capitan)+
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))

DOWNLOAD Macro File:

Apply Style (Rich Text) to Selection [Example].kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


ReleaseNotes

Author.@JMichaelTX

PURPOSE:

  • Apply Specific Styling to Selection and Paste
    • The selected text will be replaced with the styled text

HOW TO USE

  1. First, make sure you have followed instructions in the Macro Setup below.
  2. See the below "How to Use" Comment Action
  3. This macro is just an example written in response to your request. You will need to use as an example and/or change to meet your workflow automation needs.

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. ??
      .
      Make These Changes to this Macro
  1. Assign a Trigger to this Macro .
  2. Move this macro to a Macro Group that is only Active when you need this Macro.
  3. ENABLE this Macro, and the Macro Group it is in.
    • For more info, see KM Wiki article on Macro Activation
      .
  • REVIEW/CHANGE THE FOLLOWING MACRO ACTIONS:
    (all shown in the magenta color)
    • Apply ONLY Foregroud Color to System Clipboard
      • Change to whatever styling you want for the selected text
    • Set System Clipboard to Styled Text
      • Change the style of the quotes as you want.

REQUIRES:

  1. KM 9.0+ (may work in KM 8.2+ in some cases)
  2. macOS 10.12.6 (Sierra)+

TAGS: @Example @Clipboard @Style @RichText

==USE AT YOUR OWN RISK==

  • While I have given this a modest amount 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 Macro Debugger from the KM Status Menu, and step through the macro, making sure you understand what it is doing with each Action.