Extract Q&A With Multiple Lines and Multiple Answers [Example] Macro (v9.2)

Use Case

  • Provide solution to a dynamic string of Question and any number of Answers
  • The Question and Answers may contain multiple lines
  • Each Answer will be put in a separate KM Variable

This macro written in response to Add Clipboard Lines to a Variable .

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

Example Output

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

MACRO:   Extract Q&A With Multiple Lines and Multiple Answers [Example]

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

Extract Q&A With Multiple Lines and Multiple Answers [Example].kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


ReleaseNotes

Author.@JMichaelTX

PURPOSE:

  • Extract Q&A With Multiple Lines and Multiple Answers [Example]
    • Allows for the Question and Each Answer to be multiple lines
    • Allows for any number of Answers
    • Each Answer must start with a letter (a-z) and then a right parenthesis ")"

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)
    • SET Source String
      • Used for Testing. Change to your Q&A test string. DISABLE for Production.
    • ENABLE to Copy Selection and Set SourceStr to Clipboard
      • Enable this Action for Production

REQUIRES:

  1. KM 9.0+ (may work in KM 8.2+ in some cases)
  2. macOS 10.12.6 (Sierra)+
  3. Each Answer must start with a letter (a-z) and then a right parenthesis ")"

TAGS: @Example @RegEx @DynamicVariable @Q&A @DynamicList