Email

Spark

Discussion Download

Here is a little plugin to use Spark from Alfred.

Download the file/plugin and put it into the folder at ~/Library/Application Support/Alfred/Plugins/Email/

-- Use Spark as default email application with Alfred
-- Based on MailMate plugin script: https://www.alfredforum.com/topic/2354-add-support-for-mailmate-email-client/

-- 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, _email, _name)
  set _to to _email
  if (_name is not "") then
    set _to to _name & " <" & _email & ">"
  end if
  return "mailto:?to=" & url_encode(_to) & "&subject=" & url_encode(_subject) & "&body=" & url_encode(_body)
end create_mailto

on send_email_with_attachment(ename, eemail, esubject, ebody, eattachment)
  set _mailto to create_mailto(esubject, ebody, eemail, ename)
  tell application "Spark"
    activate
    open location _mailto with trust
  end tell
  repeat with attachment in eattachment
    do shell script "open -a Spark \"" & attachment & "\""
  end repeat
end send_email_with_attachment
Previous
Next