I’m about to move mail handling into DEVONthink as I can now import attachments in DT4:
Therefore I moved some code to handle incoming documents. While refactoring that script I came across a problem. In some other thread the use of record type
was recommended instead of using kind
in AppleScript.
I execute a script which has this variable declaration:
set theRecordType to record type of theRecord
set theKind to kind of theRecord
Unfortunately, only the kind attribute is set for the record. I expected both to be set.


Is this a bug or do I miss something?
unknown
is indeed the record type of emails as there‘s no dedicated type for them. This dates back to version 1.x and ensures compatibility of (most) scripts.
kind
is localized and therefore contains different values for different languages. record type
is independent of language settings. I was not aware that record type
is undefined for e-mails. Seems a bit unfortunate to me. Given that DT 2 came out 16 years ago, a tiny breaking change might perhaps be acceptable?
Given that DT 2 came out 16 years ago, a tiny breaking change might perhaps be acceptable?
And 4 is a major upgrade, that might be a good time for a breaking change.
kind
is localized and therefore contains different values for different languages. record type
is independent of language settings.
That is why I tried to go for record type
after you gave me that hint in another thread. 
We might change this til the final version.
2 Likes
The 3rd beta will already revise this.
Sounds great! Thanks a lot.