Unfortunately, for as long as I can recall, this action has required two keyboard actions--Command-Option-J, the Erase Junk Mail shortcut, followed by a press of the Return key to say Yes, I really want to delete the junk mail. I believe I submitted a feature request a few years back, asking for an option to remove the second dialog, but nothing ever came of it. When I tell Mail to delete my junk mail, I'm already sure I want it gone, and I find the confirmation dialog quite annoying.
Today it finally annoyed me to the breaking point, so I created a solution using Butler. I wrote a very simple keyboard macro to handle the emptying of my Junk folder. (I would assume something quite similar is possible in both Quicksilver and LaunchBar, but I don't have much experience with either of those tools.) Now, with the press of one keyboard combo, my Junk mail folder is emptied without any further interaction on my part.
To create a new keyboard macro in Butler, click the Plus sign at the lower left corner of Butler's configuration window, then select Smart Item -> Keystrokes from the pop-up menu. While you could create this command in any of Butler's item types, it probably makes the most sense to store it in Hidden, since you'll only be accessing it via a keyboard shortcut. Give it a useful name (so you recognize it in Butler's configuration list), and then enter the following values on each tab:
- Keys: Press Command-Option-J, delay 0.1 seconds (accessed via the Plus sign pop-up below the input area), then press Return. This macro will activate the Delete Junk Mail dialog, wait a little bit for it to appear onscreen, and then select the Yes option (since it's the default).
- Triggers: Assign whatever Hot Key you like; I used Shift-Command-Option-J, since that was similar to the existing shortcut. When you assign the hot key, the Exceptions area will appear. Set the pop-up to "Only" valid in, then type Mail. This tells Butler to only make the shortcut work inside of Mail.
- Looks: You don't need to edit this at all. However, I have a lot of Butler-created keystroke actions, though, so I tend to set the icon to the associated application (Mail). This makes it easier to find things on the configuration screen.
And that's it -- you're done. Switch back to Mail, hit Shift-Command-Option-J (or whatever you assigned) and revel in the now-automated junk mail deletion.
You could use a minor variant of this to make erasing all deleted messages a one-step affair--just use Command-K as the first step of the script, as that's the relevent shortcut. I haven't done this myself, though, as I'm not so confident about erasing my deleted messages.


