“Next Unread Message” Script for Apple Mail

One thing that’s always bugged me about Apple’s Mail.app is the lack of a quick shortcut to your next unread message, irrespective of which mailbox it is in. Luckily, it was fairly easy to whip up a quick little script which does just that. Note that the script assumes your mail is sorted with the newest messages at the bottom — otherwise, you’ll need to edit line 7, replacing “last message” with “first message”.

Add a keyboard shortcut with your favourite tool, like FastScripts or Quicksilver.