I am working on automating DT more fully that I have been.
This question relates to sharing documents by email. I see there is a Context-menu command called Send By Email. I also have an icon for the same. I am not sure if these came with DT or whether I installed them myself some times ago (the last time I worked on automating DT more).
The issue I have is that an email is generated, with the title in the subject, but with no attachment.
Is there a way I can fix this? Or perhaps a more current script, or some other option?
If you have this icon then you are using the built-in feature to send by email
If you have a contextual menu “Send by Email” command then you are definitely using the built-in feature (unless your coding is advanced enough to modify contextual menus).
In either case, the selected document should appear as an attachment in a draft message window in Apple Mail.
What edition and version of DEVONthink are you using? Does the failure occur always or some times? What types of document are you attempting to email (PDF, .doc, etc.)? Can you drag a document from DEVONthink into the body of a draft message?
I played around with it some more, and figure out the issue.
My email automatically has a signature applied to it, as per the Signature settings in Mail preferences.
When that is activated, the document does not attached from DT automatically. I can drag the document over manually without issue. Doesn’t matter if it’s an RTF, TXT, or PDF etc.
When I have the automatic signature disabled, the document attaches as expected.
So I suspect the scripting is not handling the situation in which Mail is adding a sig to the new email. Not sure if it makes any difference, but my sig happens to have an image in it (pulled in from a URL online).
UPDATE: I just did a test.
I set up a new text only signature. Set it to be applied automatically.
DT send by mail works as expected. The email is created, the signature appears, and the document is attached above the signature.
So it would seem this is an issue arising when the signature has an image in it. Or perhaps simply when the signature is html. Not sure.
Thanks for the clue … I tested your scenario over here (signature with an image in it) and there is definitely something odd going on. In my case, however, the document from DEVONthink appears in the draft email along with the signature+image, but only for a second. Then the image in the signature disappears and the document remains. I suspect this is more of an Apple Mail issue than DEVONthink – but it doesn’t work as expected in either case.
The alternate is to not configure Mail with a default signature, and then add the signature from the signature dropdown box in Mail, once the draft email containing the document sent over from DEVONthink is created.
Interesting. Thanks for trying that out.
I suspect it is an issue within Mail, for which there may be no solution from DT and AppleScript.
Dropping the automatic signature was about the only solution I could think of also. A pain though, as I always want the signature there and I only occasional send documents from DT. I think I’ll go with letting DT tell Mail to create a new email (so the title is automatically in the Subject) and then I’ll proceed with dragging the document over manually.