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 > OmniFocus > OmniFocus Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Scripts for Integrating OmniFocus with DEVONthink 2 Thread Tools Search this Thread Display Modes
As an adjunct to OmniFocus, DEVONthink 2 rewards investigation.
It is highly scriptable, and works well as a powerfully indexed repository and archive of the various kinds of files, links, and references that may be needed for each OmniFocus project.

Here is a set of four scripts which illustrate the scope for automating this interaction.

Download

I am using them for both:

Sending to Devonthink,

Save2DevonAsTXT.scpt exports whatever is currently selected in OmniFocus (task, project, folder), as a text file, to a corresponding DEVONthink 2 project folder.
The text file is in TaskPaper format. The DT2 folder has the same path as the selected Omnifocus project or folder. This DT2 folder is automatically created, if it does not already exist.

Save2DevonAsOO3.scpt exports whatever is currently selected in OmniFocus (task, project, folder), as an OmniOutliner 3 file, to a corresponding DEVONthink 2 project folder.
The .oo3 file contains columns for task properties such as Context, Start, Due, Completed, Duration, Flagged. The OmniOutliner checkbox is set according to the OF task Done property. The DT2 folder has the same path as the selected Omnifocus project or folder. This DT2 folder is automatically created, if it does not already exist.

and fetching from Devonthink.

OpenProjFolderInDevon.scpt opens a folder, in DEVONthink 2, for the currently selected OmniFocus project. (The DT2 folder is automatically created, if it does not already exist).

OpenProjNotesInDevon.scpt opens a project notes file (stored in the matching DEVONthink 2 folder) for the selected OmniFocus project. The notes file is an Omnioutliner 3 document. (The DT2 folder and .oo3 file are automatically created, if they do not already exist).

(The latter two scripts were inspired by Jim Harrison's excellent scripts, which use the Finder rather than DEVONthink 2 http://jhh.med.virginia.edu/main/OmniFocusScripts)

A PS on DEVONthink
I was originally attracted to DEVONthink by its automatic OCR conversion of photocopy-based PDFs, and by the sheer flexibility and focus with which it can search (well beyond the scope of Spotlight) across a whole database of PDFs and other documents. (One could digress on its integration with DevonAgent, and on searches beyond the scope of Google Ė suffice it so say that this also rewards investigation if research is part of what you do).

As an alternative to the Finder for organizing folders and files, I particularly appreciate its contents panes, which remove much of the friction involved in seeing beyond the file name, particularly during searches.

For instructions on installing Applescripts, see:
http://forums.omnigroup.com/showthread.php?t=7453

Last edited by RobTrew; 2012-11-19 at 10:40 AM..
 
Just uploaded version 002 which gives the DEVONthink records clickable links back to the corresponding projects/tasks in Omnifocus.

Last edited by RobTrew; 2012-11-19 at 10:41 AM..
 
Hi Rob,

This is an exciting development in my workflow. Everything works very well except for OpenProjNotesInDevon.scpt. It sounds like it is supposed to put the 003 document in a notes file inside of the corresponding project folder. For me, the project goes to the global inbox and it has a dot in the document name. Each time I hit it I get a new file even if I already have a note file started for that project. Chances are I have a funky set-up on my machine.

Thanks for posting these!
 
Good - I'm glad you find this useful.

Quote:
Originally Posted by steve View Post
Everything works very well except for OpenProjNotesInDevon.scpt. It sounds like it is supposed to put the 003 document in a notes file inside of the corresponding project folder. For me, the project goes to the global inbox and it has a dot in the document name. Each time I hit it I get a new file even if I already have a note file started for that project. Chances are I have a funky set-up on my machine.
Sounds like there may be a timing issue. The notes file comes in through the virtual inbox and should then be moved to the appropriate folder. There seems to be slight a delay before the programming interface can see the initial copy in the Inbox.

I have amended the script to allow for this delay.

Last edited by RobTrew; 2009-06-14 at 10:14 AM..
 
Hello,
this seems like a great idea. Unfortunately, I'm useless when it come to scripts. Each time a I try to use the script it asks me if I want to create a new database. I don't want to create a new database, I would just like to add the folder to an existing database. Can you tell me what I need to add to the script?

thanks
 
Quote:
Originally Posted by connie View Post
I don't want to create a new database, I would just like to add the folder to an existing database. Can you tell me what I need to add to the script?
In each of the four scripts the first two statements are:


You will need to use the OS X Script Editor to amend these lines, so that they give the path and name of your existing DEVONthink database.

If your database is in a path descending from the [username]/Documents folder, then it will be enough to amend the database name (and any sub-path beyond your Documents folder) between quotes in the second statement.

For example:

Last edited by RobTrew; 2009-06-15 at 11:29 AM..
 
Thanks for this. Still not there yet, tho. I store my databases in dropbox. Does that matter? Here is the response I get when I try to it.

AppleScript reported the following error:
DEVONthink Pro got an error: Can’t get parent id 16257 of database 3

thanks again
 
Quote:
Originally Posted by connie View Post
I store my databases in dropbox. Does that matter? Here is the response I get when I try to it.

AppleScript reported the following error:
DEVONthink Pro got an error: Canít get parent id 16257 of database 3

The trick is to specify the full path of the database.

If you were using the OS X Drop Box sub-folder of your ~/Public folder, you would need:

property strDocsPath : (path to public folder as text) & "Drop Box"

If you are using the commercial Dropbox service, you will need:

property strDocsPath : (path to home folder as text) & "Dropbox"

Last edited by RobTrew; 2009-06-19 at 04:09 AM..
 
Have updated the script for opening .003 project notes in DEVONthink - simplifying the internals and making it a little faster when it initially creates the notes file.

Last edited by RobTrew; 2012-11-19 at 10:41 AM..
 
Hi, I'm particularly interested in the third script that opens a project folder and creates an .oo3 file if one isn't already created. The script creates a folder structure but doesn't create an oo3 file. Just an empty folder. Any idea what I'm doing wrong?

Thanks for these scripts... They're great.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Omnifocus & Devonthink 2 bashosfrog Applying OmniFocus 6 2012-01-13 11:36 PM
Integrating OmniFocus in your daily life Kevin Paquet Applying OmniFocus 7 2011-01-27 06:39 PM
OmniFocus and Devonthink Pro Office rmathes Applying OmniFocus 5 2009-12-14 08:59 AM
Integrating OmniFocus into your Life prominence Applying OmniFocus 4 2009-09-20 04:04 AM
Ad hoc links OmniFocus <--> Devonthink RobTrew OmniFocus 1 for Mac 4 2009-06-23 03:22 PM


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


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