Attachments not attached on Send Mail action

The message arrives but comes without attachment.

CloudApp

Is it a bug in el cap?

Hey Leonardo,

The send-mail KM action is presently broken.

-Chris

Mail appears to have changed its interface for sending messages. I will look in to it and see what can be done to make the action work again, if possible.

You may be able to use AppleScript to accomplish the same thing (which is more or less what Keyboard Maestro is doing anyway).

I should have mentioned – scope out this topic:

* Note the expand and go-to buttons in the frame.

-Chris

I have looked in to this and determined it is a bug in Mail’s AppleScript support in El Capitan that is very difficult to work around.

Basically, Mail does not send attachments via AppleScript without a long delay.

You can see this in action with the AppleScript:

tell application "Mail"
	
	set theSubject to "Subject" -- the subject
	set theContent to "Content" -- the content
	set theAddress to "whoever@apple.com" -- the receiver 
	set theSignatureName to "Standard" -- the signature name
	set theAttachmentFile to "Zany:Users:username:file" -- the attachment path
	set msg to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true}
	
	tell msg to make new to recipient at end of every to recipient with properties {address:theAddress}
	tell msg to make new attachment with properties {file name:theAttachmentFile as alias}
	
	set message signature of msg to signature theSignatureName
	
	--	send msg
end tell

Without the send msg line, the mail message appears and then at some later time the attachment appears.

With the send msg line, the mail message is sent before the attachment is attached by Mail.

Unfortunately, there is no good workaround for this.

The best I can do is add some sort of configurable delay before the send, but it has to be quite large (10 seconds maybe), and perhaps the length depends on a number of factors like the size of the file.

I have not been able to figure out any way to ask Mail when the attachment is actually attached (perhaps an AppleScript guru can figure out some clever trick here?).

I have reported this to Apple, but my experience with Apple fixing bugs in Mail tends to indicate the resolution will be a long time coming.

This is fixed in 7.0.2

Hi Peter, sorry for jumping on an old thread but curious what you did to solve this issue. I’m trying to harden up an mail send without guessing on a suitable delay value, but I have not found anything in Mail to give me a clue when the message is ready to go.

TIA

Brad

PS: long-time Keyboard Maestro user

I believe the requirements are:

  • open the message visible and leave it visible.
  • wait 10 seconds after attaching a document before sending it.