Hallo,
gibt es die Möglichkeit, ein Script so zu erweitern, dass einer Datei direkt ein Etikett in Devonthink zugeordnet wird?
Ich benutze dieses Script zum Überwachen eines Ordners:
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"
launch
set theGroup to get record with uuid "xxxxxxxxxxxxxxxxxxxxxxxxx"
end tell
repeat with theItem in added_items
try
set thePath to theItem as text
if thePath does not end with ".download:" and thePath does not end with ".crdownload:" then
tell application id "DNtp"
set theRecord to import thePath to theGroup
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
… und diese zum Verarbeiten in Hazel:
tell application "Finder"
set _path to (the POSIX path of theFile as string)
set {_name, _extension} to {name, name extension} of theFile
-- optional: hide extension in Finder
set extension hidden of theFile to true
-- optional: remove extension for DEVONthink displays
set _name to text 1 thru -((count _extension) + 2) of _name
set _extension to "." & _extension
end tell
-- Launch DEVONthink if it isn't already open.
tell application "System Events"
if not (exists process "DEVONthink Pro Office") then
tell application id "com.devon-technologies.thinkpro2" to activate
end if
end tell
-- Import the file.
tell application id "com.devon-technologies.thinkpro2"
set theGroup to get record with uuid "xxxxxxxxxxxxxxxxxxxxxxxxx"
-- choose one option, Index or Import, comment out the other
set theImport to import _path name _name to theGroup
-- set theIndex to indicate _path to theGroup
end tell
Kann ich diese Scripte um die Zuordnung eines Etiketts erweitern? Leider habe ich von Scripts keine Ahnung, daher wäre ich für ein Beispiel sehr dankbar.
Grüße
doescher