As a knowledge worker, I’ve used TheBrain, Mindmanager, DEVONthink Tinderbox, and now Obsidian. All have great features and paradigms, but only DEVONthink stays at the center of my workflows. Every week I find new ways to boost my productivity with DEVONthink.
I’m somewhat of a newbie when it comes to AppleScript, but I monitor this forum every day and I’m inspired to try more ways to use Smart Rules with scripting.
I want to build a Smart Rule for my task management. I routinely use a “Todo” label that I apply to DEVONthink documents that I want to act upon, and I then move them into Omnifocus for tracking and followup.
I modified a script found on this forum and I can’t seem to get it to work. What I’m trying to do is this: when I apply the “todo” label to a document, send the document to Omnifocus’ Inbox and add a link back to the DEVONthink document in the Omnifocus note. Then, change the DEVONthink table to “None” and apply a tag indicating I’ve processed it.
Here’s the AppleScript that I attach to my Smart Rule:
on performSmartRule(selection)
set theSummary to ("From Devonthink: " & name of selection) as string
set theURL to (reference URL of selection) as string
set label of selection to 0
set tags of selection to (parents of selection) & “sentToOmnifocus”
display alert “DEVONthink” message (selection) & " words."
– Add new to do to OmniFocus
try
tell application “OmniFocus”
tell default document to set newTask to make new inbox task with properties {name:theSummary, note:theURL}
end tell
end try
end performSmartRule
But–nothing happens!
What am I missing?
Thanks for any advice from forum members.