Jump to content
deanishe

MailTo: Select multiple Contacts *and* Groups and compose in your favourite email app

Recommended Posts

I take it the update worked, then? Sorry for sitting on the fixed version for months. I really thought I'd uploaded it. Totally my bad :(

 

WRT usage, I think it's a bit of a niche thing.

 

I think most users don't use Alfred for simple mails, as it's faster to open your email client (via a shortcut or whatever) and start typing a contact's name/address.

 

The killer feature for me (and the reason I wrote the workflow) is because I send a lot of mails to groups/mailing lists. No email client (or Alfred) seems to bother reading groups from Contacts, and MailTo is sooooo much easier (and faster) than opening Contacts, right-clicking a group and selecting Send Email to….

Even if you don't use groups much, MailTo has the brains to show a contact's email addresses in the correct order (primary first, then as in Contacts). Many email clients (e.g. Airmail) aren't this smart.

Share this post


Link to post

Sure. That's kind of the whole point. I'll try to make that clearer in the original post.

 

Be sure to TAB on a contact to add it to the list of recipients (not ENTER). The email will be added to Alfred's search field, plus a comma. Then just start typing the next name/email. TAB again to add that one, or hit ENTER (or ⌘+NUM) to add the selected contact and start composing your mail.

 

I'm going to have a crack at contact groups next.

 

Hmmm I think that TAB is not working for me, If I type in 'mailto bob' in alfed and hit tab on the first contact the text in my alfred input field is highlighted. I expect the name is expanded and a comma added after this name and I can type again in the alfred search field.

 

Alfred v2.3 (264), OS X Mavericks

 

Thanks!

Edited by primeminister

Share this post


Link to post

The workflow doesn't work with the Mailbox beta for mac. It opens an email but the address is wrong with %20 etc for certain signs. I looked a little into the code and was wondering whether it is possible to add client specific rules for Mailbox? I am happy to share a beta coin if that helps...

 

Thanks for the great workflow!

Share this post


Link to post

Thanks. Unfortunately, I can't test it because I don't have (can't get) the Mailbox beta.

 

I will look into it properly when I can get a copy. There won't be "official" support until the app is released, however.

Edited by deanishe

Share this post


Link to post

Dean, Mailbox supports onl Gmail and iCloud; since you don't use either of those, you might be limited in that you wouldn't be able to test it. However, if you want access to the beta, send me an email, and I'll send you a "beta-coin" (read: gimmicky-invite).

Share this post


Link to post

I have at least 8 Gmail accounts and an iCloud one as well, I think. At any rate, it's not actually necessary to be able to send or receive mails, just to run the program in order to test the workflow.

 

So, yeah, I could definitely use one of these "beta-coins" shimmy-tangs in order to test the workflow.

 

I'm up to my neck in work at the moment, however, so I can't promise that I'll be able to fix 'er up this weekend. It shouldn't be a big deal (max. 30 minutes is my optimistic/naïve estimate), but if it is, it'll have to wait.

 

Also, looking over the code, I'm almost overwhelmed by the urge to totally rewrite/refactor it.

 

If I could easily understand what my own code is doing, I probably would have already…

 

Comment your code, boys and girls. Comment it for a clueless person. Because you'll come back to it a year later, and that clueless person will be you  :(

Edited by deanishe

Share this post


Link to post

So, yeah, I could definitely use one of these "beta-coins" shimmy-tangs in order to test the workflow.

 

Sent.

 

 

Also, looking over the code, I'm almost overwhelmed by the urge to totally rewrite/refactor it.

 

Get the Python bundler in shape first so that we can get the next version out. Chop, chop.

Share this post


Link to post

Added support for the Mailbox beta in v1.4.

 

Unfortunately, Mailbox's support for the mailto: protocol is crap and it only accepts email addresses (no names).

Share this post


Link to post

Is there a simple way to get this workflow to work if the following output is seen from "python mailto.py client" as run from the workflow directory? Hoping to be able to associate it with "Airmail beta" btw but can't get past this python error.

 

Traceback (most recent call last):

  File "mailto.py", line 62, in <module>

    from contacts import get_contacts, CACHEPATH

  File "/Users/rudders/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.017AEB4B-0277-4ECA-8D83-366E9EE282FF/contacts.py", line 29, in <module>

    log = logger(u'contacts')

  File "/Users/rudders/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.017AEB4B-0277-4ECA-8D83-366E9EE282FF/log.py", line 25, in logger

    s = Settings()

  File "/Users/rudders/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.017AEB4B-0277-4ECA-8D83-366E9EE282FF/settings.py", line 54, in __init__

    self._load()

  File "/Users/rudders/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.017AEB4B-0277-4ECA-8D83-366E9EE282FF/settings.py", line 65, in _load

    self['system_default_app'] = self._get_system_default_client()

  File "/Users/rudders/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.017AEB4B-0277-4ECA-8D83-366E9EE282FF/settings.py", line 81, in _get_system_default_client

    for h in d['LSHandlers']:

KeyError: u'LSHandlers'

Share this post


Link to post

Thanks for the prompt reply.

 

Was very promising as it let me choose my email client then it started crashing again. I deleted the workflow folder and reinstalled by still get the following errors.

 

user.workflow.3F86F54B-AE2A-4851-9D55-60974713E4D1 rudders$ python search.py Tony

Traceback (most recent call last):

  File "search.py", line 26, in <module>

    from contacts import get_contacts

  File "/Users/rudders/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.3F86F54B-AE2A-4851-9D55-60974713E4D1/contacts.py", line 29, in <module>

    log = logger(u'contacts')

  File "/Users/rudders/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.3F86F54B-AE2A-4851-9D55-60974713E4D1/log.py", line 25, in logger

    s = Settings()

  File "/Users/rudders/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.3F86F54B-AE2A-4851-9D55-60974713E4D1/settings.py", line 54, in __init__

    self._load()

  File "/Users/rudders/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.3F86F54B-AE2A-4851-9D55-60974713E4D1/settings.py", line 59, in _load

    for key, value in json.load(file).items():

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 290, in load

    **kw)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads

    return _default_decoder.decode(s)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 368, in decode

    raise ValueError(errmsg("Extra data", s, end, len(s)))

