Tags automatisch vergeben je nach PDF Inhalt

Hallo,

ist es denn möglich TAGS automatisch zu vergeben? Je nachdem was in den PDF’s steht? Also zu sagen, es steht Telekom drin, dann soll er den TAG Telekom vergeben etc…

Wenn nicht, wie macht ihr das mit den TAGS? Vergebt ihr welche oder nicht?

Danke

Dafür brauchst du smart rules. Mehr Informationen dazu im Handbuch und in zig Threads hier im Forum.

Und: im Hauptforum ist die übliche Sprache Englisch. Deutsch verstehen hier nur wenige, dafür gibt es ein eigenes Forum unter International

Es lesen doch hier auch genügend mit, die deutsch antworten.

S. z.B. die Aktion “Tags aus Dokument hinzufügen” von intelligenten Regeln oder auch Werkzeuge > Stapelverarbeitung.

hier habe ich meine Regel, er trägt keine Tags ein

habe mal so getestet. Das funktioniert zwar, aber macht ja wenig Sinn, da ich sonst für Begriffe jeweils eine Regel anlegen muss

If you want to assign more than one tag in a smart rule, I believe you’d have to use a script. That can be written in AppleScript or JavaScript. It should contain a mapping of the words you’re looking for to the tags you want to use. In JavaScript, that could look like

let mapping = {"Fondsdepot" : "Fondsdepot",
                       "Telekom" : "Telekom",
                       "Bank 1" : "Bank 1",
}
mapping.forEach(m => {
  if (currentRecord.plainText().indexOf(m[0]) >= 0) {
      let oldTags = currentRecord.tags();
      oldTags.push(m[1]);
     currentRecords.tags = oldTags;
 }
})

This is just the scaffolding, of course. And it’s not tested at all. The same approach is certainly feasible with AppleScript, I’m just not very familiar with it.

You’d have to integrate this code in the (internal or external, it doesn’t matter) script for the rule. To do that, you might want to read up on scripts for smart rules in the documentation and in the various forum posts here and in the automation sub-forum.

A note of caution: “suffix is pdf document” is not a sensible condition in this case – the suffix does not tell you anything about the file type. I could easily change the suffix of a word or excel file to pdf. You might want to check for the number of words in the file. This also has been discussed in the forum at length.

1 Like

Thank you very much, but I don’t want to use Java Script.

Your choice. As I said:

i want only a solution in devonthink withour Scripts…

Sure. Then you’ll just have to write one smart rule per tag.

1 Like

Die Aktion Tags aus Dokument hinzufügen unterstützt beliebig viele Tags, nur die gefundenen werden hinzugefügt.