Mail-Skript und spezielle Datenbank und spezieller Ordner

Hi,

wie kann ich das fertige Appleskript von DT bezüglich der Speicherung der E-Mail so ändern das ich es in die Datenbank (z.B. “Testdatenbank”) und den darin enthaltenen Ordner (z.B. “Testordner”) ablegen kann.

Das Skript legt nämlich die E-Mail nur in den globalen Eingang.

-- Mail Rule - Add messages to DEVONthink
-- Created by Christian Grunenberg on Mon Apr 19 2004.
-- Copyright (c) 2004-2020. All rights reserved.

-- this string is used when the message subject is empty
property pNoSubjectString : "(no subject)"

using terms from application "Mail"
	on perform mail action with messages theMessages for rule theRule
		tell application "Mail"
			repeat with theMessage in theMessages
				try
					tell theMessage
						set {theDateReceived, theDateSent, theSender, theSubject, theSource, theReadFlag} to {the date received, the date sent, the sender, subject, the source, the read status}
					end tell
					if theSubject is equal to "" then set theSubject to pNoSubjectString
					tell application id "DNtp"
						set theRecord to create record with {name:theSubject & ".eml", type:unknown, creation date:theDateSent, modification date:theDateReceived, URL:theSender, source:(theSource as string), unread:(not theReadFlag)} in incoming group
						perform smart rule trigger import event record theRecord
					end tell
				end try
			end repeat
		end tell
	end perform mail action with messages
end using terms from

Ich denke das ich den Ablageort hier bestimmen muss:

set theRecord to create record with {name:theSubject & ".eml", type:unknown, creation date:theDateSent, modification date:theDateReceived, URL:theSender, source:(theSource as string), unread:(not theReadFlag)} in incoming group

Aber was nehme ich dann hier anstelle von “incoming group”

VG
Clamsy

Folgendes sollte funktionieren:

set theDest to get record at "/Testordner" in database "Testdatenbank"
set theRecord to create record with {...} in theDest

Dankeschön. Jetzt klappt es :smiley:

1 Like

Alternativ kann natürlich auch eine intelligente Regel die E-Mails direkt nach dem Import verschieben (und sonstige Aktionen ausführen).