#825 ✓resolved
Michael A Osborne

Alfred's "Email to..." feature no longer compatible with Mailmate

Reported by Michael A Osborne | June 21st, 2014 @ 10:51 AM

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

Comments and changes to this ticket

  • benny

    benny June 23rd, 2014 @ 12:41 PM

    I don't see any obvious problems. I also tried taking the script and adding this line to test it:

    send_email_with_attachment("name", "email@example.com", "subject", "body", null)
    

    That seems to work too.

    Maybe compare with the scripts for the other email clients?

    (It's strange that it works when MailMate is not running...)

  • benny

    benny June 23rd, 2014 @ 01:17 PM

    • State changed from “new” to “resolved”

    Let me know if you figure out what triggers the problem.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Mac OS X email client.

Shared Ticket Bins

People watching this ticket

Pages