Macro to search all comments?

I know that I can find macros by text in comments using the main KM UI, but is there a way to set up a macro like "Trigger Macro by Name" but for comments?

not that I know.

I think it'd be hard to use because of a very high occurrence of extremely common words like "I", "date", "automate", "do", "etc"

The only way I know to limit a search of the KM Editor to text in Comment Actions is to use an AppleScript that first finds all Comment Actions, and then searches the XML of that Action for the search terms. This is doable, but very complex, so I can not offer that solution.

However, as a workaround, here is a Macro that provides an ==imperfect search== that does this:

Searches all KM Macros in the KM Editor app to find macros that contain both:

  • The text "Comment" (which will match Comment Actions, but also that term anywhere in the Macro)
  • One or more user-chosen search terms, which may, or may not, be in a Comment Action.
    • image

The macros that are found are listed in the KM Editor Macros panel.

  • image

The Actions that contain the search text are highlighted in the blue/grey hatch pattern

  • image

Again, this is imperfect and may find the search text that is NOT in a Comment Action. But it will find the search text in a Comment Action.

I welcome all improvements to this macro.

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:   Global Search of Comment Actions [Example]

-~~~ VER: 1.0    2021-03-24 ~~~
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:

Global Search of Comment Actions [Example].kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


ReleaseNotes

Author.@JMichaelTX

PURPOSE:

  • Global Search of Comment Actions [Example]
    • This Provides an imperfect Search for Text in Comment Actions
    • As written, will find macros, and highlight the Action, that contains both text of "Comment" and the user-selected search term, but the search term may not be in a Comment Action.

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)
    • CHANGE This List to be Your Search Terms

REQUIRES:

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

TAGS: @Example @Search @KMEditor @Comment

1 Like

Thank you, good sir! Much appreciated!

1 Like