Vero Posted March 15, 2013 Share Posted March 15, 2013 Thought I should share this workflow to search Mail.app Use the following keywords to search: emfrom to search the sender's name and email address em for a general subject + content search emsubj to search specifically for a subject line You can download it here. Enjoy! This version is suitable for both Alfred 3 and Alfred 4. Compatible with macOS versions up to Mojave. Unfortunately, due to some changes made by Apple in macOS Catalina, it's no longer possible for third-party apps to access your Mail data. This may change in the future, but currently, using this workflow in Catalina or Big Sur will not return any results. Alan He, paulw, phyllisstein and 6 others 9 Link to comment
nitingoyal Posted March 15, 2013 Share Posted March 15, 2013 Not working. goes to fallback search after entering any word after keyword+space/enter. Link to comment
James Posted March 15, 2013 Share Posted March 15, 2013 Thanks for this useful tweak! Works just fine for me Link to comment
Vero Posted March 15, 2013 Author Share Posted March 15, 2013 Not working. goes to fallback search after entering any word after keyword+space/enter. Before you add a space, do you see "emsubj" show the "Search Mail.app by subject line" text with the Mail icon next to it? Link to comment
sr_navarre Posted March 16, 2013 Share Posted March 16, 2013 How would one make this ignore deleted messages? Link to comment
marse Posted March 17, 2013 Share Posted March 17, 2013 Thanks a lot ,it works fine for me Link to comment
leonnea Posted March 28, 2013 Share Posted March 28, 2013 Before you add a space, do you see "emsubj" show the "Search Mail.app by subject line" text with the Mail icon next to it? Thanks for creating this workflow. It seems to be half working for me. When I type emsubj, em, or, emfrom I see the text with the Mail icon next to it, but then as soon as I hit space, it defaults to the fallback searches. Just to make sure I have my other settings correct, what should be checked under Default Results and the user defined file types under Advanced? Thanks in advance. ~Linnea Link to comment
Guest Posted March 28, 2013 Share Posted March 28, 2013 Thank you. Works like a charm. Link to comment
Vero Posted March 29, 2013 Author Share Posted March 29, 2013 Thanks for creating this workflow. It seems to be half working for me. When I type emsubj, em, or, emfrom I see the text with the Mail icon next to it, but then as soon as I hit space, it defaults to the fallback searches. Just to make sure I have my other settings correct, what should be checked under Default Results and the user defined file types under Advanced? Thanks in advance. ~Linnea This is likely to be because no relevant items are returned; if there are no results at all, it'll switch to fallback searches. Basic question but do you use Mail.app for your email? If you navigate to ~/Library/Mail/, what does it contain? The file filters need to be pointing to the right place, so if you have no emails stored there, you'll get the behaviour you're seeing. Link to comment
Domenic Posted April 1, 2013 Share Posted April 1, 2013 Very nice, thank you. Best Mail.app workflow I´ve seen. But it doesn´t seem to show the results correctly sorted, based on the date it was received? That would be absolutely awesome! But nevertheless I will use this workflow very often! Link to comment
dcwalker Posted April 3, 2013 Share Posted April 3, 2013 Very helpful workflow, is there a way to make it a fallback search? Link to comment
kw1 Posted April 8, 2013 Share Posted April 8, 2013 (edited) how can i add a search for recipient ie the the messages I send to SOMEONE? tried to add a filter and added "kMDItemRecipient" but does not work, whats the right syntax? otherwise it works just fine just found it: it is kMDItemRecipients and kMDRecipientsEmailAddresses with an "s" Edited April 8, 2013 by kw1 Link to comment
stevenrt Posted April 9, 2013 Share Posted April 9, 2013 Very nice, thank you. Best Mail.app workflow I´ve seen. But it doesn´t seem to show the results correctly sorted, based on the date it was received? That would be absolutely awesome! But nevertheless I will use this workflow very often! Any update on the sorting issue? This is a great workflow, but not having the emails sorted by date does make this workflow less valuable. For instance, I search for a subject, and the list returns a list of emails with the same or similar subject line (e.g., an email chain). I know I want the latest email in the chain, but since the results are not in chronological order, things get messy. mklement0 and vonagio 2 Link to comment
riaamp Posted April 18, 2013 Share Posted April 18, 2013 Yeah! Just what I was looking for! Thanks. Link to comment
Vero Posted April 19, 2013 Author Share Posted April 19, 2013 Any update on the sorting issue? This is a great workflow, but not having the emails sorted by date does make this workflow less valuable. For instance, I search for a subject, and the list returns a list of emails with the same or similar subject line (e.g., an email chain). I know I want the latest email in the chain, but since the results are not in chronological order, things get messy. There is no sorting as such as the workflow returns them in the order OS X feeds them back, but you can have a play with date ranges You can create additional keywords and go to the file filter's advanced tab, where you can add a date range, e.g. one for today's mail, one for mail within the past 30 days. vonagio and drking 2 Link to comment
Davide Posted May 8, 2013 Share Posted May 8, 2013 Would it be possible to list all unanswered Emails from one recipient or contact with this or another workflow? Link to comment
Vero Posted May 31, 2014 Author Share Posted May 31, 2014 Would it be possible to list all unanswered Emails from one recipient or contact with this or another workflow? I highly doubt that information is available as part of the metadata relating to an email; The metadata contains information about that particular message, not about its relationship to other messages, so it wouldn't be possible (as far as I know) to find out whether an email has been answered or not. Link to comment
deanishe Posted June 5, 2014 Share Posted June 5, 2014 (edited) The workflow's no help to me, as I use MailMate, but I can't express how happy I am to see a workflow by you. "Dogfooding" is by far the best way to create great products. I'd love to see lots more workflows from you and Andrew, and if I could only have one "feature request" ever, it would be to have some workflows written by you guys. Edited June 5, 2014 by deanishe Link to comment
Vero Posted June 5, 2014 Author Share Posted June 5, 2014 The workflow's no help to me, as I use MailMate, but I can't express how happy I am to see a workflow by you. "Dogfooding" is by far the best way to create great products. I'd love to see lots more workflows from you and Andrew, and if I could only have one "feature request" ever, it would be to have some workflows written by you guys. Glad to see you're enjoying this one I've created a bunch for internal use, and frequently create various hotkey and file filter-based workflows for users that are certainly nowhere near as exciting as the fantastic ones you've all been creating! Please do keep bringing the best ones to my attention as I also love sharing them with users who are just beginning to discover how powerful workflows can be. In fact, my intention is to feature them more regularly on the Alfred blog, so expect to see more in the coming weeks! Cheers, Vero Link to comment
reesespieces Posted January 15, 2015 Share Posted January 15, 2015 Love this workflow. One suggestion, would be be possible to make the message path more readable by parsing out the email account name and folder name and just displaying those under the message result subject? Link to comment
paulminors Posted April 4, 2018 Share Posted April 4, 2018 Hi, I tried to download this workflow, but the link doesn't work. Are you still able to share it? Thanks in advance! Link to comment
Vero Posted April 4, 2018 Author Share Posted April 4, 2018 9 hours ago, paulminors said: Hi, I tried to download this workflow, but the link doesn't work. Are you still able to share it? Thanks in advance! @paulminors No problem, I've updated the link in the first post You can also grab it here: https://www.dropbox.com/s/5h3djhw2thf8xjp/Mail.app Search 3.0.alfredworkflow?dl=0 Cheers, Vero Link to comment
paulminors Posted April 4, 2018 Share Posted April 4, 2018 10 hours ago, Vero said: @paulminors No problem, I've updated the link in the first post You can also grab it here: https://www.dropbox.com/s/5h3djhw2thf8xjp/Mail.app Search 3.0.alfredworkflow?dl=0 Cheers, Vero Thanks Vero, that's great! Is there a way to customise this so I could type my search e.g. "emfrom paul" and then hit enter to open Mail.app and go to the search results i.e. search bar is pre-filled with the query? Link to comment
Vero Posted April 6, 2018 Author Share Posted April 6, 2018 @paulminors This depends on whether Mail supports AppleScript for this, but this part is down to Mail's own functionality. Alternatively, you could probably use a Dispatch Key Combo object, but this can be less reliable. It's likely that another fellow forum member can help you with the AppleScript. Cheers, Vero Link to comment
sumin Posted January 26, 2019 Share Posted January 26, 2019 (edited) On 3/29/2013 at 7:08 PM, Vero said: This is likely to be because no relevant items are returned; if there are no results at all, it'll switch to fallback searches. Basic question but do you use Mail.app for your email? If you navigate to ~/Library/Mail/, what does it contain? The file filters need to be pointing to the right place, so if you have no emails stored there, you'll get the behaviour you're seeing. Thank you for the guide. I am also having a same issue. I found my ~/Library/Mail/ doesn't contain any files in it, however if I am using Mail.app, how can I move the actual email files to this library/mail/ folder? BR, Sumin Edited January 26, 2019 by sumin Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now