In the past, I used Christian Grunenberg’s Import, OCR & Delete script to move files placed in a folder called “To Devonthink” into Devonthink, OCR them and then delete them from the original folder. Unfortunately, at some point that script stopped working, so now files placed in that folder just sit there; they aren’t imported into DTP, they aren’t OCR’ed, and they aren’t deleted.
I’m using DevonThink Pro 2.8.8 on a MacBook Air mid-2011 running OS X 10.11.2 El Capitan. I checked and the script is “attached” to the “To Devonthink” folder and Folder Actions are active and the script is selected. I’m not quite sure when the script/Folder Action/whatever stopped working, but I’m sure it’s been several OS X system updates ago (and perhaps several DTP updates ago as well).
The script I have is set forth below. Can anyone suggest a fix?
-- DEVONthink - Import, OCR & Delete.applescript
-- Created by Christian Grunenberg on Fri Jun 18 2010.
-- Copyright (c) 2010-2014. All rights reserved.
on adding folder items to this_folder after receiving added_items
try
if (count of added_items) is greater than 0 then
tell application id "DNtp" to launch
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
if thePath does not end with ".download:" then
tell application id "DNtp"
set theRecord to ocr file thePath to incoming group
if exists theRecord then tell application "Finder" to delete theItem
end tell
end if
end try
end repeat
end if
end try
end adding folder items to
(Fixed: BLUEFROG 2016-01-25)