Outlook to OmniFocus, take 4

This is another update to the previous releases of my Outlook script. The main changes are

  • growl notification (provided by Paul)
  • fix for empty subject lines (provided by Paul and Peter)
  • added mail headers (from, date) to content of the note (provided by Paul)
  • a few optional hooks that you can customize the behaviour of the script

Install instructions:

  1. Double click the OutlookToOmniFocus-v4.tar.gz to extract it
  2. Copy the contents of the zip file to <userhome>/Documents/Microsoft User Data/Outlook Script Menu Items (you can do this even easier by opening Outlook, selecting the script menu item „About this menu…“ and then click „Open Folder“.
  3. that’s it

Usage instructions:

  1. select a mail in outlook
  2. open the script menu and choose  „Send Outlook to Omnifocus“ (see screenshot) or alternatively just press CTRL+O (o, not zero)

In case something goes horribly wrong

I obviously dont hope that it does, but please open Console and watch for suspicious messages. Typically this will give you some idea.


Download the file see here: OutlookToOmnifocus-v5.zip see update below


If you have a non-english system then your „Microsoft User Data“ folder might use a different localized name. In this case please replace „Microsoft User Data“ with the correct folder name (e.b. „Microsoft-Benutzerdaten“ if you are using a german system). Thanks to Jens for pointing this out.

Update 24.02.2011

I have updated the script and fixed the Growl integration. This should work now. In addition I have added a couple of CHANGEME comments in order to make it easier to customize the script.

Download the latest file here: OutlookToOmnifocus-v6.zip

Update 17.5.2011

Since I like to share and people were seeing issues, here is the source for the maildecoder java tool.


Update 19.05.2011

Please take a look at http://rainer.4950.net/wordpress/blog/category/gtd/ for the latest version of this script.

62 Gedanken zu „Outlook to OmniFocus, take 4“

  1. This is tremendous, thank you so much for your efforts on this. When last I looked at this, there was no way to link back from the OF action to the original email, but I see you’ve addressed that now.

    If there was a Donate button on this page that happened to lead to a Paypal account, I’d click on it!


  2. Regarding international system (spanish in this case): „If you have a non-english system then your “Microsoft User Data” folder might use a different localized name. In this case please replace “Microsoft User Data” with the correct folder name“
    Where and how I should replace the folder neme?
    Thanks a lot!!

  3. Dear Rainer,
    thank you very much for your amazing apple script OutlookToOmnifocus; please let me ask you another question; I would like to move each sent mail in a specific Outlook 2011 project folder, with incoming messages use the Command-Shift-M shortcut, however when replying to a message the outgoing message is stored in the sent items folder, do you think that it might be possible to make an Applescript that runs the Command-Shift-M shortcut for every mail that was sent to move this mail directly to a folder that is specified in the dialog box which comes up after invoking Command-Shift-M.
    Thanks for your help

      1. In order to explain it a little bit better; I have several project folders (mailboxes) in Outlook 2011, i store each mail I receive in one of these folders by moving the mail out of the inbox folder by pressing Command-Shift-M and then selecting the respective project folder. The same workflow has to be done with each of the sent mails in order to have all mails (received and send mails) in one project folder. It would be very helpful if there will be a srcript that facilitates this workflow. For example after receiving a mail that I have answered with a reply mail I have to move the original mail into the project folder, it would be great if there will be a script in the background that automatically moves the reply also to that folder. Do you have an idea how to implement such a script?
        Thanks for your help.

  4. Dear Rainer,
    is it possible to modify the „Send Outlook to Omnifocus“ script in order to use it as a „Send Outlook to Omnioutliner“ script?
    Thank you very much for your help 🙂

    1. @MK unfortunately, I dont have OmniOutliner, however, I am quite certain that it has a similar Scripting interface. However, I fear that this requires quite some hacking skills.

      1. Yes OmniOutliner has a similar Scripting interface, I have had the idea that at least 80% of your script can be used for such a script however I am new to the OSX world and I have no experience in Script programming, hopefully there might be someone in the community out there who has an idea who to implement this:)

  5. Hi there rainer,

    Firstly I love this script and it’s made my life a lot easier.

    I’ve installed the script to the Outlook Script Menu but when I run the script from Outlook I get the following message:

    Omnifocus got an error: Can’t Continue <>

    Can you assist with this ?

    1. @Tom. Please open console and see if you find anything suspicious there. From this message alone I don’t really have an idea what’s going wrong. Which versions of office and Mac os are you using?

      1. Hi Rainer,

        I’m running OSX 10.6.6 and Outlook 14.0.2. It’s really odd as I used the script in my last place of work and not had any problems.

        I forgot to write that in the of the error msg was the term

        I extracted v6 of your script so both [OF] SendOutlookToOmniFocuscO.scpt and MailDecoder.jar have been copied to Outlook Script Menu Items.

        Would you recommend trying a earlier version of the script to see id that works?

        Finally nothing is coming up on the error console.

  6. rainer:

    @Tom. Please open console and see if you find anything suspicious there. From this message alone I don’t really have an idea what’s going wrong. Which versions of office and Mac os are you using?

    Sorry in the arrows the error msg says event register

  7. I take it this only works for 10.6, not 10.5? Version 6 works beautifully on my 10.6 Mac but versions 2, 3, 4, 5, and 6 have all failed on my 10.5 Mac.

  8. I absolutely love Outlook to OmniFocus. On some mail messages when I hit ctrl-o I get the following error.

    Script error: Can’t make name of {<>:blahblah@domainname.com“} into type Unicode text.

    The following error showed up in the console the last time I tried it, but this error doesn’t always show up.

    3/14/11 9:45:32 AM OmniFocus[1226] saving the file/tmp/entourage107424.eml
    3/14/11 9:45:32 AM OmniFocus[1226] out filename /tmp/outlook-107424.txt
    3/14/11 9:45:32 AM OmniFocus[1226] mail decoder location „/Users/paul/Documents/Microsoft User Data/Outlook Script Menu Items“/MailDecoder.jar
    3/14/11 9:45:34 AM OmniFocus[1226] Warning: couldn’t get PNG data for image <NSImage 0x14db93b0 Size={32, 32} Reps=(
    <NSCGImageSnapshotRep:0x14d20720 cgImage=>
    )>, because it had no cached image representation
    3/14/11 9:45:34 AM OmniFocus[1226] Failed to create thumbnail for wrapper: filename:entourage107424.eml preferredFilename:entourage107424.eml
    3/14/11 9:45:34 AM OmniFocus[1226] Warning: couldn’t get PNG data for image <NSImage 0x14d87d00 Size={32, 32} Reps=(
    <NSCGImageSnapshotRep:0x14d87c80 cgImage=>
    )>, because it had no cached image representation

    1. @Paul, I would need to see the exact mail headers of such a message and ideally also the saved email (/tmp/entourageXXX.eml). You can see the full headers by right clicking on the message in the list view and select „View Source“. You can mail this to me to rburgst at gmail dot com

  9. Love this script! Thanks for it.

    I command-tab between apps all day. After running the script and saving my to do, I command tab back to outlook. The menu bar changes to Outlook’s, but the window doesn’t change. If I do a roundtrip command tab (Outlook, OF, Outlook), it works. Thoughts? Sorry if I missed this in the comments above.

  10. Thanks so much for this script. Works great when I run it in the Applescript Editor, but my Outlook 2011 isn’t loading it as an option in it’s script menu. Any ideas?

  11. Hey Rainer,
    Just moving over to a Mac after 25+ years on a PC, and trying to figure out how to get GTD functionality using Outlook: this script is GREAT! Thanks so much.

  12. Question:
    This works with messages, but it doesn’t appear to work with tasks (within Outlook).
    Usecase: Shared tasks appear within outlook. I want to clip the task to put them in my omnifocus.

    Thoughts, Rainer?


  13. I saw n the code comments about uncommenting out the code that does not bring the email message across as an attachment. Wasn’t sure which part of the code to uncomment out. Can you explain further- Appreciate your help.

  14. Hi, thanks for the effort you’ve put into this.

    Unfortunately, I’ve got an error each time I try to use the script.

    I get an alert from Outlook that says it can’t access the mail decoder jar file.

    Here’s what comes into the Console:

    4/20/11 5:33:13 PM OmniFocus[3731] mail decoder location „/Users/evanmcd/Documents/Microsoft User Data/Outlook Script Menu Items“/MailDecoder.jar

    1. @Evanmcd and @Jeff it looks as if you did not unpack the jar file into the same directory. Make sure that it is unpacked along with the AppleScript. If in doubt you can open terminal and do


      Where you replace the brackets with the location that you have seen in the console log. The output should tell you that the file is there.

  15. Hi Rainer,

    based on your script I have made a second script that will be triggerd thru a mail rule and automatically set this message in Omnifocus in the context „Waiting“ and the date 5 days from now.

    Would you be interested to put this next to your script on your site?

    Regards Marcel

  16. Hey,

    Love your script! I was working great for me, but now when I try to launch the original message from within the „notes“ area in an Omnifocus task (labeled „Entourage XXX“), it’s launching the message in a program called „PGP Viewer“ instead of Outlook 2011. Which is strange, because it was launching the original message in Outlook before. I’m not sure what changed. I tried reinstalling the script, but no dice.

    Here’s the error I’m getting:

    Failed to compile script source: getMailDotAppMailboxes.applescript

    NSAppleScriptErrorBriefMessage = „Expected class name but found identifier.“;
    NSAppleScriptErrorMessage = „Expected class name but found identifier.“;
    NSAppleScriptErrorNumber = -2741;
    NSAppleScriptErrorRange = NSRange: {360, 7};

    Any ideas? THANKS.

    1. @Tucker, you need to change the default app for eml files, you can do that by finding an .eml file, then choose Get Info, and then select Outlook in „open with“. Then press „Change all…“

  17. Rainer – great work.

    When I run the script it leaves Omnifocus as the application with the focus. Would it be possible to stay in (or return to) MS Outlook? I tried commenting out the last portion of the script, but that did not help.

    One other suggestion: would it be possible to put the cursor into one of the fields of the Omnifocus quick entry screen? That way you could modify those fields without taking your hands off the keyboard.

    Thanks again.



  18. Can’t seem to get it to work – keep getting popup with message:
    Script error:
    GrowlHelperApp got an error: Connection is invalid.

    Console reports: 5/3/11 9:06:55 AM OmniFocus[4842] __CFServiceControllerBeginPBSLoadForLocalizations timed out while talking to pbs

  19. Having trouble with a few emails and the java decoder. The script just dies so have re-ran from a terminal:

    Core:tmp paulhargreaves$ java -jar ~/Documents/Microsoft User Data/Outlook Script Menu Items/MailDecoder.jar entourage364815.eml foo.bar
    Exception in thread „main“ java.lang.NullPointerException
    at com.burgstaller.mime.decoder.MailDecoder.main(MailDecoder.java:53)
    Core:tmp paulhargreaves$

    Checking over the raw eml file I do not see anything obviously incorrect and without the source for the java I cannot see what it is attempting to do.

    1. Ok, figured out what the problem is.
      The eml file appears to have no „text“ version, so one way to fix it was to change this section slightly:

      do shell script „touch “ & theOutFileName
      do shell script „java -jar „“ & posixHome & „/Documents/Microsoft User Data/Outlook Script Menu Items“/MailDecoder.jar “ & theFileName & “ “ & theOutFileName
      end try

      i.e. wrap the decode in a try so that it silently fails and the touch command above gives the rest of the script something it can use if the try block did fail.

      1. Hi, I will post the source to the post so that everyone can contribute. However, the version that I am working on (if I have a bit of time) will use the commandline txtutils and therefore, not rely on the external mail decoder. That might help in the long run.

  20. Hi Rainer,
    Thank you very much for the script..
    It makes integration / moving between OF and Outlook much easier.

    Wondering if there is any solution for syncing into Outlook calendar instead of iCal.

    Thanks very much..

    1. What exactly do you want to sync? I believe that the latest version of outlook already supports synching with iCal. Try Tools->Sync Services… in Outlook.

  21. Hi Rainer,

    This is a great script – really helped me out!

    It worked great for a couple of weeks but it now takes several minutes to process and I get this in the console:

    saving the file/tmp/entourage29095.eml

    Warning: couldn’t get PNG data for image <NSImage 0x16041c50 Size={32, 32} Reps=(
    <NSCGImageSnapshotRep:0x16044140 cgImage=>
    )>, because it had no cached image representation

    Failed to create thumbnail for wrapper: filename:entourage29095.eml preferredFilename:entourage29095.eml

    Warning: couldn’t get PNG data for image <NSImage 0x16066b00 Size={32, 32} Reps=(
    <NSCGImageSnapshotRep:0x160440a0 cgImage=>
    )>, because it had no cached image representation

    Any suggestions?

    Thanks in advance

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.