The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniOutliner > OmniOutliner 3 for Mac
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Link to email (Apple Mail) Thread Tools Search this Thread Display Modes
I'd like to be able to insert a single line hyperlink that will take me to an email within apple mail - is there a way to do this.

Dragging the email from mail gives an envelope icon that one might expect would either paste the contents or a link to the file, however it does nothing.

I can clip the email, but this doesn't take attachments, in any case I would rather link to data than duplicate it. Is there a way, or any suggestions on how to set one up?

Regards

Martin
 
Quote:
Originally Posted by andeye View Post
I'd like to be able to insert a single line hyperlink that will take me to an email within apple mail - is there a way to do this.

Martin
Martin,

I do not have OmniOutliner but I wrote an applescript for OmniFocus, that does exactly this and takes the link from Email and formats it as a message.

What this script will do is just grab the mail ID from Mail that is selected and put it in the buffer so you can paste it in.

Now if someone has OmniOutliner they can then add the rest, but at least this will help you in some way.

HTML Code:
tell application "Mail"
	tell application "Mail" to activate
	-- Get the Selection in Mail
	set theSelection to selection
        set theMessageID to the message id of item 1 of theSelection
        set theMessageURL to "message:%3C" & theMessageID & "%3E"
        set the clipboard to theMessageURL
        end tell
end tell
 
Thanks Yury - it's odd, but you used to be able to do exactly this in OmniFocus by simply dragging the email into a note, there is a thread discussing it where it is said:

Quote:
Originally Posted by Alex Brown View Post
In leopard you can drag a mail item into the note of an action, which creates a link back to the mail item. Almost there!.
However that was back in 2007, and there have been a few subsequent comments asking how to do it, so I assume that functionality is lost.

Assuming the dragging option is no longer an option, I'll happily go with your script, I couldn't get it to work until I removed the inner "tell application "Mail" to activate" loop, hence:

HTML Code:
tell application "Mail"
	set theSelection to selection
	set theMessageID to the message id of item 1 of theSelection
	set theMessageURL to "message:%3C" & theMessageID & "%3E"
	set the clipboard to theMessageURL
end tell
To me that's probably good enough, I can cope with the pasting, as it means I now have an application that extracts email links so I can use them in either OmniFocus or OmniOutliner
 
Quote:
Originally Posted by andeye View Post
However that was back in 2007, and there have been a few subsequent comments asking how to do it, so I assume that functionality is lost.
No it still works, I just automate a number of things
 
For an RTF version of the link, including the subject of the email, you could write something like:

Code:
property pTitle : "Copy selected Mail message(s) as RTF link(s)"
property pVer : "0.03"
property pAuthor : "RobTrew"

set strHTML to ""
tell application "Mail"
	activate
	repeat with oSeln in selection as list
		tell oSeln to set strHTML to strHTML & ("<font face=\"helvetica\"><a href=\"" & "message:%3C" & message id & "%3E" & "\">" & ¬
			subject & "</a></font><br>" & linefeed)
	end repeat
end tell

if strHTML ≠ "" then ¬
	do shell script "echo " & quoted form of (text 1 thru -6 of strHTML) & ¬
		"  | textutil -format html -convert rtf -inputencoding UTF-8 -stdin -stdout | pbcopy -Prefer rtf"

Last edited by RobTrew; 2013-01-08 at 09:43 AM.. Reason: Ver 3: Copies multiple selections, if required, and fixes typo
 
Quote:
Originally Posted by RobTrew View Post
For an RTF version of the link, including the subject of the email, you could write something like:
Thanks Rob, yes that now seems to do exactly the same thing as dragging and dropping the email into a comment (when dragging chooses to work) - seeing the subject is useful.
 
Quote:
Originally Posted by Yury View Post
No it still works, I just automate a number of things
Yes, I've tried again, and dragging the email to a link now seems to work with me some times but not others - I'm still trying to work out what makes it not work some times - I suspect it's all in the wrist.

As a matter of interest, how do you activate your script? I presume you automate because its quicker than dragging, so do you save the script as an application, and then assign a shortcut to the application?
 
Quote:
Originally Posted by andeye View Post

As a matter of interest, how do you activate your script? I presume you automate because its quicker than dragging, so do you save the script as an application, and then assign a shortcut to the application?
I can't speak for others, but I have invested in Mail Act On and have used their rules to use a keyboard shortcut to trigger applescripts in mail.

So:
- ctrl-A creates an inbox action with a link back to the original mail.
- ctrl-W triggers Sven Fechner's (SimplicityBliss) script to add the last sent mail to omnifocus prefixed with 'Waiting For'. The script is here: https://gist.github.com/simplicitybliss/4750844

The last one is a godsend to me (thanks Sven) - although I have growl, it hung untill I set the growl setting to false but then works like a dream (I didn't want the notification anyway). Make sure that you save the script in the com.apple.mail folder otherwise it won't be accessible to MailActOn.
 
Quote:
Originally Posted by andeye View Post
I'd like to be able to insert a single line hyperlink that will take me to an email within apple mail - is there a way to do this.

Dragging the email from mail gives an envelope icon that one might expect would either paste the contents or a link to the file, however it does nothing.

I can clip the email, but this doesn't take attachments, in any case I would rather link to data than duplicate it. Is there a way, or any suggestions on how to set one up?

Regards

Martin
i just tried this - i'm using mountain lion and OOpr3.

i just grabbed an email from the message list column in mail, which turned into an envelope icon - i then dropped it into the notes section of the outliner item and it appears there like a tag. moving the cursor over it it is highlighted and a small arrow appears on the right. clicking on the arrow takes you to the message opened up in mail. is this not what you mean?
 
I've had the same intermittent problem dragging email to OmniFocus. Sometimes it works great, then some bit gets flipped somewhere and it stops. I have tried sleeping the machine to no avail. Restarting does fix it though.

Anyone know something else to try?
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add a link to a Mail 5.0 email vsuri OmniFocus 1 for Mac 2 2011-09-18 03:02 PM
Apple Mail Account: Only Downloading 1 Email at a Time gerbras123 OmniFocus 1 for Mac 1 2010-08-11 05:51 PM
Receive email and move to OF Task using Apple mail gphilpott OmniFocus 1 for Mac 6 2009-05-11 01:43 AM
No Link to original Email tgirard OmniFocus 1 for Mac 3 2009-02-04 09:16 PM
attach or link to an email in Mail? oakcbay OmniOutliner 3 for Mac 6 2008-08-24 03:40 AM


All times are GMT -8. The time now is 12:59 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.