Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the '10.6: Move messages to a target folder via keyboard shortcut' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Move messages to a target folder via keyboard shortcut
Authored by: HitsvilleUSA on Dec 20, '09 09:52:20PM

This tip is great. I only wish that there was a way to make it run a little faster...I find myself already moving on to the next message before the script completes, causing the wrong message to get "filtered".

Anyhow, I made some changes to the script because I have 3 different Gmail accounts all under "Inbox" and I want the emails to be filed into their respective "archive" folders. This is what I did:

on run {input, parameters}
	set target_mailbox to "[Gmail]/All Mail"
	tell application "Mail"
		set theSelectedMessages to selection
		repeat with theMessage in theSelectedMessages
			set target_account to name of account of mailbox of theMessage
			tell application "Mail"
				move the theMessage to mailbox target_mailbox of account target_account
			end tell
		end repeat
	end tell
	return input
end run

[ Reply to This | # ]
10.6: Move messages to a target folder via keyboard shortcut
Authored by: estnyc on Dec 21, '09 05:23:15PM

Hitsville, when working with Gmail accounts in, as you're doing, there's a much easier way to archive messages. When you define your Gmail account in, make sure you do the following:

1. Under "Mailbox Behaviors," for Trash, make sure both options are unchecked. You want mail not to move deleted messages to the trash, and not to store them on the server.

2. For Junk, check "Store junk messages on the server." In the listing of GMail's folders within your sidebar, select the "Spam" folder and choose it as's Junk folder by selecting "Use this Mailbox for.." under the Mailbox menu, and selecting "Junk." So you want and Gmail to be using the SAME folder for Junk and/or Spam.

Once you've done this, you can easily archive messages without any custom scripts or plugins. When you're going through your inbox, to archive a message, simply delete it. As Gmail uses tags, not folders, you're not actually telling Gmail to delete the message, but rather remove the "Inbox" tag from the message. Without the "Inbox" tag, the message will no longer show up in your Inbox, but it won't be deleted from your account; it's still accessible under "All Mail."

This is exactly the same as clicking on the Archive button for messages when you're using gMail's web interface.

OK, so deleting == archiving. It's not intuitive at first, but it's sure easy to remember and quick to perform.

If deleting is archiving, you may be wondering, what should you do if you really want to delete a message? This is also simple, but not initially obvious.

Flag the message as junk mail. will move the message out of your Inbox and into your Junk folder, which also happens to be Gmail's Spam folder. In other words, when you click on a messages's Junk button, you're telling gMail to remove the "Inbox" tag from the message, and apply the "Spam" tag. So the message will show up in your Gmail account's "Spam" folder, and it will be automatically deleted when it gets to be thirty days old (the age at which Gmail automatically deletes Spam messages).

So, to archive, delete. To delete, junk.

It really will make sense, I promise.

The problem is if you have any accounts in that aren't Gmail account. If you try to archive mail from one of those accounts' inboxes by deleting it, you'll be in for an unpleasant surprise.

[ Reply to This | # ]
10.6: Move messages to a target folder via keyboard shortcut
Authored by: Toiddles on Jul 25, '10 11:19:46PM

Makes sense except flagging a message as junk hurts the sender.

[ Reply to This | # ]
10.6: Move messages to a target folder via keyboard shortcut
Authored by: gugavieira on Feb 07, '11 02:23:28AM

Actually I was looking for a way to keep the default gmail behaviour of archiving messages (since I archive much more than I delete) and add an method to delete them (or just automate the "move to gmail/trash folder").

I could use the beginning of your tip to keep the behavior and was thinking about something like MailAct-on with a shortcut like "Cmd+Delete" for when I want to get rid of the message. So it would work like Delete key = archive and Cmd+Delete = delete.

Any tips on a way to automate my "move to gmai/trash folder"?

Does it make sense?

[ Reply to This | # ]