giovanni Posted June 3, 2023 Share Posted June 3, 2023 Download Motivation ✅ - Quickly list, search, and filter your Microsoft Outlook emails - Perform basic tasks like: email snoozing, quick email drafting, email saving. Note: Many of the functions of this package will not work with the new, electron-based, New Outlook interface, as AppleScript is not supported. Uncheck New Outlook in the File menu in Outlook to switch to the previous version. Basic Usage 📖 Search your email 🔍 - standard search: one or more search strings will search both the subject of an email, and its preview (first 250 characters). - gmail-like search strings, listed below, supported (remember to set the MYSELF variable in the Workflow Configuration). - from: (including from:me). Replace space with underscore if you want to specify the whole name (e.g. from:john_appleseed) - to: (including to:me) - cc: (including cc:me) - subject:, has:attach, is:unread, is:read, is:important, is:unimportant - folder: (note: replace spaces with underscores if the folder name contains spaces, e.g. folder:sent_items) - -text to exclude text - --a to sort by increasing date (oldest first) - since:n will return email received in the last n days. w and m are supported for months and weeks, respectively (e.g. since:2w). - Once an email of interest has been identified, the following actions are possible: - ↩️Enter will open the email in Outlook - ^-↩️ (control-enter) will show all the messages in the thread - ⇧-↩️ (shift-enter) will show in large font (and copy to clipboard) the following fields from the message: From, To, Subject, and Preview from the selected email. Draft a new email ⭐ - use a keyword (default: em) or a hotkey to launch, followed by text. Alfred will create a draft email with subject = entered text, and save it in the Drafts folder. Email Saving 💾 - use a keyword (default: ols) or a hotkey to launch, while Outlook is the frontmost application and an email is selected. - Choose the destination folder using Alfred's file filter - Save your email there. File will be renamed to include date and exclude special characters. A Markdown link to that email is copied to the clipboard. Email Snoozing 💤 - Make sure you have, or create, a Snoozed folder in your main Outlook account. - use a keyword (default: olz) or a hotkey to launch, while Outloook is the frontmost application and an email is selected. - enter the number of days you want to snooze your email. Alfred will show the corresponding date, and the number of emails already snoozed for that date. - Selecting the result will 1) Snooze the email until the desired date and 2) move that email to the Snoozed folder. - the checkSnoozed keyword will show in large font (and copy to clipboard) an overview of all the snoozed email (one line per day) - Unsnoozing will happen once a day, as soon as alfred-outlookSuite is launched. You can force the unsnooze script using a keyword (default: olu) or a hotkey). Feedback welcome! neius_ and TomBenz 2 Link to comment
TomBenz Posted June 7, 2023 Share Posted June 7, 2023 Love this new workflow. I have tried most of settings and options and it works good. It will be great if we can specify email account to search in some config settings. Also I hope folder search inside its sub-folder. I will be testing more. many many thanks @giovanni Link to comment
giovanni Posted June 7, 2023 Author Share Posted June 7, 2023 thanks for the feedback @TomBenz. Ideas for improvement always welcome. Re multiple accounts, I can't test this because I only have one... Would they show as separate folders in ~/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/, in addition to Main Profile? If so, I can easily add the option of specifying which profile to use. Re nested folders, have you tried to search in the nested one (e.g. if the mail is in Folder/NestedFolder, search with folder:NestedFolder)? It should work. Link to comment
TomBenz Posted June 7, 2023 Share Posted June 7, 2023 3 minutes ago, giovanni said: thanks for the feedback @TomBenz. Ideas for improvement always welcome. Re multiple accounts, I can't test this because I only have one... Would they show as separate folders in ~/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/, in addition to Main Profile? If so, I can easily add the option of specifying which profile to use. Re nested folders, have you tried to search in the nested one (e.g. if the mail is in Folder/NestedFolder, search with folder:NestedFolder)? It should work. 1. Account Profile is same and under main profile. the folder structure at ~/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/ seems complex. There are main folder caches, local files etc. See you are searching main profile, all accounts are getting searched which is good and desirable. I have common folder name in different accounts and want to see if I can check specific account. Pls see if you can add a dummy account such as Gmail to review this further. I can use this AppleScript code to get account list: tell application id "com.microsoft.Outlook" set theAccounts to get imap accounts set ExchangeAccounts to get exchange accounts set theAccounts to theAccounts & ExchangeAccounts set accountInfo to {} repeat with theAccount in theAccounts set end of accountInfo to "New account" set end of accountInfo to "Name: " & name of theAccount set end of accountInfo to "Username: " & user name of theAccount end repeat return accountInfo end tell 2. Nestedfolder: Yes, NestFolder works as well as Folder. I have some common folder name in different account. I will test if it searches both. 3. SmartFolders -- is there a way to go to this and search further with additional criteria. for example, SF:largemails and then from: etc. 4. For exact search such as name, should it be set to FirstName_LastName or is it possible to use "FirstName LastName" which is more natural and regular way to do exact search? Overall this is a great workflow. Link to comment
giovanni Posted June 7, 2023 Author Share Posted June 7, 2023 1 hour ago, TomBenz said: want to see if I can check specific account. try this version (you will need to refresh the database with outlook::refresh or your custom keyword. Use the account:xxx syntax, where xxx are the first letters of the account. 1 hour ago, TomBenz said: SmartFolders As far as I can tell, those are just saved queries. One could set saved queries in Workflow Configuration, like: sf1 = from:me has:attachment, and then use them in search with sf:sf1? 1 hour ago, TomBenz said: is it possible to use "FirstName LastName" I need the underscore (or any other character) to keep the element together, otherwise it will search for LastName as a separate string. One possibility is to have an autocomplete-like feature, which will let you select the contact name as you type, but that would only work with saved contacts. Or, I could take all the names from the email database and generate an empirical list of contacts from which the user can choose... Link to comment
TomBenz Posted June 7, 2023 Share Posted June 7, 2023 2 hours ago, giovanni said: try this version (you will need to refresh the database with outlook::refresh or your custom keyword. Use the account:xxx syntax, where xxx are the first letters of the account. Tested. Many thanks for the update. it works great. 2 hours ago, giovanni said: As far as I can tell, those are just saved queries. One could set saved queries in Workflow Configuration, like: sf1 = from:me has:attachment, and then use them in search with sf:sf1? How to save these queries? Should I use snippets otherwise? 2 hours ago, giovanni said: I need the underscore (or any other character) to keep the element together, otherwise it will search for LastName as a separate string. One possibility is to have an autocomplete-like feature, which will let you select the contact name as you type, but that would only work with saved contacts. Or, I could take all the names from the email database and generate an empirical list of contacts from which the user can choose... Search by keyword or subject will serve most of search requirements. can manage with contact name as it is. Link to comment
giovanni Posted June 8, 2023 Author Share Posted June 8, 2023 @TomBenz I have tried in this new beta version to implement contact autocomplete and saved queries. Contact autocomplete: in Workflow Configuration, you can choose between None (no autocomplete), AddressBook (autocomplete list based on the contacts in your address book), and 3) Database (autocomplete list generated based on the senders in the database, which is more complete, but can get messy). If not None, autocomplete is triggered by from: and to:. Saved queries: they can be entered in Workflow configuration, with this format: RecentUnread = to:me is:unread since:20. Multiple saved queries can be ; separated. Triggered by sq:. Let me know what you think! Link to comment
TomBenz Posted June 9, 2023 Share Posted June 9, 2023 2 hours ago, giovanni said: @TomBenz I have tried in this new beta version to implement contact autocomplete and saved queries. Contact autocomplete: in Workflow Configuration, you can choose between None (no autocomplete), AddressBook (autocomplete list based on the contacts in your address book), and 3) Database (autocomplete list generated based on the senders in the database, which is more complete, but can get messy). If not None, autocomplete is triggered by from: and to:. Saved queries: they can be entered in Workflow configuration, with this format: RecentUnread = to:me is:unread since:20. Multiple saved queries can be ; separated. Triggered by sq:. Let me know what you think! 1. This is interesting. I am getting this error for simple search. [05:38:38.052] ERROR: Outlook Suite[Script Filter] Code 1: [{'Name': 'RecentUnread', 'Query': 'to:me is:unread since:20'}] 1 days from last update. 2. Update of workflow is not saving keywords or addition done for variable MYSELF etc. Pls look into it. Link to comment
giovanni Posted June 9, 2023 Author Share Posted June 9, 2023 56 minutes ago, TomBenz said: 1 days from last update. have you run outlook::refresh? TomBenz 1 Link to comment
TomBenz Posted June 9, 2023 Share Posted June 9, 2023 20 minutes ago, giovanni said: have you run outlook::refresh? This resolves it. will test balance now Link to comment
TomBenz Posted June 9, 2023 Share Posted June 9, 2023 (edited) 1. Contact search -- it is amazing. many many thanks. - I used Database option as my contacts are in the contacts application instead of Outlook itself. - AddressBook option - is it taking it from Outlook contacts or macOS contacts? I think 2nd as I only get one contact in my Outlook contact. I use iCloud Contact and macOS contacts instead of exchange contacts. - How to tell search not to search for contact name i.e. search for email from:contact that are not in database? It gives Matched query fail error. i.e. how to go back to contact:none option. 2. Saved queries os sq: gives one saved queries. Tried saving more queries by query followed by; in Alfred dialog but it doesn't save or give any message. In saved queries, from:contact gives the same drop down but the query fails though it is a valid search. Edited June 9, 2023 by TomBenz Link to comment
giovanni Posted June 9, 2023 Author Share Posted June 9, 2023 8 hours ago, TomBenz said: it doesn't save or give any message. can you share the string you entered (the content of the Workflow Configuration box named Saved Queries) and the debugger output? Link to comment
TomBenz Posted June 14, 2023 Share Posted June 14, 2023 On 6/9/2023 at 3:28 PM, giovanni said: can you share the string you entered (the content of the Workflow Configuration box named Saved Queries) and the debugger output? @giovanniGiovanni -- are we supposed to add queries in workflow configuration? is it that we just enter ";" in Alfred box at the end to indicate workflow to save queries? How many queries can be saved? Is it possible to add 3-4 default examples sq2: is:read has:attach or sq3: from:FName_LName Link to comment
giovanni Posted June 14, 2023 Author Share Posted June 14, 2023 2 hours ago, TomBenz said: are we supposed to add queries in workflow configuration? yes, ; separated, and = instead of :. for example for your 2 saved queries you would enter in Workflow Configuration:sq2 = is:read has:attach; sq3 = from:FName_LName, then you would see them triggered by sq: TomBenz 1 Link to comment
leeleblanc Posted June 17, 2023 Share Posted June 17, 2023 This workflow is, awesome. 💪 Anyway to be able to get the body of the draft message filled in along with the Subject line? giovanni 1 Link to comment
giovanni Posted June 17, 2023 Author Share Posted June 17, 2023 4 hours ago, leeleblanc said: Anyway to be able to get the body of the draft message filled in along with the Subject line? yes, how would you envision that? For example with a separator (e.g. ///), like this: this is my subject///this is my text body? Link to comment
Marlouis Posted July 19, 2023 Share Posted July 19, 2023 Hi Giovanni and thank you much for this workflow. Would you help me understanding why is mine not working properly ? Link to comment
vitor Posted July 19, 2023 Share Posted July 19, 2023 @Marlouis Check the debugger to see what’s happening. That’s also what workflow authors (like @giovanni) need to find where problems lie. Link to comment
Mark van Mullem Posted August 25, 2023 Share Posted August 25, 2023 Hi, I'm trying to use this workflow within Alfred, and i am able to make a draft email. However i am not able to search my Outlook folders. If i use the debug option it states: File "/Users/Mark/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.91329CD4-92F2-4663-86BF-C12EAF354D81/util.py", line 78, in getFolderData db = sqlite3.connect(OUTLOOK_DB_FILE) sqlite3.OperationalError: unable to open database file Also when i type OL it will then replace it with OLK and Alfred wants to search on the internet. Can someone help me out? Link to comment
kraig85 Posted August 29, 2023 Share Posted August 29, 2023 On 8/25/2023 at 12:28 PM, Mark van Mullem said: Hi, I'm trying to use this workflow within Alfred, and i am able to make a draft email. However i am not able to search my Outlook folders. If i use the debug option it states: File "/Users/Mark/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.91329CD4-92F2-4663-86BF-C12EAF354D81/util.py", line 78, in getFolderData db = sqlite3.connect(OUTLOOK_DB_FILE) sqlite3.OperationalError: unable to open database file Also when i type OL it will then replace it with OLK and Alfred wants to search on the internet. Can someone help me out? Hey, You need to do the following: Open the Workflow in Finder Replace the line in the consts.py document that says "/Users/giovanni/Desktop/Main Profile/Data/Outlook.sqlite" with your own path for your Outlook.sqlite file. (Try looking here: /Users/<username>/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/Outlook.sqlite. Then run the outlook::refresh command from Alfred and it should say done. Hope it works. Ta-da! Craig Link to comment
giovanni Posted September 9, 2023 Author Share Posted September 9, 2023 Thanks for spotting this @kraig85. It should be fixed in the latest release. @Mark van Mullem let me know if you run into trouble. Link to comment
Mark van Mullem Posted September 14, 2023 Share Posted September 14, 2023 Hi Giovanni, That dit the trick! Working as a sunshine! Is it possible to search just the new mails? giovanni 1 Link to comment
giovanni Posted September 17, 2023 Author Share Posted September 17, 2023 On 9/14/2023 at 9:59 AM, Mark van Mullem said: Is it possible to search just the new mails? yes, you can show unread emails only (is:unread), or add a time filter (e.g. since:4, for emails from the last 4 days), or a combination of the 2 which can be saved as a predefined query. TomBenz 1 Link to comment
TomBenz Posted September 23, 2023 Share Posted September 23, 2023 @giovanni This workflow works very good for outlook search. many thanks. I just wanted to check if it can be enhanced to create new email with selected content in any application / website i.e universal action to create new email in outlook with HTML / RTF format. Link to comment
joshuadwagner Posted October 20, 2023 Share Posted October 20, 2023 I just created a workflow that uses Applescript to switch folders in Outlook. @giovanni, If you (or anyone) would like to incorporate it into something else, you're welcome to do so. I'm afraid that this is about the extent of my abilities so I may not be of much help with issues. https://github.com/joshuawagner/alfred-go-to-Outlook-folder/releases/latest 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