Description
Originally posted on CAPH Tech (Note: Website is Japanese / 日本語), this script will search through your Evernote note collection for a link to the currently selected task/project/folder in OmniFocus.
Once the items are found, the script will display the results of the search in a separate Note Collection window.
The Code
tell front window of application "OmniFocus"
try
set theTrees to selected trees of content
if (count of theTrees) < 1 then
set theTrees to selected trees of sidebar
end if
if (count of theTrees) < 1 then
return
end if
set theSelection to value of item 1 of theTrees
if class of theSelection is folder then
set theURI to "omnifocus:///folder/" & id of theSelection
else if class of theSelection is project then
set theURI to "omnifocus:///project/" & id of theSelection
else
set theURI to "omnifocus:///task/" & id of theSelection
end if
tell application "Evernote"
open collection window with query string theURI
activate
end tell
end try
end tell
try
set theTrees to selected trees of content
if (count of theTrees) < 1 then
set theTrees to selected trees of sidebar
end if
if (count of theTrees) < 1 then
return
end if
set theSelection to value of item 1 of theTrees
if class of theSelection is folder then
set theURI to "omnifocus:///folder/" & id of theSelection
else if class of theSelection is project then
set theURI to "omnifocus:///project/" & id of theSelection
else
set theURI to "omnifocus:///task/" & id of theSelection
end if
tell application "Evernote"
open collection window with query string theURI
activate
end tell
end try
end tell
Quick Links
Want to open the script right away?
Click here to open it in your Script Editor
Click here to open it in your Script Editor
Using Snippets to manage your code?
Save this into Snippets
Save this into Snippets
New To AppleScript?
- Here's how to use the AppleScripts you find here and -- to make them even easier to use -- here's how run them with simple keyboard shortcuts!
- Be sure to check out other great AppleScripts in the Veritrope.com Code Library -- and share your own AppleScript projects using the quick submission form!





No Comments / Add Yours!