The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniOutliner 3 for Mac (http://forums.omnigroup.com/forumdisplay.php?f=9)
-   -   Link to email (Apple Mail) (http://forums.omnigroup.com/showthread.php?t=27702)

andeye 2013-01-07 04:26 AM

Link to email (Apple Mail)
 
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

Yury 2013-01-07 03:51 PM

[QUOTE=andeye;119013]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[/QUOTE]

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]
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
[/HTML]

andeye 2013-01-07 08:35 PM

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=Alex Brown;24028]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!.[/QUOTE]

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]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[/HTML]

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

Yury 2013-01-07 09:00 PM

[QUOTE=andeye;119034]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.
[/QUOTE]

No it still works, I just automate a number of things

RobTrew 2013-01-07 09:07 PM

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"
[/CODE]

andeye 2013-01-07 09:25 PM

[QUOTE=Yury;119036]No it still works, I just automate a number of things[/QUOTE]

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?

andeye 2013-01-07 09:31 PM

[QUOTE=RobTrew;119037]For an RTF version of the link, including the subject of the email, you could write something like:
[/QUOTE]

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.

RobTrew 2013-01-08 12:30 AM

Good.

All a bit easier in a plain text (Markdown) outline of course:

[CODE]set str to ""
tell application "Mail"
activate
repeat with oSeln in selection as list
tell oSeln to set str to (str & "[" & subject) & "](message:%3C" & message id & "%3E)" & linefeed & linefeed
end repeat
end tell
if str ≠ "" then set the clipboard to text 1 thru -3 of str
[/CODE]

RobTrew 2013-01-08 09:25 AM

Adjusted the RTF version [URL="http://forums.omnigroup.com/showpost.php?p=119037&postcount=5"]above[/URL] to allow for multiple selections in Mail.

kened 2013-01-16 09:19 AM

[QUOTE=andeye;119013]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]
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?


All times are GMT -8. The time now is 01:14 PM.

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