Glorious. This is why I love KM and these forums. Those of us that don't use apple mail (if that's what it's called still) were missing out on a lot of potential workflows. Many thanks.
I would just do that in the KM Macro, after you have received the results from the AppleScript.
If you use the last script I posted, if there is no recipient name, then you should get a result like this:
Sorry, I used the last version but I get a blank result:
Hello , thanks for contacting us.
Here's my macro:
Insert Text by Pasting.kmactions (511 B)
You uploaded just one Action, not your entire Macro.
You must first select the Macro in the Macro panel, then export/share.
IAC, I would need to see a screenshot of the header part of the Airmail message you are replying to. Or even better, do a manual forward of the message, and get s screenshot of the part which shows the sender's name/address.
This has stopped working for me also. Here's a screenshot of the header as I can see it from airmail.
I don't know if this raw source excerpt helps? I've xxx'ed out some details in case of web crawlers (I really don't know the etiquette or best practice with that, but I've done it anyway). This did work when I first tried it.
Received: from Damians-MacBook-Pro.local.mail ([xx.xxx.121.237])
by smtp.gmail.com with ESMTPSA id k7-v6sm7814259wrq.82.2018.06.23.11.12.57
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Sat, 23 Jun 2018 11:12:57 -0700 (PDT)
Sender: Damian Evans firstname.lastname@example.org
Date: Sat, 23 Jun 2018 19:12:26 +0100
From: Damian Evans email@example.com
To: Damian Evans firstname.lastname@example.org
Subject: Test email
X-Mailer: Airmail (481)
Content-Type: multipart/alternative; boundary="5b2e8da8_46a7053e_3ca0"
Content-Type: text/plain; charset="utf-8"
This is a test email to myself.
Keyboard Maestro Actions.kmactions (5.5 KB)
Please ensure that you first create a reply window, then trigger the macro:
Sorry, here's the macro:
Contact ES > (fanold).kmmacros (6.8 KB)
And the screnshot:
In my macro, I built the reply in. I also tried taking that out of the macro and replying manually.
OK guys, we will have to run some diagnostics.
- Open Airmail, and click on "Reply" to the message where you are having a problem.
- Open Script Editor, and run this script:
tell application "System Events" tell application process "Airmail" # "Airmail Beta" OR "Airmail 3" tell window 1 tell scroll area 1 tell text field 1 set toRecipStr to (its value of item 1 of static text) end tell end tell end tell end tell end tell return "toRecipStr: ❯❯❯" & toRecipStr & "❮❮❮"
- In the Results/Log area of Script Editor, you should find text like this:
"toRecipStr: ❯❯❯FirstName LastName <email@example.com>❮❮❮"
- But maybe it will be incomplete.
- Just copy whatever is there, and post back here.
Once I can see exactly what you are getting from the script, I should be able to fix it.
Sorry for delay - other things took over but I'd still like to get this working and appreciate the help.
This was the result:
"toRecipStr: ❯❯❯Damian Evans firstname.lastname@example.org❮❮❮"