Apple Mail Regel – DEVONthink Skript importiert auch Grafiken statt nur Dokumente

Dies ist der Code im Skript, der aktuell alle Anhänge, egal welcher Art, importiert:

set theFile to theFolder & (name of theAttachment)
tell theAttachment to save in theFile
tell application id "DNtp"
	set theAttachmentRecord to import path theFile to attachment_group
	set unread of theAttachmentRecord to (not theReadFlag)
	set URL of theAttachmentRecord to theSender
	perform smart rule trigger import event record theAttachmentRecord
end tell

Eine entsprechende Änderung könnte z.B. so aussehen:

set theFile to theFolder & (name of theAttachment)
if theFile does not end with ".png" and theFile does not end with ".gif" and theFile does not end with ".jpg" then
	tell theAttachment to save in theFile
	tell application id "DNtp"
		set theAttachmentRecord to import path theFile to attachment_group
		set unread of theAttachmentRecord to (not theReadFlag)
		set URL of theAttachmentRecord to theSender
		perform smart rule trigger import event record theAttachmentRecord
	end tell
end if

Ggf. muss die Abfrage noch um weitere Typen erweitert werden.