[Note: This hint originally ran in mid-March, but was marked "must be logged in to read." As a result, it didn't go out in the RSS feed, and not many people saw it. I'm republishing it so that everyone has a chance to see it. -craig.]
I flag mail which I need to respond to, however, many times I forget to check my Flagged Mail mailbox. To keep these flagged mails visible, I finally sat down and -- with lots of help from the internet -- created the following AppleScript. With the help of Geektool, I now have the sender and subject of flagged mails visible on my desktop.
Here's the script:
set newline to ASCII character 10 set finalText to "Flagged Mail:" & newline tell application "Mail" set theMessages to every message in inbox whose flagged status is true repeat with i from 1 to number of items in theMessages set thisMessage to item i of theMessages set fromMsg to (sender of thisMessage as string) set subjMsg to (subject of thisMessage as string) set finalText to finalText & "! " & word 1 of fromMsg & ": " & subjMsg & newline end repeat end tell finalText
osascript ~/Documents/Workflows/flagged\ mail.scptHope this helps someone in the same situation as me.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20100318135959802