Share this post


Link to post

Try running python mailto.py delcache from Terminal in the workflow folder.
 
That will reset the settings and the cache and should fix the problem. Probably…

Share this post


Link to post

And the result.. sorry to be a pain.... 

 

user.workflow.3F86F54B-AE2A-4851-9D55-60974713E4D1 rudders$ python mailto.py delcache

Traceback (most recent call last):

  File "mailto.py", line 62, in <module>

    from contacts import get_contacts, CACHEPATH

  File "/Users/rudders/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.3F86F54B-AE2A-4851-9D55-60974713E4D1/contacts.py", line 29, in <module>

    log = logger(u'contacts')

  File "/Users/rudders/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.3F86F54B-AE2A-4851-9D55-60974713E4D1/log.py", line 25, in logger

    s = Settings()

  File "/Users/rudders/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.3F86F54B-AE2A-4851-9D55-60974713E4D1/settings.py", line 54, in __init__

    self._load()

  File "/Users/rudders/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.3F86F54B-AE2A-4851-9D55-60974713E4D1/settings.py", line 59, in _load

    for key, value in json.load(file).items():

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 290, in load

    **kw)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads

    return _default_decoder.decode(s)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 368, in decode

    raise ValueError(errmsg("Extra data", s, end, len(s)))

ValueError: Extra data: line 10 column 2 - line 10 column 3 (char 219 - 220)

Share this post


Link to post

Bugger!
 
Could you try deleting your ~/Library/Application Support/Alfred 2/Workflow Data/net.deanishe.alfred-mailto and running the workflow again. If the error persists, could you email me the settings.v-1.4.1.json file in the above directory and your ~/Library/Preferences/com.apple.LaunchServices.plist file? With your files, I should be able to replicate the error and fix it.

 

Which version of OS X are you using, btw?
 
I'll PM you my email address.

Share this post


Link to post

Thanks mate - Yosemite GM1

 

I'll see what I can do, but I really can't make any promises regarding Yosemite: I don't install any major new OS version (let alone betas) until I'm certain all the apps I need for work run properly on it.

Share this post


Link to post

Today I installed the latest Beta and it's pulling my contacts and doing the auto complete with the Tab key fine, at least in the Alfred entry bar is working, once I press Enter key it will switch to my email client (Airmail 2) and will open a Blank email form, but there will be no email address on the To: field, it will be blank, it seems like the parameters (email addresses) are not being passed from Alfred to the email client, I am using Yosemite 10.10.3, please any help will be appreciated, thanks

Share this post


Link to post

The MailTo v2 beta knows how to handle Airmail 1, but I'm afraid I can't say what the problem is because I don't own Airmail 2, and I'm not going to spend €10 to test it…
 
You could have a look at the relevant part of the workflow's docs, and in particular the Other clients section, and see if you can figure out the right configuration for Airmail 2.
 
If you can, a pull request would be much appreciated. But I'm afraid I won't be implementing support for Airmail 2 until I can lay my hands on a free copy or get it in a bundle.

Share this post


Link to post

Hello, 

The auto-complete with the tab doesn't work. I am using the v2 beta workflow and Yosemite. My email client is chrome-gmail. Any ideas about what is wrong?

 

Thanks!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×