Adding a Gmail-like ‘archive’ action to OS X’s

Edit 22/09/2009: Of course Google has to go and change things around two days after I post this script. Now, for Gmail accounts if the script doesn’t work with “[Gmail]/All Mail” being the account name, you’ll want to try “[Google Mail]/All Mail”.

I used to just leave mail in my inbox and let it pile up until the counter read “thousands.” I would occasionally tag messages that were very specific to a project I was actively working on, but that was about it. But with Gmail’s highly accessible Archive button and awesome and, at the time, revolutionary and unheard of search capabilities, hitting that Archive button didn’t seem like such a bad idea.

Now, things in my inbox are purely things that need my attention, either now or months from now, and the count hovers around 15-30.

However, I recently switched to on OS X, and while it’s a simple enough task to create an ‘archive’ mailbox to put mail messages in, to do so requires a time-consuming drag operation, since there’s no button that can do this for you. When you add enough mail accounts (I for one actively monitor 6 accounts), the list of mailboxes become long enough that the drag operation is compounded by a scroll operation.

To this end, I’ve written a quick Applescript (adapted from the one John Gruber wrote over on Daring Fireball which works a bit differently) that will take selected items and shove them in a mailbox entitled ‘archive’, exactly as Gmail does. You’ll have to hack it up a bit in an intelligent way, since there’s some code in there that is specific to my mailboxes. If you monitor any Gmail accounts within, you’ll want to copy the special-casing I did for the fictional Gmail account below.

set _description to "Move selected item into the archive mailbox for the current account. This action is not undoable."

tell application "Mail"
set s to the selection
if the length of s is greater than 0 then
set m to item 1 of s
if the name of the mailbox of m is "INBOX" then
set a to the account of the mailbox of m
if a is account "" then
move s to mailbox "[Gmail]/All Mail" in a
move s to mailbox "archive" in a
end if
end if
end if
end tell

The only major limitation of the code is that it assumes you select mail only from a single account at a time. If you view inboxes from multiple accounts at a time, then leave a note in the comments below and I’ll be more motivated to fix it.

Unfortunately, won’t let you add Applescripts to the toolbar as buttons, so the only way you’ll be able to activate this handily is by enabling the scripts menu at all times (you’ll find the option in the Preferences dialog of Applescript Editor), and assigning a shortcut to it via the Keyboard System Preferences pane. This is a bit less than ideal since the script takes a second to kick in with this method, but it’s what we’ve got.

Maybe someday I’ll turn this into a proper plugin.

In closing, I’d like to simply sum up my thoughts about AppleScript with a short quote from Chris Metcalf:

I don’t want to “say” shit to you applescript, I just want you to do what I want!

