Script HAZEL / Devonthink / OmniFocus

Hi All,

I’m trying to use Hazel to automatically look for file in a specific folder to add it to devonthink AND then omnifocus with call back URL (x-devonthink-item://)

The workflow is :

  1. rename the files and tag it with “todo”
  2. send it to Devonthink inbox
  3. send it to omnifocus inbox with URL call back

I fail in scripting the devonthink to omnifocus send, I can only do it with the finder app way (and no x-devonthink-item:// back URL).

Is there a way to get the uuid of a file or to scan all inbox items with todo tags and send them to omnifocus ?

Thanks for your help.

Here is a simple example…

tell application id "DNtp"
	set newFile to import theFile to incoming group
	set {recName, recURL} to {name, reference URL} of newFile
	if (exists newFile) then tell application "Finder" to delete theFile
end tell

tell application "OmniFocus"
	tell default document to set newTask to make new inbox task with properties {name:recName, note:recURL}
end tell

2 Likes

This worked perfectly for me - thank you!

No problem.