Hallo, Leute!
Gibt es in DevonTHINK eine Möglichkeit, oder gibt es ein Script, dass die von mir vergebenen TAGs in die jeweilige PDF fest als Keywords geschrieben werden?
Es geht darum, dass ich ja alle auf dem Mac von DevonTHINK erzeugten PDFs auf meine Windowsrechner verteile. Es wäre schön, wenn ich diese Tags dort auch bei der Volltextsuche verwenden könnte.
Wenn du DevonThink Pro Office hast kannst du AppleScript nutzen in Verbindung mit "ExifTool" von Phil Harvey
Ich nutze derzeit das Programm um bei meinen Bildern Tags hinzuzufügen. Mit diesem Tool kann man auch bei PDF Keywords hinzufügen, ich habe das bei 2 PDF ausprobiert.
Das Programm kann man auf dieser Seite downloaden
http://www.sno.phy.queensu.ca/~phil/exiftool/
Das Programm und den lib Ordner habe ich in den Pfad /usr/local/bin kopiert.
Die zwei AppleScript die Ich nutze habe ich in einem zip bei Dropbox hochgeladen.
https://www.dropbox.com/s/q4bpbppa8enpogo/Devonthink PDF Keyword AppleScript.zip?dl=0
Die Scripte in den DevonThink Script Ordner kopieren, dann kann man diese auch über das Menü auswählen und ausführen
Keyword to Tag
tell application id "DNtp"
try
set theSelection to selection
if theSelection is {} then error "Please select some contents."
#Progessbar
set theSelectCount to count of theSelection
show progress indicator "IPTC Keywords to Tag" steps theSelectCount with cancel button
repeat with thisItem in theSelection
step progress indicator (name of thisItem) as string
if the type of thisItem is equal to PDF document then
#Pfad zur Datei auslesen
set thisPath to path of thisItem
#Keywords auslesen
tell current application
set theKeywords to (do shell script "/usr/local/bin/exiftool -PDF:keywords " & quoted form of thisPath) as string
end tell
#"Keywords :" löschen um nur die Keywords zu haben
set theKeywords to (characters 35 thru (count of theKeywords) of theKeywords) as string
#Keywords trennen
set AppleScript's text item delimiters to ","
set theKeywords to text items of theKeywords
#Keywords zählen
set Counter to count text item of theKeywords
#Keywords zu einem String zusammen fügen
set TheTag to text item 1 of theKeywords
if Counter > 1 then
repeat with i from 2 to Counter
set thisTag to text item i of theKeywords
set TheTag to TheTag & ";" & thisTag
end repeat
end if
set AppleScript's text item delimiters to ""
#Tag hinzufügen
set AppleScript's text item delimiters to ";"
set theTags to text items of TheTag
set tags of thisItem to theTags
set AppleScript's text item delimiters to ""
end if
end repeat
hide progress indicator
on error error_message number error_number
log message "Keyword to Tag" info (name of thisItem)
hide progress indicator
if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
end try
end tell
Tag to Keyword
tell application id "DNtp"
try
set theSelection to selection
if theSelection is {} then error "Please select some contents."
#Progessbar
set theSelectCount to count of theSelection
show progress indicator "Tag to IPTC Keywords" steps theSelectCount with cancel button
repeat with thisItem in theSelection
step progress indicator (name of thisItem) as string
if the type of thisItem is equal to PDF document then
#Tags auslesen
set TheTags to tags of thisItem
#Pfad zur Datei auslesen
set thisPath to path of thisItem
#Keywords hinzufügen
set theKeyword to ""
repeat with thisKeyword in TheTags
if theKeyword is "" then
set theKeyword to "-PDF:keywords=" & quoted form of thisKeyword
else
set theKeyword to theKeyword & " -PDF:keywords=" & quoted form of thisKeyword
end if
end repeat
tell current application
do shell script "/usr/local/bin/exiftool -overwrite_original " & theKeyword & " " & quoted form of thisPath
end tell
synchronize record thisItem
end if
end repeat
hide progress indicator
on error error_message number error_number
log message "Tag to Keyword" info (name of thisItem)
hide progress indicator
if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
end try
end tell