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 09: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 09: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 09: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 10:29 AM..
 
Hello, could these scripts be used to link address book contacts with omnifocus. Specifially I would like to be able to be in address book and identify todos that are associated with that individual.
 
Quote:
Originally Posted by dwbrown77 View Post
Hello, could these scripts be used to link address book contacts with omnifocus. Specifially I would like to be able to be in address book and identify todos that are associated with that individual.
I haven't looked into an interface with the address book (These scripts interface with Devonthink, and will not, I think, be what you are after).
 
Hi Rob,

Firstly, thanks for the great scripts. In combination with the "Create OF Task" script from judismith of unofficialtechnology I have complete control over my workflow.

One thing which is a minor niggle more than anything else is the following error I'm getting when invoking the OpenProjNotesInDevon Script:

Code:
AppleScript reported the following error:
Finder got an error: Can’t get alias "Macintosh HD:Users:Hassan:Library:Application Support:OmniOutliner 3:Templates:Default.oo3template".
For now I am working around it by simply opening the project folder using your other script, then manually double clicking on the note file I have stored in DT. I'm pretty sure there is nothing interfering with the process as this is a completely fresh install of SL (just done a few hours ago) and these were the first to applications I installed.

I've done some investigation and there does not seem to exist a "Templates" folder at the path the script specifies, though I'm not sure what template to add there if I need to at all.

I also see someone had a similar error earlier, were you able to replicate it?

Thanks again.
 
Quote:
Originally Posted by Xeijin View Post
Code:
AppleScript reported the following error:
Finder got an error: Can’t get alias "Macintosh HD:Users:Hassan:Library:Application Support:OmniOutliner 3:Templates:Default.oo3template".
I've done some investigation and there does not seem to exist a "Templates" folder at the path the script specifies, though I'm not sure what template to add there if I need to at all.
By default there will normally be a file named Default.oo3template at that location, but of course it can be deleted.

The advantage of having one is that you can choose the default layout and formatting etc of the notes created with the script.

To get it working. Choose/create a blank OO3 file which on you would like your note files to be based, and use OO3's File > Save As Template ... to save it to

Code:
HD:Users:Hassan:Library:Application Support:OmniOutliner 3:Templates:Default.oo3template
(or the equivalent path from the user directory on your system)
 
 


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 10:36 PM
Integrating OmniFocus in your daily life Kevin Paquet Applying OmniFocus 7 2011-01-27 05:39 PM
OmniFocus and Devonthink Pro Office rmathes Applying OmniFocus 5 2009-12-14 07:59 AM
Integrating OmniFocus into your Life prominence Applying OmniFocus 4 2009-09-20 03:04 AM
Ad hoc links OmniFocus <--> Devonthink RobTrew OmniFocus 1 for Mac 4 2009-06-23 02:22 PM


All times are GMT -8. The time now is 06:38 PM.


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