34 Responses to “Adding a Gmail-like ‘archive’ action to OS X’s”

  1. 1 Josh A.

    Thanks for this! It’s easy enough to handle multiple inboxes:

    tell application “Mail”
    set s to the selection
    if the length of s is greater than 0 then
    repeat with m in s
    if the name of the mailbox of m is “INBOX” then
    set a to the account of the mailbox of m
    move m to mailbox “Archive” in a
    end if
    end repeat
    end if
    end tell

  2. 2

    Amazing whip! I would like to apprentice even as anyone change your web site, how will i sign up to for the weblog website? This accounts helped me the appropriate cope. For a nice and a bit common of the a person’s transmitted provided energetic obvious idea

  3. 3 Rosemarie

    Water slowly seeps through any available crack, use and the actual remodel.
    After the meeting and get contractor the interior walls.

    If so, it will depend upon your location on the first person asking for
    a while for the project to you remodeling bill. He said: ‘I’m willing to learn how to successfully implement and maintain electrical systems.
    It is very important for individuals looking to hire has
    a good referral of multiple friends and colleagues or reposting only the
    code but your heating, air conditioners that remain of an organization.

    Feel free to visit my webpage; site (Rosemarie)

  4. 4 Alison

    Second, the dated aluminum windows which have
    been licensed and insured and licensed by the contractor as
    it is bearable not to contact and have a clue about.

    S Intelligence, between the tragedy and the cost of major parts
    or fixtures. We know that they were providing him? It can be helpful to both
    first-rate service and hassufficient demand to contractor be successful in steering
    billions of dollars.

    Here is my web site homepage (Alison)

  5. 5 Casimira

    My webpage :: web site [Casimira]

  6. 6 Bernadine

    My webpage: webpage – Bernadine,

  7. 7 online video marketing

    There may be errors that could distract users. The web design templates
    that suit the needs of customers that they need about
    products or services the company is good to you about what you had at
    least one is greater. Jonathan: Are you a search engine optimization cheaper price for creating simple yet elegant and professional design. Our persuasive policies
    ascertain that our hands are tied to how it looks bad, but thousands of other
    venues where the information they seek. Practice whenever you want your web

    my website :: online video marketing

  8. 8 executive protection international

    Magnificent beat ! I would like to apprentice at the
    same time as you amend your website, how could i subscribe for a blog site?
    The account aided me a applicable deal. I have been a
    little bit acquainted of this your broadcast offered brilliant transparent idea

  9. 9 meeting Minutes app

    This is worth the price of a suite, yet even the regular rooms
    (if you want to call them that) have these boxes of pure sleeping heaven).
    Stay organized and the pain will subside, for all involved, via Vo
    - IP or otherwise. To ensure you gather together all
    the necessary promotional gifts for your conference, a little forward planning goes a long way to avoid that last minute crisis.

  10. 10 Christine

    Another method is the traction massage, where the patient lies face up on a table with
    a pillow under their legs. You know, the type who has
    very little physical activity during the week, but once the weekend arrives, they push
    themselves way too much. Using this back exercise technique, the first thing that a physical therapist does is to look for the patient.

  11. 11 Lillie

    A good incentive for a finance web site is a free calculator for tax
    returns. Internet Marketing Advice For Beginners And Newbies.

    Whatever the challenge, there is always a way to achieve the goal.

  12. 12 access card system installation Dallas

    You undoubtedly ensure it is seem easy using your business presentation on the other hand to uncover this kind of matter to be definitely some thing which I think I would personally in no way comprehend. It kind of feels very complex and very substantial for me. I will be excited in your next article, I’ll attempt to get the hang on of it!

  13. 13 affiliate marketing

    Unquestionably imagine that that you said. Your favourite reason seemed to
    be at the net the simplest thing to keep in mind of. I say to you, I definitely get annoyed while folks consider worries that they
    plainly do not understand about. You controlled to hit the
    nail upon the top and outlined out the entire thing with no need side effect
    , people can take a signal. Will probably be back to get more.

  14. 14 go to website

    I feel that’s being among the most information and facts for me go to website. Exactly what pleased understanding ones report. Although should remark for some rudimentary items, It preference is best, your content articles is in certainty wonderful : Deb. Good pastime, kind regards

  15. 15 xxx

    Appreciation to mү father who told me օn the topic of
    thiѕ blog, thiѕ website іs actually awesome.

    Stop Ьy mу webpage; xxx

  16. 16 andis master faceplate

    Hiya very nice blog!! Man .. Excellent .. Superb ..
    I’ll bookmark your site and take the feeds also? I’m satisfied to search out numerous
    helpful information here in the put up, we want work out more techniques on this regard,
    thank you for sharing. . . . . .

  17. 17 Justinpl

    Read more upon order baclofen discount cheap

  18. 18

    I’d be 100% inclined to trust you, nonetheless my dilemmas were PROMPTLY repaired by this change.
    Additionally, it appears the “majority” of the 80/443 hehe traffic reaches the onset of the sport, therefore it might be for game diagnostics for Riot,
    for zero-cheating measures, for loading in information/assets…
    frankly the only person who can touch upon this would be a
    riot worker.

  19. 19 Thomas Pennington Pessimism is only the name that men of weak nerve give to wisdom.

  20. 20 reliability

    Undeniably believe that which you stated. Your favourite reason appeared to be on the net the simplest thing to consider of.
    I say to you, I definitely get irked even as people think about issues
    that they just do not recognise about. You controlled to hit the
    nail upon the top as well as outlined out the entire thing with no need side
    effect , people can take a signal. Will likely be again to get more.

    Thank you

  21. 21 soloff and zervanos

    Very great post. I simply stumbled upon your weblog and wanted
    to say that I have really loved surfing around your weblog posts.
    After all I will be subscribing in your feed and I’m hoping you write again soon!

  22. 22 personal protection

    Have you ever thought about creating an e-book or guest authoring on other websites?
    I have a blog based on the same ideas you discuss and would love to have you share some
    stories/information. I know my subscribers would
    enjoy your work. If you are even remotely interested,
    feel free to send me an email.

  23. 23 بوستات حب

    Good process, cheers

  24. 24 make money online

    Good post. I learn something new and challenging
    on sites I stumbleupon everyday. It’s always
    interesting to read articles from other authors and use a little something from
    their web sites.

  25. 25 rbx multiple games

    In terms of speed in multitasking and running heavy applications, the 2Ghz HP desktop just doesn’t stand a chance.
    Not only using a used i – Mac on the market, however with
    all Internet products in general. i – Phone 4 – Changing the way
    you take a look at smart phonesi – Phone 4 was obviously a
    massive success for Apple.

  26. 26 Shadow Defender w_ Working Serial

    It is discovered that false alarms often are derived
    from commercial buildings during its opening and closing.
    Finally, you will find there’s background audio mode that I have mentioned above.

    The danger of maintaining guns and pistols in drawers to make sure that it can be
    effortlessly accessed following your require arises is the fact that your youngsters inside could accidentally use it and bring
    about an accident.

  27. 27 agisoft photoscan 1.3.4 serial

    However, exactly like with any other machine, it will really help in case
    you first made an endeavor to asses whether it ought to be or not.

    Over the very last thirty years consumer electronics have cultivated
    in leap & bounds. Non-Mac – Book converts hate the belief that extra electric batteries
    costs a great deal as well as the integrated battery cannot easily be swapped for any fresh one.

  28. 28 Amtemu Mac

    Who needs intense planning and surgical precision anyway, when it’s possible to unleash flaming flying mammals in great swathes
    your foolish opponents. Whatever the occasion, many times yourself needing to get a gift for a
    person you know. This will not be what you expected
    me to say, but this can be truly instrumental (no pun intended) for a success.

  29. 29 waves complete 2018.04.16 macos

    Software applications can’t be copied completely from Mac Operating System X but
    have to be written and compiled particularly for
    i-Phone Operating System. The brackets have carefully drilled
    holes for accommodating the VESA interfaces.

    It is usually even much hard for those whom want to buy a
    desktop that belongs to Apple.

  30. 30 chiropractic

    Remarkable things here. I am very glad to look your post.
    Thanks so much and I’m having a look forward
    to touch you. Will you kindly drop me a mail?

  31. 31 pinnacle studio 22 ultimate serial

    For example, perform a Yahoo hunt for “security alert newsletter” (utilize the quotation marks to have the most suitable serp’s).
    At the time of need, it often became nearly impossible
    to find a certain file on time. even though we employ it for personal thing, still
    it is extremely maddening to see your machine is ill.

  32. 32 ro-ghoul script

    When a washer lands inside the box, it is similar to 1 point and when it
    lands inside cup, it will likely be 3 points. Children when they are bored with playing a similar games invent their very own new games and are
    able to keep themselves occupied for a long time on end.
    When the boys of summer are nevertheless in Fort Lauderdale, he is
    able to be pitching in the bottom with the ninth inside World Series.

  33. 33 rosehub roblox

    All you need is the overall game console, remote, a controller, sensor bar and also
    other accessories that can come as being a set and
    also the latest games. You only want to bet a small
    percentage of your total online bankroll on a game. This is due to the
    belief that they’re supposed to stick to the road since
    any deviation using this could cause a collision thanks to the corners and bends incorporated within the play.

  34. 34 imessage on pc

    Pretty! This was a really wonderful post. Thank you for providing these details.

  1. 1 Adding a Gmail-like ‘archive’ action to OS X’s Scripts Rss
  2. 2 code itunes gratuit
  3. 3 dream home
  4. 4 Learn How to Make Passive Income for Free, Learn How to Make Money Online for Free, Start Your Online Business for Free, Free Earn Money Online Tips, Free Online Business Starter Guide, Free Step-by-Step Passive Income Guide
  5. 5 virtual serial port driver 7.1 full keygen
  6. 6 Xforce keygen

Leave a Reply