Created
March 10, 2015 07:18
-
-
Save yanyaoer/e175fbf38faa7ea288b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ref: http://daringfireball.net/2007/07/simplgge_inbox_sweeper | |
-- gist: https://gist.github.com/gruber/1063605 | |
set _desc to "archive all readed msg at inbox; then mark other msg as read" | |
tell application "Mail" | |
set _archive_box to mailbox "Archive" | |
set _msgs_to_move to (a reference to ¬ | |
(every message of inbox ¬ | |
whose flagged status is false and read status is true)) | |
set _msg_list to contents of _msgs_to_move | |
if (_msg_list's length > 0) then | |
move _msgs_to_move to _archive_box | |
end if | |
set read status of every message of inbox to true | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment