Jump to content
  • 1

REQUEST: Ability to link to emails in Mac Mail


S_Jacob

Idea

OK, I've skimmed through a bunch of posts in this forum but am still confused and may have missed something:

Is it possible to create a link from an EN note to an email in Mac Mail? I know there are applescripts and other solutions for importing entire emails but I want to create a single note that has links to multiple different emails. Snow Leopard already has support for the "message://" URL format. Just can't figure out how to use it in EN.

The ideas is that I can create a ToDo item that says something like "Respond to Ryan's email about the website" where clicking on the text brings up that email so that I can respond!

Relatively new to EN, so apologies if I missed something obvious.

Link to comment

23 replies to this idea

Recommended Posts

  • Level 5*
On 2/25/2016 at 11:26 AM, oraziosimone said:

Here is the applescript I use to create email links.

Excellent AppleScript!  Thanks for sharing.

When you have time, could I ask you to repost this script in the Mac Help forum, and put "AppleScript" in both the thread title and as a forum tag.  You might also add tags for "Apple Mail", "Links", "URL", and any other you think would be helpful in finding your thread.

All of this will greatly help others find your script, both from general Google search, and Forum Search.

Thanks.

Link to comment

I'm using successfully email links from evernote in iOS. The only caveat is that this works only with recent email messages, since iOS just holds a limited amount of messages.

Here is the applescript I use to create email links. The procedure is to select an evernote Note, then select an e-mail message in Mail, next run the script.

set _links to {}

set _Titles to {}

set _dates to {}

 

tell application "Mail"

    set _sel to get selection

    repeat with _msg in _sel

        set _messageURL to "message:\\%3c" & _msg's message id & "%3e"

        set end of _links to _messageURL

        set myTitle to the subject of _msg

        set end of _Titles to myTitle

        set theDate to date received of _msg

        set theString to ((time string of theDate) & " " & (day of theDate) as string) & " " & (month of theDate) as string

        set theAuthor to sender of _msg

        set theString to theString & " - " & theAuthor & " -   "

        set end of _dates to theString

    end repeat

    set AppleScript's text item delimiters to return

    set the clipboard to (_links as string)

end tell

 

tell application "Evernote"

    activate

    try

        set theNotes to selection

        repeat with thisNote in theNotes

            set theHTML to HTML content of thisNote

            repeat with n from 1 to count of _links

                set _messageURL to item n of _links

                set theTitle to item n of _Titles

                set theDate to item n of _dates

                -- append thisNote html "<div><b><a href=" & _messageURL & ">" & theTitle & "</a></b></div>"

                set theHTML to "<div><b>" & theDate & "   <a href=" & _messageURL & ">" & theTitle & "</a></b></div>" & theHTML

                set HTML content of thisNote to theHTML

            end repeat

        end repeat

    end try

end tell

 
Link to comment

Ok, so I know this is an old post, but if you've been using Evernote long enough with Apple mail, surely you've had this same question and experienced once or twice what jalemany said where it copies the email link to the Evernote note and it works across all devices... but how to duplicate that, who knows...?

I know this: if you are on your Mac and 1.) click and drag your email from the Preview pane and 2.) while dragging you press and hold 'opt' key, and 3.) release the file into an Evernote note, it will apply it into your Evernote note with that same, 'message:%...' format. Try it, wait 5 seconds, and you will see what I mean.

The bummer is, when I try to open that note on iOS device, Evernote on iOS ignores everything before: "message:%" and after the sending mail server (example "mail.gmail.com")  as a link and therefore will not allow me to open the file. Also, as you have probably seen, you cannot add a link to anything in Evernote that doesn't end with .com, .net. etc.

Ugh, so close!

Link to comment

Since I posted that link back in January, I've taken to using this feature a lot.  The problem is just getting the link out of Mail in a decent form.  Once you've got the link you can throw it in Evernote, throw it in Things, TextEdit, or whatever, and it'll just magically work both in iOS and OS X.

 

The message link should technically be a URN, but it's formatted as a URL.  The format is message://<message-id>, with the angle brackets.  However, to get consistent results the angle brackets need to be encoded (that's %3c and %3e).  Anyhow, here's some AppleScript.  I throw this into a Keyboard Maestro macro and use the hot key CMD+CTRL+C, which is a the same hotkey I use for my "copy file path" macro for Finder.

tell application "Mail"
    set _sel to get selection
    set _links to {}
    repeat with _msg in _sel
        set _messageURL to "message://%3c" & _msg's message id & "%3e"
        set end of _links to _messageURL
    end repeat
    set AppleScript's text item delimiters to return
    set messageLinks to (_links as string)
    set the clipboard to messageLinks
end tell
Link to comment

It works using the following procedure.

 

1) keep one Text Edit window open

2) drag the email message into TextEdit window. It will create a link to the email message

3) inside textedit right-click on the link and "copy link"

4) paste the link into Evernote.  

Link to comment

Linking to an email with an url like message://%3Clvqijk.8x4kcwxxxx does not work, the Ok Button remains disabled in Evernote Mac.

A message-link like above created in Evernote Web works in Evernote Mac too after sync.

Please fix and allow editing and pasting of message links in Evernote Mac.

 

