Show Flagged Messages on Your Desktop

Flagging messages in Mail is an easy way to mark them for follow-up. But it's also easy to forget to check your Flagged folder in Mail. MacOSXHints.com reader dushu figured out a way to keep a list of his flagged e-mails visible on his desktop, where they're hard to miss:

To keep my flagged mails visible, I created the following AppleScript which, in conjunction with Geektool, puts a list of flagged messages--with sender and subject--visible on my desktop.

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

I saved this as an AppleScript to my /Library/Scripts folder; I named mine flagged_mail.scpt. To finish, in Geektool I created a shell geeklet with the following code:

osascript ~/Library/Scripts/flagged_mail.scpt

You can edit the "Flagged Mail:" string in the AppleScript to whatever you want to appear as the title of your list. And, if you don't already know about Geektool, you should check it out: It's a system preference pane that allows you to place images, file-contents, and the results of shell scripts on your desktop.

Subscribe to the Daily Downloads Newsletter

Comments