AppleScript and Navigating Mail

Appreciated, tested and understood.

Everything is working as it should other than the your "find without image" macro. I have no idea why it is not working. I will dig in time permitting as I am curious.

In the end, that the "move" macro finds both single and multi-word searches means it will be teh macro that I incorporate on my work flow though, I am still curious. Just saying!!

1 Like

@Nige_S and @griffman

A quick update.

I took your words to heart and built a new version of this macro which is a combination of Keyboard Maestro, Python and SQL which addresses the concerns that you raised.

  1. I learnt that Mail logs each and every emlx e-mail / file that it receives or sends. I constructed a Python Script that accesses this data and builds an SQL database containing the source information in its native form.

  2. I then access the SQL database in reformatting the header by matching the responding e-mails message_id to the message_id in the database ensuring a correct match and preserving localization.

The package consists of a Keyboard Maestro macro and three Python Scripts (i.e., one for building the stabs, one for extracting information from the database and one for determining the header characteristics). Happy to share with anyone who is interested!

The one item that is not addressed are headers for e-mails that are not logged by Mail which are essentially e-mail in which I am added mid-stream (because earlier e-mails have not been logged by Mail and are therefore not in the database).

While it would be great to be able to include these e-mails -- which the previous build did -- the accuracy, reliability, speed (SQLite is fast!), etc. of the current approach outweighs this shortcoming.

Much thanks for "pushing me" to make things better.

1 Like