Search for All Messages From Current Sender Macro (v10.2)

If anyone has any help on this macro, it would be greatly appreciated.

This doesn’t work properly if the copied address comes back as "" vs “Example Email

Search for All Messages From Current Sender Macro (v10.2)

Search for All Messages From Current Sender.kmmacros (51 KB)

You may want to tell Mail to execute the command extract address from as follows:

set theSender to extract address from (sender of item 1 of theSelection)

This way, you'll get the form This will make the second Execute AppleScript action unnecessary.

Regarding the Mail windows control, always remember to bring them to the front. For that, add relevant actions before either Select All Inboxes or Find Image. You can also prepend these actions with the Pause action set to a reasonably short span.

Just as another option, Keyboard Maestro has an inbuilt Token %MailSender% that gets the sender of the currently selected email.

I found that hitting the Tab key twice moves from the search field to the Sidebar and then to the filtered messages. And this can be automated by Keyboard Maestro. If you don't have the Sidebar showing then just one hit of the Tab key should do it.

The advantage of this over trying to go to All Inboxes is it doesn't matter what Mailbox you are in when you do the Search/Filter.

Find and Select all messages from Sender in Selected email.kmmacros (5.1 KB)

Click to Show Image of Macro

To add to both @scrutinizer's and @Zabobon's excellent suggestions -- in the search box, precede the address with from: if you're trying to limit the results to messages from that sender.

1 Like

That is great I didn't realize you could do that very handy and trims things down a bit.

I'll add that to the bag of tricks. Thank you that is useful to know.

Automating the tab is often my go to if I can but for some reason I can't ever seem to get into the messages no matter how many times I have pressed it. I might have something different installed but all good.

Yes, I am and actually had noticed that before you posted, you have a keen eye. It was pulling things to the sender and other referenced items that was not what I wanted. Thanks for the not and catching that.

I have updated what feels like the cleanest version of it thanks to your help.

Search for All Messages From Current Sender Macro (v10.2)

Search for All Messages From Current Sender.kmmacros (49 KB)

Also for what it is worth this is my quick clear filter. I don't think there is a good way to go to the next message after the one you just selected to delete all the messages from a certain sender so you will have to manually click with the mouse to the next message and just mentally keep track of the next message.

Deselect or Clear Filter Macro (v10.2)

Deselect or Clear Filter.kmmacros (30 KB)