I am still noticing the same behavior.  CTRL+CMD+V from Mail will paste into a new note in Evernote with a link back to the Mail message.  But I can't copy that link from the URL field of the created note into any other note.  The OK button is greyed out.

Link to comment

Linking to an email with an url like message://%3Clvqijk.8x4kcwxxxx does not work, the Ok Button remains disabled in Evernote Mac.

A message-link like above created in Evernote Web works in Evernote Mac too after sync.

Please fix and allow editing and pasting of message links in Evernote Mac.

Link to comment

There's a way to JUST get a link to the email, rather than copy-paste the body of an email, too. (credit: http://hints.macworld.com/article.php?story=20071118154803739 for what led me to this...)

1. Choose Preferences from the Mail menu.

2. Switch to the Viewing pane in the preferences window.

3. Choose "Custom" from the "Show header detail" pop-up menu.

4. Click the plus (+) symbol in the lower-left corner, then enter "Message-ID" in the space provided. Click OK to save.

5. In mail, viewing the email, you see the Message-ID field. Double or triple click to select the line, then paste into Evernote. Link!

Bug: I could not use message://<id> in the right-click Link... in Evernote to make a custom text link to the email. It accepts evernote:// links of course (Note Links) so it could accept message:// links.

Of course this probably(?) won't work on the iPad -- but the Message-ID of an email is THE SAME ON ALL DEVICES -- so if Apple was bright (sometimes they are...), it might....as long as that email is in your iPad's mail app...

Link to comment

No, this does not work.

No need to highlight anything. Simply click the message once in the Preview Pane and click Paste to Evernote from the EN icon in the menu bar (ctl+cmd+v). No selecting anything, no copying anything. Voila!

False. If you do that, Paste to Evernote just grabs whatever was previously in your pasteboard.

Ah, bug noted. Will send QA on after it.

If the URL stays invisible, it's not much use. I don't see it anywhere in the Evernote note.

In fact, Evernote seems to intentionally strip out message urls. I have some text in TextEdit with two hyperlinks, one to an http url and the other to a message url, and the latter gets stripped out when I copy and paste the text into Evernote. I wish it didn't do that; being able to link to email conversations would be extremely useful to me.

The URL is actually a link to the local copy on your laptop (or desktop, etc). It's in the toolbar if you don't have focus in the body of the note, and also in the note info popover (cmd+shift+i)

Link to comment

No, this does not work.

No need to highlight anything. Simply click the message once in the Preview Pane and click Paste to Evernote from the EN icon in the menu bar (ctl+cmd+v). No selecting anything, no copying anything. Voila!

False. If you do that, Paste to Evernote just grabs whatever was previously in your pasteboard.

In the message Preview Pane (does not work if the message is open), Select All to grab the entire message body and copy. Then, using the Evernote Desk Accessory Icon in the menu bar, Choose Paste to Evernote (or ctrl-cmd-V). This grabs the invisible URL and pastes it, along with the message body and subject into a note.

If the URL stays invisible, it's not much use. I don't see it anywhere in the Evernote note.

In fact, Evernote seems to intentionally strip out message urls. I have some text in TextEdit with two hyperlinks, one to an http url and the other to a message url, and the latter gets stripped out when I copy and paste the text into Evernote. I wish it didn't do that; being able to link to email conversations would be extremely useful to me.

Link to comment

No need to highlight anything. Simply click the message once in the Preview Pane and click Paste to Evernote from the EN icon in the menu bar (ctl+cmd+v). No selecting anything, no copying anything. Voila!

BTW- I'm still looking for a solution where I can do what the OP said. Be able to create a link inside the message that links back to a specific email i.e. Click here to see John's email. Click here to see Mary's reply to John. etc. Things for Mac does this but I stopped using Things because Evernote is a much simpler solution.

J

Link to comment

UPDATE:

I worked on a few simple trials and discovered a solution.

In the message Preview Pane (does not work if the message is open), Select All to grab the entire message body and copy. Then, using the Evernote Desk Accessory Icon in the menu bar, Choose Paste to Evernote (or ctrl-cmd-V). This grabs the invisible URL and pastes it, along with the message body and subject into a note. It does NOT get the date of the message, just date of capture.

Not a bad limited solution though. have no idea if it will work in Outlook, Entourage or any other mail program.

Link to comment

I am equally (and more) confused. Somehow I accomplished exactly what you intended, once. And now I can't repeat it. I have a Note that is the exact text of an email I received, and in the url there is a message link to the message (via my exchange server). This was the result of some magic keystroke as I would never have know the following url (message://%3cE7DBCCFB02B0CC4EA482A443BC ... ver.com%3e) Also, I did not copy and paste the body text, that was part of the magic sequence.

Any ideas? I've attached a screen shot so you can see I'm not crazy, it really happened.

BTW, OSX 10.6.8, Mail 4.5 (1084), Evernote 2.0 (116546)

[attachment=0]evernote_mail_clipping.jpg[/attachment]

Link to comment

I don't think that you can link to messages within Mail: that would create problems when you read the note on a mobile device, or a different computer, so it wouldn't really fit in with Evernote's portability.

An option might be to send the messages to Evernote, then you could create the single note you want, and link to the notes containing the email messages. I think that's the closest you can get at the moment.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...