Muffinresearch Labs by Stuart Colville

Mark all mail as read in mail.app | Comments (2)

Posted in Apple, Code on 25th May 2007, 7:51 am by Stuart

quicksilver prefs

Being a habitual user of NetNewsWire I find it quite annoying that mail.app doesn’t have a mark all as read button. However there is a context menu that you can use mark all mail in the selected mailbox as read. Trouble with that is that it’s too clunky. I want to be able to mark a mailbox as read super-quickly. Because of that I hacked together this little applescript.

tell application "Mail"
	activate
	get message viewer 1's selected mailboxes
	repeat with thisBox in result
		set read status of (every message of thisBox whose read status is false) to true
	end repeat
end tell

This simply loops through all message in the selected mailbox and marks them as read. Now I couldn’t find a simple way to put this as a button so instead I opted to set this script to run as an applescript via a trigger in QuickSilver.

This is really straight forward. Load the script into Script Editor and save it as a script (not an app or it will be far slower). Next open Quicksilver’s preferences and set-up a trigger pointing at the script. If Quicksilver can’t find it try updating the catalogue to look at applescripts. Next set a hotkey of your choice and set the scope to mail so that this script will only run from within mail.app (type mail and hit tab).

Possible improvements:

I’m fairly new to Applescript so you might be able to write this more efficiently, if so, share your wisdom! I’d really like to add this as a button in the toolbar of mail (If anyone knows a way to do this please drop a link in the comments).

Post Tools

Comments: Add yours

1. On August 30th, 2007 at 9:10 pm macaddict89 said:

One elegant way of running the script is mail act-on from indev software. Set a button and run the applescript

2. On August 30th, 2007 at 9:13 pm macaddict89 said:

also, if theres a way to make this script dive into sub directories of imap folders (so it would be a one click wonder), I’d really like to know. My stupid college uses exchange, and the public folders always refresh as unread. A big pain that really pisses me off







XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



Standalone mac battery charger|(0)

Got a spare mac battery? I’ve often wondered why up until now no-one’s produced a standalone charger so that you can charge batteries without having to plug them into the mac. Fortunately Fastmac.com have produced a standalone charger that allows you to do just that. and it’s compatible with iBooks, Powerbooks, macbooks and Macbook Pros. It’s also 110/200v. Exactly what I was looking for!

Django Admin Ominigraffle Stencil|(0)

Colleague Alex Lee has created a nice stencil for omingraffle with the Django Admin UI components, perfect for wireframing customised admin screens. For more details and to download the stencil see Alex’s Blog csensedesign.co.uk

Photos on Flickr

© Copyright 2004-08 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by 1&1 This page was baked in 0.704s.