Änderung des Zielordners im E-Mail Script

Hallo,

wie kann ich im Apple Script “Mail Rule - Add attachments to DEVONthink Pro” das Ziel ändern, so dass die Dateien in einem Ordner namens Anhänge in einer Datenbank namens E-mail gesichert werden. Das Script schaut standardmäßig so aus:

using terms from application “Mail”
on perform mail action with messages theMessages for rule theRule
tell application “Mail”
set theFolder to (POSIX path of (path to temporary items))
repeat with theMessage in theMessages
set theSender to the sender of theMessage
repeat with theAttachment in mail attachments of theMessage
try
set theFile to theFolder & (name of theAttachment)
tell theAttachment to save in theFile
tell application id “DNtp”
set theAttachmentRecord to import theFile to incoming group
set URL of theAttachmentRecord to theSender
end tell
end try
end repeat
end repeat
end tell
end perform mail action with messages
end using terms from

Ich denke es muss etwas an der Zeile:
set theAttachmentRecord to import theFile to incoming group
geändert werden umd die Datenbank und den Zielordner zu bestimmen, so dass es nicht immer in der globalen Inbox landet.

Vielen Dank

Viele Grüße
MaK

Sie könnten die Zeile durch folgenden Code ersetzen, sofern die Datenbank immer geöffnet ist:


	set theDatabase to database "E-mail"
	set theGroup to get record at "/Anhänge" in theDatabase
	set theAttachmentRecord to import theFile to theGroup

Alternativ öffnet dieser Code ggf. die Datenbank:


	set theDatabase to open database "/path/to/myDatabase.dtBase2"
	set theGroup to get record at "/Anhänge" in theDatabase
	set theAttachmentRecord to import theFile to theGroup

Funktioniert Prima, vielen Dank