I don’t know on which podcast I heard about it, although I suspect it was mentioned by John Vorhees (not certain), but I’m looking for the method to create a universal url for a message in Apple Mail such that, when this URL is added to any document (Notes, Agenda, Things, Fantastical, etc.), when tapped, it will take us directly to that message in Apple Mail.
Thanks for this. I didn’t know you could drag a Mail message on iPad. I’ll check if it works for Agenda, etc.
The second method only works if there’s a date mentioned in the email - most mails to which I need to link don’t include dates in the body, just general info or attachments I need to reference.
I know a well-known member of the technorati worked out how to create a universal url that, I think, they turned into a shortcut.
I can’t remember if they discussed it on Mac Power Users podcast, App Stories or something else with Federico Viticci as one of the hosts.
I’ve tried a Google search but I don’t really have enough variables/know how to craft the search to pinpoint it.
No, if you read all the way the author discovered it by using a calendar URL but later shows how to get the message ID from the source. Still awkward though.
I used the drag to OmniFocus feature to get the URL. But @MacSparky posted a great script you can use to get the URL from Apple Mail on your Mac. It works great with TextExpander. I use it regularly to put links to e-mail messages in Apple Notes.
I use fastmail and the fastmail app allows you to view the full headers. It will depend on your email client - you can’t do it in Apple Mail. Even with fm it’s not at all convenient.
Things’ email to Things feature is the only one of its kind that actually constructs a message: URL back to the initial email when you forward a message to your custom address. I didn’t think it was possible, but now that I know it is I wish Omnifocus (and IFTTT/Zapier for that matter) would build the same thing.
Thank you @iPersuade and of course @MacSparky for the great script to use with apple mail.
Since I’m not a TextExpander user, but was searching a solution for linking directly to mails a long time ago (I gave up until I saw your post and got motivated again).
Now I adapted the script to directly add all selected (not just the first) mail as links with their subject as title for the link to Drafts or Todoist. This works on the Mac with the URL schemes of the two apps.
If someone needs them here you go:
add selected mails to todoist:
tell application "Mail"
set _msgs to selected messages of message viewer 0
if (_msgs is not equal to missing value) then
repeat with _msg in _msgs
set _msgID to do shell script "/usr/bin/python -c 'import sys, urllib; print urllib.quote(sys.argv[1])' " & (message id of _msg)
set this_subject to (subject of _msg) as Unicode text
set encoded_subject to do shell script "/usr/bin/python -c 'import sys, urllib; print urllib.quote(sys.argv[1])' " & quoted form of this_subject
open location "todoist://addtask?content=[" & (encoded_subject) & "](message://%3C" & (_msgID) & "%3E)"
# add delay and press return to give todoist enough time to process the input
tell application "System Events"
delay 0.3
keystroke return
delay 0.3
end tell
end repeat
end if
end tell
add selected mails to Drafts:
tell application "Mail"
set _msgs to selected messages of message viewer 0
if (_msgs is not equal to missing value) then
repeat with _msg in _msgs
set _msgID to do shell script "/usr/bin/python -c 'import sys, urllib; print urllib.quote(sys.argv[1])' " & (message id of _msg)
set this_subject to (subject of _msg) as Unicode text
# delay 1
set encoded_subject to do shell script "/usr/bin/python -c 'import sys, urllib; print urllib.quote(sys.argv[1])' " & quoted form of this_subject
open location "drafts5://x-callback-url/create?text=(" & (encoded_subject) & ")[message://%3C" & (_msgID) & "%3E]"
end repeat
end if
end tell
not that i know… You can e.g. retrieve links for apple notes with the “View Content Graph” action, but you need to manually copy them, so this is not really practical.
For E-Mails, I flag and move them to an “ACTION” folder on the iPhone if I can’t reply directly… If I want to make sure to dont forget the E-Mail I’ll also forward it to todoist…
I did not try to create a mail rule based on a flag and automatically run the script from above… maybe this is possible…
When I run @MacSparky 's script to paste in a mail link, I get an error and this message: sh: /usr/bin/python: No such file or directory. What do I need to change?