xeric Posted March 8, 2018 Posted March 8, 2018 (edited) I create a workflow for searching mail from Outlook for Mac V16 (A.K.A. 2016). Now it support searching Mail sender, Subject and Preview Content with below format: olk [keyword] And also you can search with multiple keywords: olk [keyword1] [keyword2] [keyword3] To limit search scope in one attribute: olk from:[keyword] olk title:[keywords1] [keywords2] ... By default, this workflow searches mail from all folders and with default page size 20, for results more than 20, you can click last item 'Next 20 Results...' to go to next page. You can also configure the search: olkc pagesize [number] for change search result in one result list. olkc folder then you can get a list of all your Outlook folders, choose one to limit search scope. Project hosted in Github: https://github.com/xeric/alfred-outlook Download latest release workflow file from: https://github.com/xeric/alfred-outlook/releases Welcome your feedbacks! Edited March 8, 2018 by xeric utsolomon14, lycopodiopsida, multicolor and 2 others 4 1
Joe O. Posted February 4, 2019 Posted February 4, 2019 This is awesome, but I get an error that says unable to open database. Any ideas on how to fix this?
deanishe Posted February 17, 2019 Posted February 17, 2019 Please don't just post screenshots. They're not much help with identifying and fixing issues.
xeric Posted February 21, 2019 Author Posted February 21, 2019 @Joe O. Please follow below step to get some debug log, then I may dig into what happens: * goto Alfred Preferences -> Workflows and choose Outlook Search in sidemenu * click most right 'bug' icon button in main windows toolbar to step into debug mode * try to trigger Alfred input with your hotkey and input text and something else (at least three characters), you will get some debug information in debug console. Please anonymize some sensitive information in debug info you got. In your case, there may be something wrong with the database path, what you will see in debug log something like: /Users/{yourAccount}/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/ try to access this path you your local file system and check if the path is existing or not.
Joe O. Posted February 21, 2019 Posted February 21, 2019 @xeric Thank you for the reply and offer to help! I followed the instructions above and for some reason, I get no debug output... after 10-20 min it still reads "Starting debug for 'Outlook Search'" Any ideas?
xeric Posted February 22, 2019 Author Posted February 22, 2019 Starting debug for 'Outlook Search' means debug is started, and waiting for your workflow run. Did you try to call out alfred with hot key and input for example "olk test" after you enable debug?
Joe O. Posted February 22, 2019 Posted February 22, 2019 (edited) Oh... LOL. Thank you!! Here it is: Starting debug for 'Outlook Search' [2019-02-22 08:04:11][STDERR: input.scriptfilter] 08:04:11 workflow.py:1689 DEBUG loading cached data: /Users/JOE/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/com.xericwei.alfred/__workflow_update_status.cpickle 08:04:11 workflow.py:2269 DEBUG update_data: {u'available': False} . 08:04:11 workflow.py:2055 DEBUG ---------- Outlook Search (0.1.0) ---------- 08:04:11 workflow.py:1462 DEBUG reading settings from /Users/JOE/Library/Application Support/Alfred 3/Workflow Data/com.xericwei.alfred/settings.json 08:04:11 workflow.py:2339 DEBUG update check not due 08:04:11 main.py:34 INFO searching mail with keyword 08:04:11 workflow.py:2248 DEBUG set last run version: 0.1.0 08:04:11 workflow.py:2097 DEBUG ---------- finished in 0.036s ---------- [2019-02-22 08:04:11][STDERR: input.scriptfilter] 08:04:11 workflow.py:1689 DEBUG loading cached data: /Users/JOE/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/com.xericwei.alfred/__workflow_update_status.cpickle 08:04:11 workflow.py:2269 DEBUG update_data: {u'available': False} . 08:04:11 workflow.py:2055 DEBUG ---------- Outlook Search (0.1.0) ---------- 08:04:11 workflow.py:1462 DEBUG reading settings from /Users/JOE/Library/Application Support/Alfred 3/Workflow Data/com.xericwei.alfred/settings.json 08:04:11 workflow.py:2339 DEBUG update check not due 08:04:11 main.py:34 INFO searching mail with keyword 08:04:11 workflow.py:2248 DEBUG set last run version: 0.1.0 08:04:11 workflow.py:2097 DEBUG ---------- finished in 0.025s ---------- [2019-02-22 08:04:11][ERROR: input.scriptfilter] Code 1: 08:04:11 workflow.py:1689 DEBUG loading cached data: /Users/JOE/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/com.xericwei.alfred/__workflow_update_status.cpickle 08:04:11 workflow.py:2269 DEBUG update_data: {u'available': False} . 08:04:11 workflow.py:2055 DEBUG ---------- Outlook Search (0.1.0) ---------- 08:04:11 workflow.py:1462 DEBUG reading settings from /Users/JOE/Library/Application Support/Alfred 3/Workflow Data/com.xericwei.alfred/settings.json 08:04:11 workflow.py:2339 DEBUG update check not due 08:04:11 main.py:51 INFO /Users/JOE/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/ 08:04:11 main.py:63 INFO query string is: kat 08:04:11 main.py:64 INFO query page is: 0 08:04:11 workflow.py:1579 DEBUG data `pagesize` stored as `cpickle` 08:04:11 workflow.py:1594 DEBUG stored data loaded: /Users/JOE/Library/Application Support/Alfred 3/Workflow Data/com.xericwei.alfred/pagesize.cpickle 08:04:11 workflow.py:1565 DEBUG no data stored for `folder` 08:04:11 workflow.py:2074 ERROR unable to open database file Traceback (most recent call last): File "/Users/JOE/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.88E5C3CF-CD49-4826-9B12-DC868CC4938C/workflow/workflow.py", line 2067, in run func(self) File "main.py", line 32, in main handle(wf, query) File "main.py", line 91, in handle con = sqlite3.connect(outlookData + 'Outlook.sqlite') OperationalError: unable to open database file 08:04:11 workflow.py:2097 DEBUG ---------- finished in 0.027s ---------- [2019-02-22 08:04:12][ERROR: input.scriptfilter] Code 1: 08:04:11 workflow.py:1689 DEBUG loading cached data: /Users/JOE/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/com.xericwei.alfred/__workflow_update_status.cpickle 08:04:11 workflow.py:2269 DEBUG update_data: {u'available': False} . 08:04:11 workflow.py:2055 DEBUG ---------- Outlook Search (0.1.0) ---------- 08:04:11 workflow.py:1462 DEBUG reading settings from /Users/JOE/Library/Application Support/Alfred 3/Workflow Data/com.xericwei.alfred/settings.json 08:04:11 workflow.py:2339 DEBUG update check not due 08:04:11 main.py:51 INFO /Users/JOE/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/ 08:04:11 main.py:63 INFO query string is: kati 08:04:11 main.py:64 INFO query page is: 0 08:04:11 workflow.py:1579 DEBUG data `pagesize` stored as `cpickle` 08:04:11 workflow.py:1594 DEBUG stored data loaded: /Users/JOE/Library/Application Support/Alfred 3/Workflow Data/com.xericwei.alfred/pagesize.cpickle 08:04:11 workflow.py:1565 DEBUG no data stored for `folder` 08:04:11 workflow.py:2074 ERROR unable to open database file Traceback (most recent call last): File "/Users/JOE/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.88E5C3CF-CD49-4826-9B12-DC868CC4938C/workflow/workflow.py", line 2067, in run func(self) File "main.py", line 32, in main handle(wf, query) File "main.py", line 91, in handle con = sqlite3.connect(outlookData + 'Outlook.sqlite') OperationalError: unable to open database file 08:04:11 workflow.py:2097 DEBUG ---------- finished in 0.027s ---------- [2019-02-22 08:04:14][ERROR: input.scriptfilter] Code 1: 08:04:14 workflow.py:1689 DEBUG loading cached data: /Users/JOE/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/com.xericwei.alfred/__workflow_update_status.cpickle 08:04:14 workflow.py:2269 DEBUG update_data: {u'available': False} . 08:04:14 workflow.py:2055 DEBUG ---------- Outlook Search (0.1.0) ---------- 08:04:14 workflow.py:1462 DEBUG reading settings from /Users/JOE/Library/Application Support/Alfred 3/Workflow Data/com.xericwei.alfred/settings.json 08:04:14 workflow.py:2339 DEBUG update check not due 08:04:14 main.py:51 INFO /Users/JOE/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/ 08:04:14 main.py:63 INFO query string is: katie 08:04:14 main.py:64 INFO query page is: 0 08:04:14 workflow.py:1579 DEBUG data `pagesize` stored as `cpickle` 08:04:14 workflow.py:1594 DEBUG stored data loaded: /Users/JOE/Library/Application Support/Alfred 3/Workflow Data/com.xericwei.alfred/pagesize.cpickle 08:04:14 workflow.py:1565 DEBUG no data stored for `folder` 08:04:14 workflow.py:2074 ERROR unable to open database file Traceback (most recent call last): File "/Users/JOE/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.88E5C3CF-CD49-4826-9B12-DC868CC4938C/workflow/workflow.py", line 2067, in run func(self) File "main.py", line 32, in main handle(wf, query) File "main.py", line 91, in handle con = sqlite3.connect(outlookData + 'Outlook.sqlite') OperationalError: unable to open database file 08:04:14 workflow.py:2097 DEBUG ---------- finished in 0.026s ---------so Edited February 22, 2019 by Joe O.
xeric Posted February 25, 2019 Author Posted February 25, 2019 Thanks for this debug information, could you please check if below file/path exists? /Users/JOE/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/Outlook.sqlite From the error you provided, includes screenshot, they pointed to the database file is not existing.
Joe O. Posted February 25, 2019 Posted February 25, 2019 Ok. I think we're getting closer! This is what I see /Users/JOE/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/JOE/Data/Outlook.sqlite and /Users/JOE/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/JOE2/Data/Outlook.sqlite The JOE profile shows: And the JOE2 profile shows: Clearly, JOE2 is the correct and current profile. What do I do to point Aldred at this one?
xeric Posted February 25, 2019 Author Posted February 25, 2019 I see, then I think my workflow did not support point to other profile folder than default one - 'Main Profile'. Please give me some time, I will find how to support non-default profile in next release. Before that, if you hope to use this workflow, here's a 'hack' workaround for my workflow: * goto Alfred Preferences -> Workflows and choose Outlook Search in sidemenu * right click on Outlook Search item and choose Open in Finder * You can see in Finder, there are some *.py files, select main.py and use a text editor open it * In opened file, around 50# line (if it is latest version, it is exactly 50#), it is: outlookData = homePath + r'/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/' now, change 'Main Profile' to 'JOE2', save it, now you have your own hacked and worked version😏
Joe O. Posted February 25, 2019 Posted February 25, 2019 I just did that... and it's still not working. Here is the debug Starting debug for 'Outlook Search' [2019-02-25 07:49:42][ERROR: input.scriptfilter] Code 1: File "main.py", line 1 SyntaxError: encoding problem: uff-8 [2019-02-25 07:49:43][ERROR: input.scriptfilter] Code 1: File "main.py", line 1 SyntaxError: encoding problem: uff-8 [2019-02-25 07:49:43][ERROR: input.scriptfilter] Code 1: File "main.py", line 1 SyntaxError: encoding problem: uff-8 [2019-02-25 07:49:43][ERROR: input.scriptfilter] Code 1: File "main.py", line 1 SyntaxError: encoding problem: uff-8 [2019-02-25 07:49:43][ERROR: input.scriptfilter] Code 1: File "main.py", line 1 SyntaxError: encoding problem: uff-8 [2019-02-25 07:49:43][ERROR: input.scriptfilter] Code 1: File "main.py", line 1 SyntaxError: encoding problem: uff-8 [2019-02-25 07:49:47][ERROR: input.scriptfilter] Code 1: File "main.py", line 1 SyntaxError: encoding problem: uff-8 [2019-02-25 07:49:47][ERROR: input.scriptfilter] Code 1: File "main.py", line 1 SyntaxError: encoding problem: uff-8 [2019-02-25 07:49:47][ERROR: input.scriptfilter] Code 1: File "main.py", line 1 SyntaxError: encoding problem: uff-8 [2019-02-25 07:49:48][ERROR: input.scriptfilter] Code 1: File "main.py", line 1 SyntaxError: encoding problem: uff-8 [2019-02-25 07:49:48][ERROR: input.scriptfilter] Code 1: File "main.py", line 1 SyntaxError: encoding problem: uff-8 [2019-02-25 07:49:49][ERROR: input.scriptfilter] Code 1: File "main.py", line 1 SyntaxError: encoding problem: uff-8
deanishe Posted February 25, 2019 Posted February 25, 2019 (edited) 29 minutes ago, Joe O. said: SyntaxError: encoding problem: uff-8 You broke the script. That should say "utf-8", not "uff-8". Source code Edited February 25, 2019 by deanishe
Joe O. Posted February 25, 2019 Posted February 25, 2019 BINGO!!!! It works!! You guys are AWESOME!! Thank you!
DADIAODIAO Posted February 26, 2019 Posted February 26, 2019 awesome! what would be the advantage compared with the finder?
Joe O. Posted February 26, 2019 Posted February 26, 2019 Finder brings back results for everything and usually the email is at the bottom or does shows 5 results.
xeric Posted February 27, 2019 Author Posted February 27, 2019 @DADIAODIAO Finder can't perform title based, sender based or folder based accurate search, Finder can't display some preview content, beside that if you are searching some history mail, this workflow supports pagination.
xeric Posted February 27, 2019 Author Posted February 27, 2019 (edited) @Joe O. I released version 0.1.1, now it supports configure non-default profile (account), you can use 'olkc profile' to list all available profiles, then you can select and set your default profile. Edited February 27, 2019 by xeric
Joe O. Posted February 27, 2019 Posted February 27, 2019 Awesome! Great job with this workflow! Are you planing to add search for contacts and events? Thank you again for your help!
PS_Mac Posted March 10, 2019 Posted March 10, 2019 Hi, Could you pls post screenshots of preview of Outlook emails? Can I also preview the attachment in that email? If yes, pls post screenshots of them as well. I am not a powerpack user in Alfred. If this works I may go in for powerpack. Hence, this info will help me decide.
xeric Posted March 11, 2019 Author Posted March 11, 2019 @PS_Mac you just can see a little preview content in subtitle in result list - like what you saw in my screenshot, and there's no attachment preview functionality, you have to open the mail by click enter on result and open it in outlook to take a look.
Joe O. Posted March 14, 2019 Posted March 14, 2019 (edited) @xeric I just got an update that broke the workflow again. Now it's pulling from an older profile and doesn't see my current profile. Line 50 of the main.py file reads: outlookData = homePath + OUTLOOK_DATA_PARENT + profile + OUTLOOK_DATA_FOLDER log.info(outlookData) When it used to read: outlookData = homePath + r'/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/' Any recommendations on a fix? Edited March 14, 2019 by Joe O.
xeric Posted March 15, 2019 Author Posted March 15, 2019 @Joe O. Please try to use olkc profile to choose your preferred profile.
Joe O. Posted March 15, 2019 Posted March 15, 2019 I'll try that in a few days. I reverted back to the older version, just to get it working again. Thank you for the reply!
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