Move Mail to Storage

Announcement and discussion of shortcuts available in the Online Gallery

Move Mail to Storage

Postby gb2 » Wed Sep 02, 2009 8:28 am

This will move selected emails to a folder. Handles 1 or loops through an entire selection.
Be sure to change the name of the your destination folder and to denote what account the destination folder belongs to (if you're using an IMAP folder)

Hint: create a bunch of these, then group them into a shortcut for 2 keystroke easy filing.

Click here to download

Scopes:  Mail
Author:  Stan Schwerin
 Added:  July 02, 2009
User avatar
gb2
Site Admin
 
Posts: 2868
Joined: Mon Feb 06, 2006 5:22 pm

Re: Move Mail to Storage

Postby mattbethe » Fri Dec 18, 2009 10:57 am

I LOVE this shortcut and script. I have been looking for something like this forever.

I don't know much about scripting, but I'm wondering if there is a way to have the script mimic mail's native behavior and go to the next message after filing (instead of going to the first unread message). The script's current behavior prevents me from being able to file a group messages that have already been read because it does not select a message to file. I have to use the mouse to select a message each time if all the remaining messages are unread.

I assume this is the part of the script that controls that:

try
tell message viewer 1 to set selected messages to {first message of beginning of (get selected mailboxes) whose read status is false}
end try

How would I edit that for the desired behavior?

Thanks for any help!
mattbethe
 
Posts: 2
Joined: Fri Dec 18, 2009 10:48 am

Re: Move Mail to Storage

Postby gb2 » Fri Dec 18, 2009 1:33 pm

looking at Mail's AppleScript Dictionary I didn't see anyway to know which messages are selected and then select the one by it after the others have been removed. To have it select the first message in the Mailbox just change it to this:

tell message viewer 1 to set selected messages to {first message of beginning of (get selected mailboxes)}

actually this AppleScript is doing the same thing that selecting the menu item "Move to" in the Message menu. The only difference is that the AppleScript is selecting the first unread message where the "Move to" menu is selecting the next message that was next to the ones moved. So if you aren't wanting to select the first unread message like this AppleScript is doing I'd just use a "Menu Selection" shortcut set to Message > Move To > whichever Mailbox you want.
User avatar
gb2
Site Admin
 
Posts: 2868
Joined: Mon Feb 06, 2006 5:22 pm

Re: Move Mail to Storage

Postby mattbethe » Sun Dec 20, 2009 12:11 pm

Hi! Thanks for the help. I did what you said, but after testing it changed "first" to "second". It takes mail a split second to actually file the mail, so when I put first in it would just quickly reselect the same message right before it was filed. Then no message would be selected (creating the same problem I had before).

Unfortunately "Menu Selection" does not work. That was the first thing I tried. QuicKeys gives you an error message if you try to use that menu. I think it is because the context of it changes based on what accounts are active, folders are present, etc.

You can't create a system shortcut in system preferences because the folder names are duplicated in the "Move To" and "Copy To" menus. :-(

I've never found a consistent way to make keyboard shortcuts for filing mail, but I think this one will actually work quite well.

Thanks again for your help!
mattbethe
 
Posts: 2
Joined: Fri Dec 18, 2009 10:48 am


Return to Shortcut Gallery Submissions

Who is online

Users browsing this forum: No registered users and 1 guest

cron