latest, greatest Entourage to Omnifocus
I am new to mac, entourage, omnifocus but pretty hapy after a few weeks.
I know this has been covered in part, but some of the links here listed under entourage and omnifocus are actually entourage only scripts and tips. My specific question is whether anyone has successfully linked an Entourage email to a new task with a link to the email in the omnifocus new task? I have gotten Sandro's macro to work, but without a link to the actual email it makes it a lot less useful. His script pastes the body of the message into the note field, but I saw someone else mention it should be possible to have a link to the actual email--so once the task is acted on a single click would bring up the email for action. Also, I cannot get Omnifocus to 'come to the front' after running the macro from entourage--any tips on that? If I am missing something, i apologize. Been searching and reading here for a couple of hours and this specific question/answer has eluded me. Thanks, Rob |
I agree that it would be much better to have the task link back to the Entourage email but I haven't been able to find a solution for that. As a matter of fact, I don't believe that one can link back to specific emails in Entourage. If anyone has been able to do so, or knows of a solution, please let me know and I will integrate it asap...
As far as getting OmniFocus to come to front, Omni broke (or something to that effect) the 'activate' applescript command a while ago so I simply commented it out of the script. I haven't gone back to test it out because I have actually come to prefer not having OF come to the front. By all means try uncommenting the line and see if it works for you. |
hmm, as entourage supports Sotlight and I can easily open a specific email via that, there should be a way to do this, maybe through spotlight?
|
I'd like to bump this. I'm now being pushed to use Entourage/Exchange/Blackberry through work and am quite shocked to see there's very little on how to integrate OF into this sort of workflow.
|
I'm not on a machine with Entourage, but I can point you in the right direction:
Every Entourage item has a unique ID that's part of its properties. That UID is also found in the spotlight metadata of its spotlight cache item. So..... You can use a "do shell script" to run an mdfind for the appropriate UID and then create a link to that spotlight cache file. Opening the file will open the appropriate message in Entourage. Not quite EASY, but it does get the job done. I've had to do the same thing with Mail before. |
Hi iNik,
I'm pretty new at this, but I tried the do shell script as you described and it didn't work. I might have messed up on adding the link to that spotlight cache file. Any suggestions? |
Additional info toward a solution
On my installation of Entourage 2008, I have a vast hierarchy of files with names like:
/Users/paco/Library/Caches/Metadata/Microsoft/Entourage/2008/Cigital/Messages/0T/0B/0M/6K/6224.vRge08Message These files, if you open them using the "open" command on the command line or double click on them, cause Entourage to fire up looking at a specific message. The files actually seem to be an XML-ish plist-ish representation of the actual email messages. Thus, Spotlight can index these. If you used mdfind to find one of these files, you could link to it. Then double clicking on that file name ought to have the desired effect. I'm too new to OmniFocus. I haven't started integrating it into all my tools, yet. When I saw this thread I thought I'd post what little bit I knew. Paco |
[QUOTE=spnyc;36133]I agree that it would be much better to have the task link back to the Entourage email but I haven't been able to find a solution for that. As a matter of fact, I don't believe that one can link back to specific emails in Entourage. If anyone has been able to do so, or knows of a solution, please let me know and I will integrate it asap...
.[/QUOTE] As it seems to be the case that indeed there is no way to link back to the Entourage email, am I safe to assume that it is also impossible at this point to link a file (or a reference to a file) from an email, or for that matter from the Finder, to a note in OF through AppleScript? |
[QUOTE=MB_UST;48310]As it seems to be the case that indeed there is no way to link back to the Entourage email, am I safe to assume that it is also impossible at this point to link a file (or a reference to a file) from an email, or for that matter from the Finder, to a note in OF through AppleScript?[/QUOTE]
A bit of browsing of OmniFocus' dictionary in Script Editor does reveal some support for file attachments in the rich text section...but I couldn't tell you if it is sufficient to do what you want. |
One can easily create an event and paste the text of the email in the note field by using the parse task with transpor text command. The problem, as noted above, is that there is no reference to the original email. How would one use this command or any other command to attach to the action item that parse taks creates? Has anyone successfully attached a file to an action item? If so, what is the syntax? The dictionary is not so helpful here, I don't think.
|
FYI Attachements with Link Backs to Email in Entourage work
This script is working for me, most of this was gathered from other threads, unfortunately I have misplaced the original creators names to give credit.
[CODE] tell application "Microsoft Entourage" -- get the currently selected message or messages set selectedMessages to current messages -- if there are no messages selected, warn the user and then quit if selectedMessages is {} then display dialog "Please select one or more messages first and then run this script." with icon 1 return end if repeat with theMessage in selectedMessages set theName to subject of theMessage set theContent to content of theMessage set theID to ID of theMessage as string -- set the path to a temp area on your HD to temporarily store the attachment to be loaded into OF set theFileName to "YourHDName:Users:Username:Temp:" & theID & ".eml" save theMessage in theFileName tell application "OmniFocus" set theDoc to default document set theTask to theName set theNote to theContent tell quick entry set NewTask to make new inbox task with properties {name:theTask, note:theContent} tell the note of NewTask make new file attachment with properties {file name:theFileName, embedded:true} end tell activate end tell end tell -- Remove the file now that it is in OF tell application "Finder" delete file theFileName end tell -- Only Uncomment if you really understand and are happy with the process and want the message to -- be removed from Entourage after it gets sent to OF -- delete theMessage end repeat end tell[/CODE] |
Thanks a lot. I'll try it. As I read it, I see that if the embedded property is set to false, then the file will stay in its original location without copying it to the database (keeping the database leaner). Thanks again (to you and all original the creators).
|
I have changed the script slightly and put installation instructions around it. Find it at
[URL="http://rainer.4950.net/wordpress/?p=129"]http://rainer.4950.net/wordpress/?p=129[/URL] hope you like it |
Additional tweaks to entourage script
I have two tweaks I wanted to rburgst's current script. I have solved 1 so far:
1 (solved) I wanted to include ONLY a link to the original email into the notes field in omnifocus, and not the body of the email. I sync to the iphone so I want to keep sync times down. I edited this line: set NewTask to make new inbox task with properties {name:theTask, note:theContent} and changed it to this: set NewTask to make new inbox task with properties {name:theTask, note:" "} Which works well. 2. (unsolved). I want the email link in Omnifocusto open in Entourage. Another post suggested changing the preferences in mail.app to set Entourage as primary, but this does not fix the issue. It opens the email in mail.app regardless. Any ideas? Thanks! |
Perhaps if you select one of the linked .eml files in the Finder, do Get Info and set the application to open it with to Entourage (checking the "use this app to open all such files" box) you'll get the result you want.
|
Thanks for the recommendation, but all my .eml files open with Entourage in the finder (and spotlight) already. It is just when opened within Omnifocus that mail.app launches.
I even double checked a specific eml file that has been added to Omnifocus with this script- in the finder it launches Entourage, Omnifocus still mail.app. Weird. |
Indeed. Have you tried clearing the Launch Services caches and so on? [URL="http://www.thexlab.com/faqs/resetlaunchservices.html"]http://www.thexlab.com/faqs/resetlaunchservices.html[/URL]
|
Upon further review of Omnifocus preferences, I'm guessing the issue may be that Omnifocus is hard wired to mail.app because of its clipping service integration? I can't think of any other reason why Omnifocus would ignore the finder's type settings.
|
Yeah, maybe, except it can open everything else under the sun, right? Why have a special check in that code path when you're going to hand everything else off to launch services?
I tried making a link to a .emlx file and following it from OF after setting TextEdit as the default application to open such files. It opened in TextEdit, as I would expect. This was with 10.4.11. |
OK, getting closer. I just tried dragging an eml file into Omnifocus (rather than using the script) and indeed it opens in Entourage. So the script must be the culprit? Changing the file association somehow? I'm off to investigate...
|
OK, solved part 2. Got the solution from Rainer:
[url]http://rainer.4950.net/wordpress/?p=129#comment-67[/url] You were right, whpalmer4, I just misunderstood. I was using an email file from Entourage to try to set the default app in Get Info. Of course that was already set to Entourage. What I did the second time (and what worked) was to open Mail.app, make a new email, drag that email to the desktop and then assign THAT file (and 'Change All...") to Entourage. Presto. So thanks, all. I am loving life with a streamilined OF DB file... |
Solution: Applescript to link OF directly to Entourage Message (using mdfind)
I have a revised version of the scripts discussed here that links directly to an existing Entourage message (not a new copy in /tmp...). This way, if you reply to it, e.g., Entourage knows about it.
The code is a modified version of one posted by Rainer: [url]http://rainer.4950.net/wordpress/?p=129[/url] It uses a spotlight mdfind command to search for the messageID. The file linked in the OF task is a .vRge08Message file which is what Entourage uses to enable spotlight searching (you probably have tens of thousands of these on your computer). When you open one of these files it links back to the original Entourage message. Enjoy -Josh Copy the following into 'Script Editor' and save the file in: ~/Documents/Microsoft User Data/Entourage Script Menu Items/ Run it from your Entourage Applescript Menu. This script makes a new task in the Quick Entry menu with name "MessageSender: Message Subject" and attaches a note with the body of the message and embeds the file link which goes back to Entourage. [CODE]tell application "Microsoft Entourage" -- get the currently selected message or messages set selectedMessages to current messages -- if there are no messages selected, warn the user and then quit if selectedMessages is {} then return end if repeat with theMessage in selectedMessages set theName to subject of theMessage set theSender to display name of sender of theMessage set theContent to content of theMessage set theID to ID of theMessage as string tell application "OmniFocus" log "Importing from Entourage, message ID = " & theID end tell set theCommand to "mdfind com_microsoft_entourage_recordID==" & theID set theMDfile to the first item of paragraphs of (do shell script theCommand) tell application "OmniFocus" tell quick entry set theTitle to theSender & ": " & theName set NewTask to make new inbox task with properties {name:theTitle, note:theContent} tell the note of NewTask make new file attachment with properties {file name:theMDfile, embedded:false} end tell activate end tell end tell end repeat end tell[/CODE] |
Another script for auto-reply task
Here is another script I use which automatically creates a task in Project "Email Reply" with context "email" that links back to Entourage directly. This doesn't open the quick entry menu.
-Josh [CODE]tell application "Microsoft Entourage" -- get the currently selected message or messages set selectedMessages to current messages -- if there are no messages selected, warn the user and then quit if selectedMessages is {} then -- display dialog "Please select one or more messages first and then run this script." with icon 1 return end if repeat with theMessage in selectedMessages set theName to subject of theMessage set theSender to display name of sender of theMessage set theContent to content of theMessage set theID to ID of theMessage as string tell application "OmniFocus" log "Importing from Entourage, message ID = " & theID end tell set theCommand to "mdfind com_microsoft_entourage_recordID==" & theID set theMDfile to the first item of paragraphs of (do shell script theCommand) tell application "OmniFocus" tell default document set theContext to context "email" set theProject to project "Email Reply" set theTitle to theSender & ": " & theName set NewTask to make new inbox task with properties {name:theTitle, note:theContent, context:theContext} set assigned container of NewTask to theProject tell the note of NewTask make new file attachment with properties {file name:theMDfile, embedded:true} end tell compact end tell end tell end repeat end tell[/CODE] |
Is it possible to modify this scrip to add a new inbox item without using [B]Quick Entry[/B]? This script would then create the new inbox item without any user interaction.
Thanks |
The following script makes a new entry in Project: Email Reply with Context:email without opening the quick entry window.
[CODE]tell application "Microsoft Entourage" -- get the currently selected message or messages set selectedMessages to current messages -- if there are no messages selected, warn the user and then quit if selectedMessages is {} then return end if repeat with theMessage in selectedMessages set theName to subject of theMessage set theSender to display name of sender of theMessage set theContent to content of theMessage set theID to ID of theMessage as string tell application "OmniFocus" log "Importing from Entourage, message ID = " & theID end tell set theCommand to "mdfind com_microsoft_entourage_recordID==" & theID set theMDfile to the first item of paragraphs of (do shell script theCommand) tell application "OmniFocus" tell default document set theContext to context "email" set theProject to project "Email Reply" set theTitle to theSender & ": " & theName set NewTask to make new inbox task with properties {name:theTitle, note:theContent, context:theContext} set assigned container of NewTask to theProject tell the note of NewTask make new file attachment with properties {file name:theMDfile, embedded:false} end tell compact end tell end tell end repeat end tell [/CODE] |
Thank you so much, that was extremely kind of you :-)
|
The script runs fine and imports the Entourage message into an OF task. However, Entourage won't open when I click on the link to the Entourage message in my OF task. Any suggestions?
Thanks, Chris |
Not sure why. If you right-click on the file link and "Reveal in Finder" what does it point to?
|
works with some messages, not all?
Thanks to all for the work on the scripts!
Oddly, it is working intermittently for me. With some Ent messages, all works well - I hit Ctl-O and the script attaches the message to the selected OF task, or it opens the Quick entry window to create a new task. With other messages, it does nothing. I've tried to isolate variables - the message having/not having attachments, or links doesn't seem to make a difference. All messages are in my Ent "in-box" list, selected from the list. Does anyone else get variation like this? Does Ent treat different messages in the In-box differently? |
Hoff,
Same question: If you right-click on the file link and "Reveal in Finder" what does it point to? Is there a difference between the links that work and the ones that don't? |
I don't get "reveal in finder" as an option. I just get cut and copy.
|
sfcardinal,
Is there a file link there (a small icon)? |
Yes, I have the Entourage icon.
|
the add task script isn't working, it seems to run, but there is no task created, the quick entry version works fine...
any ideas? thanks. -a |
Trying to run script from within a rule
I am trying to run the modified "no quick entry" version of this script from within a rule. I am mailing myself on delegated tasks and have created a rule which runs this script and assigns a context of waiting for. Unfortunately the script gives me the following error:
While processing message "Test" (ID 8268), the rule "waiting" could not be successfully executed. The script encountered error "Can’t get item 1 of {}." during execution. I am trying to combine tarun101's delegated tasks script with the one posted here and can't figure out why I get the error. What I am trying to do is create a script for mails I delegate to others by copying myself and which will create a task in OF with attached mail - the script must run from a rule. Here is tarun101's script (see [url]http://forums.omnigroup.com/showthread.php?t=9171[/url] for more details) tell application "Microsoft Entourage" -- get the currently selected message or messages set selectedMessages to current messages repeat with theMessage in selectedMessages -- parse the email(s) set theName to subject of theMessage set theContent to content of theMessage tell application "OmniFocus" set theContext to context "Waiting" of default document set theTask to theName set theNote to theContent tell default document to make new inbox task with properties {name:theTask, note:theContent, context:theContext} end tell end repeat end tell |
Has anyone had any success with this and 1.7?
|
no success
|
beer for anyone who can "fix" this - this script has been essential to my daily workflow (corp email does not support Mail.app)...
|
OF 1.7 seems to have broken something in scripting
Having the same problem. I had two great scripts that I got from this forum, one for copying the message into OF and another for just linking it. Neither one works now since the update.:(
|
Solved it! The 1.7.1 release notes explain that the verb "activate" has been replaced by the verb "open".
Make this change and your script will work! |
Thanks for the tip! Works perfectly again!
|
Entourage 2 OF
Hi
for the lazy I have updated my script and you can grab it here [url]http://rainer.4950.net/wordpress/?p=178[/url] cheers |
[QUOTE=rburgst;66560]Hi
for the lazy I have updated my script and you can grab it here [url]http://rainer.4950.net/wordpress/?p=178[/url] cheers[/QUOTE] I've installed the script and it is working to send messages over to OF. However, when I click on the icon to open the original message, it opens it in Mail.app and not Entourage. Any idea how I fix that? Thanks |
My apologies - found the solution on page 3. Had to change the files to open with Entourage.
Great script - thanks! |
I am using the script at [url]http://rainer.4950.net/wordpress/?p=178[/url] to send mail to my OF from Entourage. If I click multiple messages however, and then press Control-O, it only sends the first message to OF. Does anyone else have this problem? The blog mentioned you should be able to click multiple emails and have each send as its own action. I am using the latest version of OF, Entourage and OSX. Any help is greatly appreciated!
|
All times are GMT -8. The time now is 08:55 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.