Find variables from other apps, rerun the macro with different variables every time it restarts

Hi. I am new here and I just know the basics of KM. I have to send an email to many different people. I have a google sheet where I have all the artists names, real names and emails. I started a macro that works but I have no idea how I can take all the information I need from another app and replace using the variables in KM. I did tried to export the google sheets as comma-separated values and use variable arrays but it didn't work. Other thing I need to do (and I have no idea how) is to rerun the macro (since I have to send the same email to many different people) with the next destinatary (so next line in the google sheet). I would really appreciate if someone could help me with this tasks and since I am beginner, could explain how these things work so I can use in other situations,

Thank you so much!

You could get fancy with AppleScript to read from an excel workbook if you want to do it almost entirely within Keyboard Maestro.

I'd recommend just using some sort of mail merge software though. Google sheets has addons that would do it. MS Office can do it if you can bear to use Outlook (eww). My preference is to use SerialMailer.

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.

How To Use

  1. This will work with any spreadsheet (Excel, Google Sheets, etc)
    • When you copy from a spreadsheet, it will put TAB between fields, and LF between rows.
  2. Select all of the rows and columns (cells) that contain the data
  3. Trigger this macro

This macro assumes the following fields/columns:
• Full Name
• Phone 1
• Phone 2
• EMail

Of course you can use what ever fields you want.
You will just need to adjust the KM Search Action below.

Please let us know if it meets your needs.

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

MACRO:   Use SpreadSheet as Contact List [Example]

-~~~ VER: 1.0    2020-04-10 ~~~
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:

Use SpreadSheet as Contact List [Example].kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


ReleaseNotes

Author.@JMichaelTX

PURPOSE:

  • Demo Use of Spreadsheet for Contacts

NOTICE: This macro/script is just an Example

  • It is provided only for educational purposes, and may not be suitable for any specific purpose.
  • It has had very limited testing.
  • You need to test further before using in a production environment.
  • It does not have extensive error checking/handling.
  • It may not be complete. It is provided as an example to show you one approach to solving a problem.

REQUIRES:

  1. KM 8.0.2+
  • But it can be written in KM 7.3.1+
  • It is KM8 specific just because some of the Actions have changed to make things simpler, but equivalent Actions are available in KM 7.3.1.
    .
  1. macOS 10.11.6 (El Capitan)
  • KM 8 Requires Yosemite or later, so this macro will probably run on Yosemite, but I make no guarantees. :wink:

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. :wink:
      .
  • Assign a Trigger to this maro.
  • Move this macro to a Macro Group that is only Active when you need this Macro.
  • ENABLE this Macro.
    .
  • REVIEW/CHANGE THE FOLLOWING MACRO ACTIONS:
    • ALL Actions that are shown in the magenta color

USE AT YOUR OWN RISK

  • While I have given this limited testing, and to the best of my knowledge it will do no harm, I cannot guarantee it.
  • If you have any doubts or questions: