Dear Benny
Alfred v2 has a neat
feature to quickly attach a specified file to a new email: "Email
to...". This feature uses the default mail client, and its
integration with Mailmate is described in this
Alfred Forum post.
For the last six months or so, this feature worked seamlessly:
in the last fortnight or so it stopped working.
I am using:
- OSX 10.9.3;
- Mailmate Version 1.8 (4338) (although the problem was also
present in 4158, from which I have just upgraded this morning);
and
- Alfred v2.3 (264).
The feature works correctly when:
- Mail is the default mail client;
- Airmail is the default mail client; and
- Mailmate is the default mail client, and Mailmate is not
running.
If I had to speculate, I'd guess that an update to Alfred was
the cause of the problem, as I'm sure the feature was still working
when I'd last upgraded Mailmate. Any help would be appreciated!
The relevant code, from "~/Library/Application Support/Alfred
2/Plugins/Email/MailMate.applescript", is pasted below.
-- Send an email with an attachment
on url_encode(theText)
return do shell script "printf " & quoted form of theText & " | xxd -u -plain | sed 's/\\(..\\)/%\\1/g' | tr -d '\\n'"
end url_encode
on create_mailto(_subject, _body, _attachments, _email, _name)
set _to to _email
if (_name is not "") then
set _to to _name & " <" & _email & ">"
end if
set _mailto to "mailto:?to=" & url_encode(_to) & "&subject=" & url_encode(_subject) & "&body=" & url_encode(_body)
repeat with _attachment in _attachments
set _filePath to POSIX path of _attachment
set _mailto to _mailto & "&attachment-url=file://" & url_encode(_filePath)
end repeat
return _mailto
end create_mailto
on send_email_with_attachment(ename, eemail, esubject, ebody, eattachment)
set _mailto to create_mailto(esubject, ebody, eattachment, eemail, ename)
tell application "MailMate"
open location _mailto with trust
activate
end tell
end send_email_with_attachment
Kindest
Mike