Hallo zusammen,
ich habe versucht meinen Workflow zu verbessern. Aus diesem Grund wollte ich ein Script erstellen, dass erst das PDF mit OCR konvertiert und automatisch den Namen/Tags vergibt.
Probleme habe ich nur mit der OCR Konvertierung.
Führe ich das Script via DEVONthink aus, kommt bei “convert image record” immer eine Fehlermeldung: “DEVONthink Pro got an Error: AppleEvent timed out”.
Führe ich da Script im Script Editor aus, wird ein PDF+Text ohne Fehler erstellt.
Ist es ein Fehler in DEVONthink oder muss ich nur das Script nur anders schreiben, um kein Fehler zu bekommen?
tell application id "DNtp"
try
set theSelection to selection
if theSelection is {} then error "Please select some contents."
repeat with thisItem in theSelection
if type of thisItem is PDF document and word count of thisItem is 0 then
set thisNewItem to convert image record thisItem with waiting for reply
move record thisItem to (trash group of database of thisItem)
end if
end repeat
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
end try
end tell
In diesem Thread geht es um ein ähnliches Thema. Das Script aus diesem Thread hat bei mir leider auch nicht funktioniert.
-- The Right Way To Do Convert to Searchable PDF
-- Created by Annard Brouwer on Good Friday 2008.
tell application "DEVONthink Pro"
activate
try
set thisSelection to the selection
if thisSelection is {} then error "Please select some scans."
repeat with aRecord in thisSelection
with timeout of 3600 seconds
try
set newRecord to convert image record aRecord
set name of newRecord to name of aRecord
on error errMsg number errNo
if errNo is equal to 9104 then
log message errMsg info (name of aRecord) & ": Check “~/Library/Caches/DEVONthink Pro/OCR” for files that weren't imported"
else
log message errMsg info (name of aRecord)
end if
end try
end timeout
end repeat
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
end try
end tell
Danke für eure Hilfe
MacOS Sierra 10.12.2 (16C67)
DEVONthink Office Pro 2.9.8