Outlook 2011 Script for Omni Focus 2

I got the Veritrope script working for the AppleScript Editor (selected message in Outline and ran script), but I don’t see it in the Scripts Menu in Outlook. I place it in both the Microsoft User Date/Outlook Script Menu Items folder and the /Users/rwilliams/Library/Application Support/Microsoft/Office folder. The file name is Send to OmniFocus\coS.scptd. Any idea?

Rainer’s script (which can be found at http://rainer.4950.net/2014/06/04/outlook-to-omnifocus2-take-12/) will generate a task with a link back to the original message in the notes field. You can also set a number of variables that allow you to do things like delete or file the original email message in a specific folder once the task has been created in OF, create the task either directly in the inbox or using the Quick Entry window, etc.

It took awhile to get it updated to work with OF2 properly, but it’s up and running now, and I’ve been using it without issue for months.

Colleagues,

I’ve tried to use the latest edition of Rainer Burgstaller’s script (v12) to integrate Outlook to OmniFocus. His work is genuinely valued, appreciated and respected.

Unfortunately, in my case, it is generating the same example others have experienced. Namely, it responds with 'Script error: OmniFocus got an error: Unable to read file from /tmp/[a file name].

As mentioned above I’ve tried replacing the code so that it matching the following:

make new file attachment with properties {file name: POSIX file theFileName, embedded:true}

But this didn’t fix the matter. However, in case this can be helpful, let me share further. I was able to highlight a message in Outlook and then execute the script (without the code modification) within Apple’s Script Editor. When doing this, everything ran perfectly … no exception and the task was created based on an email message.

However, when executing the script from Outlook, while a task ‘is’ created in OmniFocus and placed within the Inbox, the exception message is also created.

Suggestions for resolution would be very much appreciated. Thank you in advance,

Best regards to all,

Stephen

Environment: OSX Yosemite 10.10, Outlook 14.4.8 (The latest updates installed), OmniFocus Pro 2.0.3 (v8715).

Thanks for providing details about when it works and doesn’t work—that’s very helpful!

The reason it works when you run it from Script Editor is because that grants a script access to the entire system, rather than being limited to the invoking app’s sandbox: it’s allowed to access anything it wishes, and it can grant that access to sandboxed apps such as OmniFocus 2.

You can do the same thing when running a script from inside a sandboxed app, but only if the script is in a special scripts folder for the app which signals to the system that you’re intentionally allowing that script to escape the app’s sandbox. (Sandboxed apps are not allowed to modify anything in that folder, so the app can’t engineer an escape from its own sandbox.)

In OmniFocus, you can get to that special folder by choosing “Open Scripts Folder” from the Help menu. Any scripts which you place in there will become available (in Pro) as custom toolbar items, and can be used directly from OmniFocus without being limited by its sandbox.

Hope this helps!

Hi Ken,

Let me say in advance, thank you very much for your support. It would be fantastic if this anomaly can be fixed.

Ok, per the instructions, the ‘SendOutlooktoOmniFocus’ script was moved to \Users[my_user_name]\Library\Application Scripts\com.omnigroup.OmniFocus2.MacAppStore\

Unfortunately, the same exception occurs and I would agree it-at the very least-“appears” to be permissions related.

That said, I checked the permissions on the email / file after it lands in the ‘tmp’ directory. Read-write permissions have assigned to me (That’s good). The permissions on the ‘tmp’ directory are read-write for system, wheel and everyone (which I expect should make all happy).

Any additional suggestions or recommendations are genuinely be appreciated.

I would love to do a ‘lunch and learn’ at work and show folks your wonderful app with this script working. That would be icing on the cake.

Sending attachments in case they can be helpful.

Stephen

I got my Outlook script to work with OF2 thanks to this thread. One catch. Every time I open the outlook message in the OF task attachment, I get the apple quarantine message:

"OutlookMsg751911.olk14_message" may be an application. It was created by Microsoft Outlook. Are you sure you want to open it?" OmniFocus created this file today at 9:49 PM.

How can I get rid of this message. It’s driving me crazy.

Thanks!

I solved this by using Rainer’s most recent script (I had an old copy). However, I also wanted to move the message from my Inbox to the @Actions folder. I inserted that scripting but could not save the .scptd file from the Applescript editor. After some searching online, I found out that you have to export the .scptd file as text, update it, compile it, then export it as a script. I might also work to export it as a script. It turns out that .scptd files are compiled and can’t be directly edited.

I was using the script referenced below/above and everything was working great. All of a sudden I start getting an error message "Omnifocus got an error. Unable to read file from ‘/temp/OutlookMessage32724.eml’ I removed the script and reinstalled and got the same thing.

Not sure what has changed…can anyone help?

I got the script up and running, no problems. Works out really great! Thanks!

But the keyboard shortcut fails to work, any ideas why? Have tried different keyboard combinations but they all fails to do anything. Running OF2 and Outlook 2011 on latest OSX (10.11.6).