Why won't this URL create an Airmail email via "Open URL" (but will if I paste in Chrome)?

Since Evernote wants to force us to use their system for sharing, I am making it easy to email a link to a note. (Actually this is going to be part of a larger scheme of pop-up sharing options that looks the same across apps but takes action based on the active app--that's why it's getting the App name and doing the "switch"...)

This macro creates a URL scheme that should create the message in Airmail, and in fact if I paste the clipboard contents (same URL) into Chrome (my default browser), it does so! But the "Open URL" action with the same string seems to do nothing. Am I missing something?

Pic is below, and attached the macro if you want to try.



What happens if you filter the clipboard with "Percent Encode for URL" before setting it to the subject and body text variables?


Also, are the [] brackets supposed to be part of the URL? I'm guessing it should probably just be airmail://compose?subject=%Variable%Local_subject%&plainBody=%Variable%Local_bodyText%

EDIT: I ended up modifying your macro and testing it for myself, and can confirm that this works (I also simplified it a bit while I was at it). New or changed actions are marked in yellow except for the engrouping Switch:

e email.kmmacros (7.4 KB)

1 Like

Thank you very much for this--I'm way behind in my inbox obviously :slight_smile: Appreciate you testing your solution as well!

1 Like

In this new version, I tried to make the body text include the subject, and then the link on the next line, by setting Local_bodyText to this:


But I'm getting "%20"s instead of spaces in the subject text in the body. Am I missing something?

[Oh, and I got a clue and read how to upload the code :slight_smile: FYI, this version also includes two little functions, "Sub CLIPBOARDSEED set" and "Sub CLIPBOARDSEED wait for change", which can be deleted for the purposes of testing. They make sure Evernote successfully copied a public link to the keyboard before I try to compose the email!]

Thanks again,

The macro: e email.kmmacros (7.3 KB)

A pic of the macro:

That's a result of the Filter with Percent Encode for URL action. Try this: