As a newcomer to this powerful tool, I'm in need of some assistance with a specific script. My goal is to modify certain text segments within select emails, but I'm facing some challenges due to the variability in their formatting. Specifically, I'm trying to find the first instance of "From:" and replace the ensuing header with a simplified version, such as "On Wednesday, November 29, 2023 at 19:35, 'First Last' wrote:". This script is intended to run only on certain emails, not all.
Here's an example of the standard format I'm dealing with:
From: First Last <first.last@example.com>
Date: Wednesday, November 29, 2023 at 19:35
To: to@example.com
Cc: cc@example.com
Subject: New list
The main issue arises with the 'From' field, which might contain just a first name at times, and the occasional absence of the 'Cc' field. I would be extremely grateful for any advice on crafting a macro in Keyboard Maestro that can effectively handle these variations.
Thank you all in advance for your time and assistance!
Once you've read the above information and dive in, you'll find that there are many friendly users that are happy to assist.
Regarding your objective, I have a couple questions/comments:
What email application are you using?
Finding and selecting the text block to be replaced would be the most difficult, if not impossible (depends on the email program), automation challenge. However, if you selected the text, and triggered a macro (e.g., with a hot key) it is relatively easy to replace the selected block with the format you specified. See below.
From: Microsoft <microsoft-noreply@microsoft.com>
Date: Monday, December 04, 2023 at 10:25
To: Name <name@example.com>
Subject: You’ve renewed your Microsoft 365 Business Standard subscription