Move mails to local mailbox

I recently found this here – a great script – but I would like to move mails to the local mailbox to have them off the server.

How do I address this? With the script above I can only choose an account (move msg to mailbox "App Testing" of account "iCloud"), but not the local folders.

As I do export them then to MailSteward and I always do this regularly (all x weeks or one day of the week all mails that are elder than x weeks) there is even more room for improvement.

But a hint for the first problem would already be really welcome.

Hey @Torsten,

Try using Mail_Menu_Bar > Message > Move.

See if you can get that to work for you before trying to script anything.

-Chris

Not sure if this addresses your question as I'm not sure what you mean by "local mailbox". If local mailbox is a folder made within Finder and you have your desktop and documents in iCloud, then you can simply setup Keyboard Maestro to drag and drop your mail to the desktop AND you can have Hazel file some for you.

Here's what that looks like with my setup. It's just using the UI without scripting:

https://www.icloud.com/iclouddrive/0QgLjjzNt2bRDCgZP_GSpBlWw#Mail_Drag

I suspect @Torsten means this:

image

Once the local "On My Mac" Mailbox is created, you should be able to use Chis @ccstone's method:

Hey Bern,

JM has answered the primary question correctly (IMO) – although we'll see what @Torsten has to say when he comes back.

Your drag and drop method fails almost completely on macOS 10.12.6 Sierra – only 1 out of however many emails were selected in Mail get copied to the Finder.

I think you're using Mojave – yes?

How long has this method been working for you?

-Chris

Thanks for your answers

I see. Am I assuming right that this means to trigger the menu and to go along there with KM?

This sound pretty feasible to me, although I am still hesitating if I shouldn't create a new mailbox in one of the accounts where to collect old mails and then to put it offline. The drag solution does not work properly here (I am on Mojave, but experienced similar problems as stated above on MacOS versions before). It is pretty strange that you cannot address these local mailboxes on your Mac.

Hey @Torsten,

Use a Select or Show a Menu Item action to select:

Mail_Menu_Bar > Message > Move > Your_MailBoxName

You can also drag mailboxes into the mailbox-bar, and these become available via keyboard shortcuts. (Available in the Mailbox menu ⇢ “Go to Favorite Mailbox” and “Move to Favorite Maibox”.)

I would create a mailbox in the On-My-Mac area and test it.

-Chris

In what context do you mean?

-Chris

In the script mentioned above I can move whatever mails I want to any other mailbox (or mailbox folder). I would have expected that I only need to change or modify the target address to send them to a local folder (in "On My Mac"). I also tested this hint here at the bottom to find out this "address", but I still did not work it out.

You can.

You're just better off using Mail's built-in functions than scripting in this instance.

If you really want to script it then create your mailbox, show me where it is, and I'll show you how to access it.

-Chris

Agreed, JM answered it and my workflow/thinking lead me to an incorrect interpretation.

Yes Mojave.

As far back as I can remember it was dragging one by one tho I enviously heard from others that they could move a group to the Finder. I figured it was probably my doing with all the apps, extensions, and contortions I put my system through that it never worked for me. I'm a questioner by nature and am always pushing what I have to see what it will do usually at the cost of stability. It's my preferred learning pathway. I learn a lot by breaking and cleaning up the mess over and over.

I hate to lack the specificity to able to say otherwise but "One day" maybe it was after an annual system update or maybe a clean reinstall, wish I knew, it started working, and has been for around the last two years.

Once that became available, I gleefully and speedily ditched Mail's folder system, demoted Mail to utility status (Now Mail is JUST for receiving, composing, and sending mail) and drag everything sent or received to the desktop to work on and file from.

Interesting to hear that others have this issue. Years ago I gave a good look around but never found a solution. Just lightly poked around and still nothing surfaces.