Move messages in Thunderbird with a single keystroke
(You can tell that this hasn’t been as busy a month for prayer letter printing as May…)
Somewhere, in an article I was reading over the past week or two on productivity, the suggestion was made that we could save quite a bit of time (cumulatively, at least) by binding “Move current message to folder x” to a keystroke, so that we don’t need to use the mouse, or memorize the sequence “Menu-key M Right Enter O Enter” or “Menu-key M Right Enter L L Enter”, which was what I was doing on the PC (the Mac is less keyboard-friendly, and I couldn’t find an equivalent*).
I thought: there has to be a way to do this in Thunderbird (my E-Mail client of choice — I tried Mail.app, but it’s missing some very fundamental features, like multiple identities within one mail account, which I use all the time**).
Unfortunately, this was not as simple as I would’ve expected. I was pretty sure keyconfig would be able to do it, but I needed to come up with the code to make it work, and this wasn’t straightforward.
I also looked at a few other Thunderbird extensions, namely QuickMove and Nostalgy, but neither did what I wanted — QuickMove had the single-keystroke thing, but you’re stuck with Control-0 through Control-9, and I wanted something easier to remember (e.g. “S” for “Spam); Nostalgy let you choose any folder from the keyboard, but not with a single keystroke (supposedly, at least — I didn’t actually try it, I just read about it).
Finally, on page 30 of the KeyConfig forum topic, I found what I was looking for, given by the author of the module:
MsgMoveMessage({getAttribute: function(){return 'folderURI'}});
For IMAP, folderURI is something like “imap://user@host/path/to/folder”. If in doubt, create a KeyConfig command that runs the following:
prompt("", gMsgFolderSelected.Value);
Then, run that command from the folder whose URI you want.
I now have single-key commands to move read messages to common folders. Nice!
(Note: A number of people said that filters should be used for this sort of thing. Filters are very useful for filing messages appropriately before you read them, and I make heavy use of them, but in this case I was looking for a way to archive messages to a few common folders after reading them. For example, order confirmations, which I review, and then keep in a particular folder to make quarterly taxes easier.)
* I thought the keyboard shortcuts feature was made especially for this sort of thing. But it doesn’t work. Thunderbird has a “Move” and a “Copy” menu, each with identically-named submenus (i.e. the folder names), so if you assign a keyboard shortcut, it gets assigned to both Move and Copy, with the result that neither works. :-(
** Spotlight support in Mail.app looked like it was going to be a very nice feature — I’ve been using grep when searching across several folders, and that can be pretty slow when I’m really not sure where a message is, since grep doesn’t index messages. However, Mail.app doesn’t have the ability to only look at subscribed folders on IMAP servers, or the ability to only index certain folders (as far as I can tell). That’s a critical omission when you have six years’ worth of E-Mail archived (yes, just about all of it — I have lots of disk space, and it comes in handy surprisingly often).

awesome!
Thanks very much! I hunted for hours for a way to do this. You nailed it!
In ThunderBird 2 this works
In ThunderBird 2 this works instead:
MsgMoveMessage('FolderURI');
E.g.:
MsgMoveMessage('mailbox://nobody@Local%20Folders/Spam');
Cheers,
Colin.
Thanks very much
Just what I've been wanting for the past couple of years. I use mailacton when using mail.app but I wanted something for thunderbird.
I too process my mail like you - most of it shows up in my inbox where I review it and then file it into 5 or 6 common folders for later reference. (I have about 15 years worth of saved e-mails.)
Thanks for the info.
-nik
15 years!?
That's impressive.
Nostalgy actually does what
Nostalgy actually does what you want, and it does it quite well. One single keystroke, and your message is moved or copied.
Newbie question? How do I use these commands?
Can you please point me to where I can program these scripts in TB? I am assuming we do not open up a CLI and type these commands in at runtime... (???)