Sometimes you want to download all the attachments in a long, many-message Gmail conversation. Gmail doesn't provide any simple way to do this. But these two methods seem to work:
- Open the conversation
- Click the "More" dropdown and select "Forward all"
- Forward the full conversation to yourself
- Open the forwarded email, scroll to the bottom, and click the "Download all attachments" button
[h/t David Sottimano]
This approach worked for me, though ⚠⚠⚠ your mileage may vary ⚠⚠⚠ :
- Open the conversation (ideally in a new window, but not necessary).
- Note: Make sure that all messages in the conversation are open (i.e., not collapsed). One way to do this is to mark the conversation as unread, and then reopen it.
- Open your browser's developer console
- Paste the following JavaScript into the console:
(function () {
var interval_seconds = 1000;
var links = [].slice.apply(document.querySelectorAll("a[role='link']"));
var urls = links.map(function (x) {
return x.parentNode.getAttribute("download_url").match(/https:\/\/[^:]+$/)[0];
});
var timer = window.setInterval(function () {
if (urls.length) {
window.open(urls.pop())
} else { window.clearInterval(timer); }
}, interval_seconds);
}).call(this);
This will start the process of downloading the attachments. Every second, your browser will open a new tab, which will download a particular attachment and then close itself when the download has completed.
- Currently only tested in Chrome
- Some time interval seems to be necessary to avoid Gmail temporarily blocking your account, but the choice of one-second interval above is somewhat arbitrary