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
FWIW there is an even simpler and more direct idiom:

Code:
tell application id "com.devon-technologies.thinkpro2"
	tell database 1 -- or whichever database it happens to be
		set groupSync to sync group
	end tell
end tell
 
The OpenProjNotesInDevon script doesn't work for me. When it come to launch the OO3, it showed the following error message and stopped, please help
Both OF, OO3 and DevonThink Office Pro are the latest version
 
I've seen that once, but it didn't recur on my system - possibly some kind of timing issue.

The script does two things:
  • Tries to save the OO3 file in a temporary folder
  • Then imports it from the temporary file into DT2

The location of the temporary folder which it tries to use is determined by the line near the start of the script:
Code:
property strTempFolder : (path to temporary items folder as string)
It may be that Applescript sometimes hasn't retrieved a reference to the temporary items folder in time, or conceivably that there are permissions problems in writing to it.

I would begin by editing the line above to
Code:
property strTempFolder : (path to documents folder as string)
and then seeing if the problem persists.
 
Quote:
Originally Posted by RobTrew View Post
I've seen that once, but it didn't recur on my system - possibly some kind of timing issue.

The script does two things:
  • Tries to save the OO3 file in a temporary folder
  • Then imports it from the temporary file into DT2

The location of the temporary folder which it tries to use is determined by the line near the start of the script:
Code:
property strTempFolder : (path to temporary items folder as string)
It may be that Applescript sometimes hasn't retrieved a reference to the temporary items folder in time, or conceivably that there are permissions problems in writing to it.

I would begin by editing the line above to
Code:
property strTempFolder : (path to documents folder as string)
and then seeing if the problem persists.
It works fine now! Thanks a lot for your great work!!
 
Hi Rob -- The scripts works brilliantly! I have a request to change the mapping between OF and Devonthink folders. Not sure if this has been addressed before.

Right now the script "OpenProjFolderinDevon" when both my OF and Devonthink has exactly the same file hierarchy name.

Let's say I have 2 roles with my company, Right now On OmniFocus I have:
OF Library
- Work Role 1 Folder (under OF Library "root" folder)
--> Project 1
- Work Role 2 Folder
--> Project 1

And this directly reflects my Devonthink DB Folders:
- Work Role 1 Folder
--> Project 1 Folder

What I want is to simplify the "Folders" in OF into just "Work Folder", "Personal Folder" and "Someday / Maybe Folder". The reason is I have too many Work related "Folders" under the "root" Library folders, and my Personal folders are just buried...

What I'd like is this:
OF Library
- Work Folder
-- Work Role 1 Sub-Folder
---> Project 1
-- Work Role 2 Sub-Folder
---> Project 1
- Personal Folder
- Someday / Maybe Folder

And keeps the Devonthink DB Folder the same.

In other words, I want to map OF Library/Work Folder/Work Role 1 subfolder with Devonthink "Work Role 1 Folder.

Right now in OF if I move the "Work Role 1 Folder" under the newly created "Work Folder", the script will create a new Devonthink "Work Folder Folder" - "Work Role 1 Folder" -- "Project 1 Folder".

I look at the script and it seems that GetOFProjPath always get the Full path of the OF project. What should I change to achieve this?

Thanks in advance for suggestions!
/Peter
 
The path string returned by GetOFProjPath() is easily chopped up.
You can extract the sub-path that you want with code along the lines of:

Code:
-- make a copy of the existing text item delimiter (to be restored later)
set strDelim to my text item delimiters

-- Change the text item delimiter to allow segmentation of the full path
set my text item delimiters to "/"

-- Get a list of the path segments
set lstSegments to text items of GetOFProjPath()

-- Extract some sub-section of the full path, e.g.
set strLastTwo to (items -2 thru -1 of lstSegments) as string

-- restore the original text item delimiter
set my text item delimiters to strDelim
 
sorry to be so late to catch up on this, but when I want to export from OF to DevonThink, I want the action header and contents to be copied so I can delete the OF original.

I am trying to remove all non-project-specific information so finding an entry in DT that is merely a link back to OF isn;t what I need.

Any idea how I can tame this script?

cheers

pete
 
I plan to revisit this script fairly soon to make it less dependent on maintaining parallel hierarchies (perhaps by storing the UUID for a DevonThink folder in the note field of a project).

The idea is to be able to make changes in OmniFocus (folder hierarchies, position of particular projects within these hierarchies) without losing the link between an OF project and a DT folder.

Its possible that the new script may also be more helpful for your particular work-flow.

(Very happy to share scripts that I write to meet my own needs, and it might well be diverting to offer a customization service, but the days, alas, are short, and of uncertain number :-)
 
I am having trouble figuring out why the oo3 scripts aren't working for me. I have OO Pro and DT Pro. In trying to debug, I run OpenProjNotesInDevon from apple script editor. I get an error:

error "Can’t set URL of missing value to \"omnifocus:///task/aAO6PyXE1u4\"." number -10006 from URL of missing value

and the line that is highlighted is:


set URL of oMovedRec to strURL

The same thing happens if I try setting strTempPath to my documents folder, too.

I get a different problem with the other oo3 script - it creates an oo3 document, but puts it in my global inbox, not in my hierarchy. When I run it from the editor, the script stays running for a very long time - eventually AppleScriptEditor stops responding and I have to force-quit it.

The openProjectFolder script works fine.
 
This looks like the same issue as that discussed around post 53 above.

I will be revisiting these scripts in about two weeks, once a seasonal peak of work has subsided ...

In the meanwhile, what is your hardware and software platform ? My first impression is that this is a timing issue ...
 
 


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 01:53 AM.


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