Skip to content

more concise way for wrapping selected text #44

Description

@haukelicht

Hello!

I love to work with your KM macros. Yet, I wonder whether your Make italic (Make bold) and Wrap ... macros could be defined more concisely.

Specifically, I'have experimented with the %|% (Location cursor) token to insert text at the current cursor location (which is where selected text is, when one wants to wrap it in *, **, etc.). I have, for example, defined an alternative action flow to wrap selected text on both ends with asterisks (*) to make it appear italic in markdown (see also attached image):

  1. Execute Macro "Helper - Is text selected?"
  2. Cut to Named Clipboard "Temporary"
  3. Insert Text "%|%%NamedClipboard%Temporary%%|%" by Pasting
  4. Set Named Clipboard to "%Delete%"

This way of making selecting text appears to be faster, since it does not involve waiting times. Are there any caveats to defining the "Make Italic" Macro in this way in your opinion?
km_macro_mardown_make_italic

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions