October 9, 2003  ·  Lessig

I’ve been experimenting with Apple’s mail client, “Mail” (note to product development: generic names make it very hard to search on product specific information), and have been frustrated that an obvious function is not in Mail (or any other client I’ve seen).

The obvious function is the ability to define a hot key that will move a message to a specified folder. I had built (and had built) tools in Entourage to enable me to hit, say, ctrl+f, and the highlighted message(s) would be moved to the friends folder. I know you mice-on-the-brain sorts like to do that with the (insanely inefficient) drag function, but I like keys.

Anyway, I asked coder Jonathan Nathan whether he could help me out on this, and he put together a couple cool little Applescripts that get close. (He’s GPL’d them here).

The hard coded version lets you code in the name of a folder. The variable gives you a list of folders to toggle through. Both require a keyboard utility to invoke the script. And both face a similar problem: Sometimes the utility will “forget” which message is highlighted so it forgets which message to highlight next.

Both problems come from the relatively immature stage of development that “Mail” is in. Interestingly, in MS Entourage you could invoke a script from the keyboard without a utility, and it had no problem remembering where it was on list of messages. (It’s also relatively easy to find information about “Entourage” on the web.)

Thanks to Jonathan Nathan for his free (as in beer and as in speech) code. Any ideas to tweak it would be appreciated.

  • http://paulfrankenstein.org/ Paul Frankenstein

    Apple’s Mail tool is often referred to as Mail.app (capitalization may vary) to distinguish it from generic mail clients…

  • http://www.hughes-family.org/craig Craig Hughes

    You can create a mail rule which applies an applescript to the currently selected message(s) when you press Cmd-Opt-L

  • http://acad.depauw.edu/~asubedi asubedi

    Prof. Lessig,
    Here is a geeky question…

    What machine do you run? What are the specs of your machine? I searched your website and only found that you run (ran?) Debian GNU/Linux and present your “Powerpoint” presentation through OpenOffice.


  • John Brewer

    MailSmith from BareBones (http://www.barebones.com/) not only has very pervasive applescript (and other osa script) support, but also allows you to apply keyboard shortcuts to applescripts as well as re-configure all of the keyboard shortcuts to suit yourself. BareBones also produces BBEdit and MailSmith inherits fantastic text handling capabilities (in addition to the other features mentioned) from it.

  • http://www.crossroads.net/a Adam Rice

    Gyazmail (http://www.gyazsquare.com/gyazmail/) allows you to customize the hotkeys. It has some other features I like, some that I don’t.

  • http://acad.depauw.edu/~asubedi asubedi

    Mutt (www.mutt.org) is the ultimate email client. It is completely text oriented and not only there are hotkeys for everyting, you can define hotkeys for things like different signature for different recievers. It probably has the best GnuPG support of all MUA’s and, with help of other programs, can view any MIME types.

  • http://nikita.ca/ Nikita Borisov

    I believe the revised version of Mail.app included with Panther (coming out later this month) will include a scripts menu that will simplify this task a bit. The documentation says you will be able to create scripts that are invoked by a keyboard shortcut and operate on the currently selected messages.

  • http://the-goddess.org/blog/index.html Morgaine Swann

    I think Apple neglects mail.app because they assume everyone uses Microsoft:office. Personally, I haven’t found any other mail apps for OS X that I like as much as mail.app. As for Entourage, I won’t put one penny more in Gate’s pockets than I have to, so lets all hope that Panther has a scripts menu and actually takes our old mail off the server!

  • wild bear

    What’s wrong with Eudora? Seems terribly robust to me.

  • http://www.aaronsw.com/ Aaron Swartz

    I had the exact same problem; I started using Cocoa Gestures but something that could be activated by a key would be much nicer. But how do you bind these AppleScripts to a key?

  • http://www.livingroom.org.au/blog Darren Rowse

    I had been thinking the same thing just this morning as I tediously dragged and dropped all my email into appropriate folders…there has to be an easier way.

  • http://homepage.mac.com/jonn8/as/ Jonathan Nathan

    To bind these AppleScripts to a keyboard equivalent, I like the freeware launcher Xkeys by David Stark.

  • Mike Perry

    Even better would be an email program that you could train to KNOW which folder to place each email based its source. Hit a single ‘put away’ key, and it would know to put an email from john@isp.com into the Friends/John folder. (It could also be smart enough to learn to put all mail from one corporate source into a specific folder.) Last but not least, it could be told to put the mail you SEND to someone in that person’s folder. That would make it far easier to follow a trail of correspondence.

    I’ve meant to suggest this to Apple for months. Except for its SPAM scanning Mail is rather lack-luster. This one feature would make it a first-class mail program.

    –Mike Perry

  • Nick

    Uh, Mail.app already has those abilities. Just go to Preferences | Rules and you can set it up to recognize that emails from (or to) a particular corporate source belong in a special folder and put it there automatically.

    So I guess that makes it a first-class mail program. :)

  • lessig

    thanks for the tips and clarifications. see how much you learn by revealing your ignorance! And asubedi — where on my website does it say that? I have machines that I’ve installed GNU/Linux on (and some installed for me), but my machine in my hand is a Mac. And while I’ve spent a great deal of time showing how cool stuff can be done by making Powerpoint simple, I’m switching to something else soon. MSFT programs are the only programs that crash in OS X (that I’ve found, at least).

  • http://www.aaronsw.com/ Aaron Swartz

    OK, I think I’ve figured out how to do pretty much what I wanted, although it may only work on Panther:


    Thanks for the help, everyone.

  • http://acad.depauw.edu/~asubedi asubedi

    Prof. Lessig,

    Its in someone else’s comment! Sorry for the confusion.



  • http://www.aaronsw.com/ Aaron Swartz

    Oops, my solution doesn’t select the next message. I can use the UI scripting to have it select the next menu item, and that properly selects the next message, but selecting menu items doesn’t work from the scripts menu (which itself works by selecting a menu item). Aargh!

  • http://www.agblog.com Dany Silverman

    Another solution is to use server-side filtering. I use procmail and about 95% of the time it puts things in the right place and I don’t have to worry about dragging stuff about. The learning curve is a bit steep, but the benefits are pretty great, especially if you check your (IMAP) account from multiple locations/computers. Otherwise, yeah, the “Rules” thing is pretty nice, although not perfect.