Ich möchte folgendes bewerkstelligen:
Gescannte Dokumente, die einer OCR unterzogen wurden, sollen nach bestimmten Stichworten (z.B. EKG oder Neurologie) hin durchsucht werden und dann jeweils in eine Gruppe Neurologie oder EKG verschoben und mit den entsprechenden Begriffen getaggt werden. Das soll entweder manuell oder automatisch geschehen.
Ich dachte, das müsste mit einer Smart Rule und einem eingebettete Skript funktionieren, aber ich bekomme es nicht zum Laufen - allerdings bin ich auch nicht wirklich kompetent im Bearbeiten von Skripten.
Die Smart Rule, die ich angelegt habe, sieht so aus:
Das eingebettete Skript sieht so aus (das Skript habe ich übernommen aus DTP 2 - da hatte ich mal so einen vergleichbaren Workflow zum Laufen bekommen) :
property pKeywords : {"neurologie"}
on performSmartRule(theRecords)
tell application id "DNtp"
set theSelection to the selection
repeat with theRecord in theSelection
set theText to plain text of theRecord
set shouldTag to false
set theTags to tags of theRecord
repeat with theKeyword in pKeywords
if theText contains theKeyword then
set theTags to theTags & theKeyword
set shouldTag to true
end if
end repeat
if shouldTag then set tags of theRecord to theTags
repeat with theGroupName in pGroupNames
if theText contains theGroupName then
set theDatabase to database of theRecord
set theGroups to (parents of theDatabase whose name is theGroupName)
repeat with theGroup in theGroups
if tag type of theGroup is no tag then
move record theRecord to theGroup
exit repeat
end if
end repeat
end if
end repeat
end repeat
end tell
end performSmartRule
Wie gesagt, meine Kenntnisse diesbezüglich sind äußerst begrenzt und ich würde mich über Unterstützung freuen