I’ve created an updated version of the script here: Separate imported e-mail attachments for better search that does the following:
- Separate attachments from e-mails (.eml files)
- Add attachments and original e-mail to a new group
- Add a backlink (x-devonthink-item://) to the attachments referring to the original e-mail
- Update the timestamps of the group and attachments based on the original e-mail