Hi, I’ve been using the following script to monitor a folder to add reading material to Devonthink and add a task to Omnifocus. Now that Reading LIst syncs across devices, I would also like to add the imported document to the Reading List. Any suggestions would be welcome!
-- DEVONthink - Import, OCR & Delete.applescript
-- Created by Christian Grunenberg on Fri Jun 18 2010.
-- Copyright (c) 2010-2014. All rights reserved.
-- Add to OmniFocus portion of the script from David Sparks
-- Scripts mashed up to Import, OmniFocus, & Delete by Chris Upchurch
on adding folder items to this_folder after receiving added_items
--say "Script Launched"
try
if (count of added_items) is greater than 0 then
tell application id "DNtp" to launch
--say "App launched"
repeat with theItem in added_items
set lastFileSize to 0
set currentFileSize to 1
repeat while lastFileSize ≠ currentFileSize
delay 0.5
set lastFileSize to currentFileSize
set currentFileSize to size of (info for theItem)
end repeat
try
set thePath to theItem as text
--say thePath
if thePath does not end with ".download:" then
--say "Not download"
tell application id "DNtp"
--say "DNtp"
--if exists incoming group then say "Incoming"
set theRecord to import thePath to incoming group
if exists theRecord then tell application "Finder" to delete theItem
--if exists theRecord then say "Exists"
set theTask to "Read/Review: " & name of theRecord
set theURL to reference URL of theRecord
--say name
--say theURL
end tell
tell application "OmniFocus"
tell default document
set theTag to (the first flattened tag where its name = "Anywhere")
set theProject to (first flattened project where its name = "Read/Review")
tell theProject
set newTask to make new task with properties {name:theTask, note:theURL, primary tag:theTag}
end tell
end tell
end tell
end if
end try
end repeat
end if
end try
end adding folder items to