~rjarry/aerc-discuss

4 3

open mailto links in aerc - MacOS

Details
Message ID
<D1FVLZFANBQO.T5Z8R5AVJHKI@tjex.net>
DKIM signature
pass
Download raw message
I've found and read the posts on this topic referring to Linux, and tried to 
base a MacOS approach off of them. But no success.

here: 
https://lists.sr.ht/~rjarry/aerc-discuss/%3CCKYC0V7HN6C9.1GRJSGX8UBNJB@t480s%3E

and here: 
https://lists.sr.ht/~rjarry/aerc-discuss/%3C936c486b-9bc4-489e-9bbb-f62dbe23df27@posteo.me%3E

Has anyone managed to setup a handler or know of a project that can be used as 
a target for mailto: links, which will effectively open them in aerc?

i.e. Clicking on mail@foo.com on a website will open and populate the compose 
view in aerc (via IPC), which would otherwise just be `aerc mailto:mail@foo.com` 
via the CLI.
Details
Message ID
<D1G5W2UADNQX.3G0SDEYO3KPW2@cepl.eu>
In-Reply-To
<D1FVLZFANBQO.T5Z8R5AVJHKI@tjex.net> (view parent)
DKIM signature
pass
Download raw message
On Wed May 22, 2024 at 6:08 AM CEST, Tillman Jex wrote:
> Has anyone managed to setup a handler or know of a project that can be used as 
> a target for mailto: links, which will effectively open them in aerc?
>
> i.e. Clicking on mail@foo.com on a website will open and populate the compose 
> view in aerc (via IPC), which would otherwise just be `aerc mailto:mail@foo.com` 
> via the CLI.

So, you need in my opinion these things (and I have absolutely no
clue, how to do them on MacOS):

  1. Tell the system that this program needs to be run in a
     terminal, that it is not a GUI application (in Linux we have
     that `Terminal=true` line in the .desktop file, and if you
     use something else than Gnome, than there is a lot of fun to
     make it working correctly).
  2. Tell the system, that aerc is the system handler of
     x-scheme-handler/mailto MIME type or something similar.
  3. Tell your browser, that it should use the system handler for
     mailto: URIs.

Best,

Matěj

-- 
http://matej.ceplovi.cz/blog/, @mcepl@floss.social
GPG Finger: 3C76 A027 CA45 AD70 98B5  BC1D 7920 5802 880B C9D8
 
Puritanism: The haunting fear that someone, somewhere, may be
happy.
  -- H. L. Mencken
Details
Message ID
<D1G5Y31YWO8A.2002SQ67VRT64@cepl.eu>
In-Reply-To
<D1FVLZFANBQO.T5Z8R5AVJHKI@tjex.net> (view parent)
DKIM signature
pass
Download raw message
On Wed May 22, 2024 at 6:08 AM CEST, Tillman Jex wrote:
> Has anyone managed to setup a handler or know of a project that can be used as 
> a target for mailto: links, which will effectively open them in aerc?
>
> i.e. Clicking on mail@foo.com on a website will open and populate the compose 
> view in aerc (via IPC), which would otherwise just be `aerc mailto:mail@foo.com` 
> via the CLI.

So, you need in my opinion these things (and I have absolutely no
clue, how to do them on MacOS):

  1. Tell the system that this program needs to be run in a
     terminal, that it is not a GUI application (in Linux we have
     that `Terminal=true` line in the .desktop file, and if you
     use something else than Gnome, than there is a lot of fun to
     make it working correctly).
  2. Tell the system, that aerc is the system handler of
     x-scheme-handler/mailto MIME type or something similar.
  3. Tell your browser, that it should use the system handler for
     mailto: URIs.

Best,

Matěj

-- 
http://matej.ceplovi.cz/blog/, @mcepl@floss.social
GPG Finger: 3C76 A027 CA45 AD70 98B5  BC1D 7920 5802 880B C9D8
 
Puritanism: The haunting fear that someone, somewhere, may be
happy.
  -- H. L. Mencken
Maarten Aertsen <maarten@nlnetlabs.nl>
Details
Message ID
<D1HX0GBBBBG0.133D3AL8BXYFF@nlnetlabs.nl>
In-Reply-To
<D1FVLZFANBQO.T5Z8R5AVJHKI@tjex.net> (view parent)
DKIM signature
pass
Download raw message
hi,

On Wed May 22, 2024 at 06:08 CEST, Tillman Jex wrote:
> Has anyone managed to setup a handler or know of a project that can be 
> used as a target for mailto: links, which will effectively open them 
> in aerc?
>
> i.e. Clicking on mail@foo.com on a website will open and populate the compose 
> view in aerc (via IPC), which would otherwise just be `aerc mailto:mail@foo.com` 
> via the CLI.

Yes, I have. You can create an Apple script in "Script Editor":

on open location mailtostr
	set text item delimiters to {":"}
	do shell script "/opt/homebrew/bin/aerc \"" & mailtostr & "\""
end open location

If I recall correctly, you then save it as an .app and then set this 
"app" as the "default mail reader" in (curiously) the Settings for 
Mail.app.

kind regards, Maarten
Details
Message ID
<D1IB2FST3XRK.H1M4CNJJD8@tjex.net>
In-Reply-To
<D1HX0GBBBBG0.133D3AL8BXYFF@nlnetlabs.nl> (view parent)
DKIM signature
pass
Download raw message
Ahhhhhhh YES!

Legend. Thank you.

So simple. Never thought "the right tool for the job" would ever extend to Apple 
scripts, but there you have it.
Reply to thread Export thread (mbox)